Re: [Postfixadmin-devel] Boolean values
Brought to you by:
christian_boltz,
gingerdog
From: David G. <da...@co...> - 2009-08-21 11:11:32
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Geoff Shang wrote: > Hello, > > I apologise for joining the list and posting immediately on a subject that > may well have had some considerable discussion already. > > We are deploying PostfixAdmin (SVN as of about 17:00 UTC yesterday) on a > new system using PostgreSQL 8.4 and found the following bug. > > If a regular admin (not super) logs in and selects Domain List, the > following error is generated: > > Invalid query: ERROR: column "t" does not exist LINE 4: AND > domain.active=t ^ > > I tracked this down to functions.inc.php line 783. Obviously this needs > to be quoted, as does the next line. > > I see that there's been some recent commits around boolean handling in > PGSQL, so some kind of policy on this might have already been decided. > However, looking at the MySQL and PGSQL documentation suggests that it > would be much easier to use TRUE and FALSE (unquoted) in queries than to > do what is currently done. Current PGSQL (8.4) supports this[1] and has > done since at least version 6.3[2]. MySQL also suppports this[3][4] and > has done since probably version 4.0[5] (MySQL 3.23.49 does *not* support > this, despite the manual[5] suggesting otherwise). > > It just strikes me that you could eliminate quoting issues and eliminate > different boolean handling for each db type at the same time. > > I've not looked at much of the code but would be willing to help with > this. Hi Geoff, The main problem is that MySQL has 0 or 1 for boolean values (i.e. I think the schema uses a tinyint field, rather than boolean); whereas PostgreSQL uses boolean. Christian did suggest that perhaps we move PostgreSQL to use 0/1, but I didn't think this was a good idea. I /think/ I've fixed functions.inc.php for you - but I suspect it [Postfixadmin] will be broken elsewhere. (*Wonders why this has suddenly become an issue, and what changed to screw the boolean values up*) There is a problem with PHP/PostgreSQL date handling at the moment too - I've not sat down to fix this yet, but you will find problems with the last modified columns etc. thanks David. - -- David Goodwin [ david at codepoets dot co dot uk ] [ http://www.codepoets.co.uk ] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqOfDMACgkQ/ISo3RF5V6Y3iQCghqJCkkMadfGHG5V7HrG191Hh vZwAoIk2gh1KfmLpkFVjDnBNhQU9GDBU =ANHo -----END PGP SIGNATURE----- |