asd

Moritz Bunkus <[email protected]> Sat, 3 Jul 2004 18:19:36 +0200
Newsgroups gmane.comp.bug-tracking.anthill.devel
Message-ID <[email protected]>
--===============1262295198==
Content-Disposition: inline
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="TxukmIqg3MmZ0Kmh"


--TxukmIqg3MmZ0Kmh
Content-Type: multipart/mixed; boundary="kkRamCq5m5VQq0L6"
Content-Disposition: inline


--kkRamCq5m5VQq0L6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

query.php tries to limit the number of chars entered in input boxes by
using 'maxsize'. However, the correct keyword is 'maxlength' which has
been used in all the other PHP files. I'll attach a trivial fix.

This can lead to severe problems. If (like I have) someone enters too
long a value, e.g. for the 'fixedver' field, then the database update
will fail, and no diff mail will be generated! Some of the changes will
have already been committed, though.

Example: I resolve a bug and set its status to FIXED. At the same moment
I enter a fixed version like '20040701-110000CEST' which should indicate
a date. This is way longer than the varchar(8) that's been reserved in
the database. So the change to FIXED gets committed, but the update on
'bugactivity' fails. No mail is sent.

This is where I have a wish. Postgres supports transactions, and this is
the perfect case where using transactions would definitely improve
things. I don't know how much time you have - but maybe you could look
into using transactions if the DB is postgres?

Transactions are dead easy to use. You 'just' have to do two things:
1) Connect with a parameter 'AutoCommit =3D 0' (that's in Perl, I don't
know what it's called in the PHP interface).
2) Execute all the queries that belong to one transaction, e.g. update
bugs, bugactivity. Then call 'commit' on the database. Now if one of the
queries failed, then all the actions up to this point will NOT be
executed. No inconsistencies.

I might look into this myself, but I really have no experience with PHP,
so I'd rather avoid it.

Thanks.

Mosu

--=20
If Darl McBride was in charge, he'd probably make marriage
unconstitutional too, since clearly it de-emphasizes the commercial
nature of normal human interaction, and probably is a major impediment
to the commercial growth of prostitution. - Linus Torvalds

--kkRamCq5m5VQq0L6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="query-maxlength.php.diff"
Content-Transfer-Encoding: quoted-printable

Index: query.php
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/anthill-0.3/html/query.php,v
retrieving revision 1.72
diff -u -r1.72 query.php
--- query.php	25 Jun 2004 16:17:07 -0000	1.72
+++ query.php	3 Jul 2004 16:10:29 -0000
@@ -1096,11 +1096,11 @@
                 $p_resolvebutton .=3D "</select><br />";
=20
                 $p_fixedfield     =3D gettext("If FIXED, you may also sele=
ct a version:");
-                $p_fixedfield    .=3D "<input type=3D\"text\" name=3D\"fix=
edver\" size=3D\"8\" maxsize=3D\"8\"><br />";
+                $p_fixedfield    .=3D "<input type=3D\"text\" name=3D\"fix=
edver\" size=3D\"8\" maxlength=3D\"8\"><br />";
=20
                 $p_mkdupebutton   =3D "<input type=3D\"radio\" name=3D\"sb=
utton\" value=3D\"duplicate\">";
                 $p_mkdupebutton  .=3D gettext("Resolve bug, make it a dupl=
icate of problem") . " #";
-                $p_mkdupebutton  .=3D "<input type=3D\"text\" name=3D\"dup=
_id\" size=3D\"6\" maxsize=3D\"6\"><br />";
+                $p_mkdupebutton  .=3D "<input type=3D\"text\" name=3D\"dup=
_id\" size=3D\"6\" maxlength=3D\"6\"><br />";
=20
                 $p_closebutton    =3D "<input type=3D\"radio\" name=3D\"sb=
utton\" value=3D\"close\">";
                 $p_closebutton   .=3D gettext("Close bug with no resolutio=
n") . "<br />";
@@ -1134,7 +1134,7 @@
                 $p_reopenbutton .=3D gettext("Re-open bug") . "<br />";
=20
                 $p_fixedfieldres  =3D gettext("If FIXED, you may also sele=
ct a version:");
-                $p_fixedfieldres .=3D "<input type=3D\"text\" name=3D\"fix=
edver\" size=3D\"8\" maxsize=3D\"8\" value=3D\"$fixinver\"><br />";
+                $p_fixedfieldres .=3D "<input type=3D\"text\" name=3D\"fix=
edver\" size=3D\"8\" maxlength=3D\"8\" value=3D\"$fixinver\"><br />";
             }
=20
             $data .=3D <<<EOT

--kkRamCq5m5VQq0L6--

--TxukmIqg3MmZ0Kmh
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA5tyYTJ9OsraNuaERAosxAJkBeuGrSBHJEf0MSXC+am7tkkcD1QCgjGHq
ekvcrbm/ozACKdB2Wx5vU5U=
=Ci+0
-----END PGP SIGNATURE-----

--TxukmIqg3MmZ0Kmh--


--===============1262295198==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Anthill-workers mailing list
Anthill-workers-+mQDA36h6dWw5LPnMra/[email protected]
http://vmlinuz.ca/mailman/listinfo/anthill-workers

--===============1262295198==--