Re: asd

Vincent Danen <[email protected]> Sat, 3 Jul 2004 10:36:16 -0600
Newsgroups gmane.comp.bug-tracking.anthill.devel
Message-ID <[email protected]>
--===============1857418900==
Content-Type: multipart/signed; protocol="application/pgp-signature";
	micalg=pgp-sha1; boundary="Apple-Mail-7-1043710181"
Content-Transfer-Encoding: 7bit


--Apple-Mail-7-1043710181
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


On Jul 3, 2004, at 10:19 AM, Moritz Bunkus wrote:

> 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.

Ok, I see this.  Thanks for the fix.

> 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.

Ouch.

> 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?

This would involve a lot of work, I think.  I typically execute the 
queries as they come, so if I were to do something like this (ie. 
direct writes if using MySQL and transactions if using Postgres), then 
I have to write a query handler.  So instead of doing 
$db->query("whatever") I have to do something like do_query("whatever") 
where do_query is a function that does conditional processing based on 
the DB type.  That's a lot of code to change.

At this point, I'm also doing very limited development on Anthill 
simply due to time.  I plan on putting out 0.3.1 soon with fixes but no 
new features.  At this point, I'm not sure if there will be a new 
features in Anthill beyond what's already there.  I enjoy working on 
Anthill, but there's no benefit/incentive for me to work on it, and 
just no time to do it for fun.

> Transactions are dead easy to use. You 'just' have to do two things:
> 1) Connect with a parameter 'AutoCommit = 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.

On a side note, there are some definite problems with Anthill using 
Postgres that could potentially be very dangerous.  I believe the 
problem comes from PEAR, but I have to do some work to clean around it 
(the problem doesn't appear at all when using MySQL, only Postgres).  
That's my top priority, but even that top priority is pretty low 
compared to a lot of other things I'm doing.

I'll apply your fix to CVS so it gets fixed in the next version, and 
thanks much for it.  =)

-- 
Annvix - Secure Linux Server: http://annvix.org/
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FE6F2AFD : 88D8 0D23 8D4B 3407 5BD7  66F9 2043 D0E5 FE6F 2AFD}

--Apple-Mail-7-1043710181
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFA5uCAIEPQ5f5vKv0RAuVsAKC9vsnn9YGae5NZULii7ekxXWlAygCeK6f0
eNGRCMm1EUd/JU6tEqM4uVQ=
=yGh2
-----END PGP SIGNATURE-----

--Apple-Mail-7-1043710181--



--===============1857418900==
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

--===============1857418900==--