Postgresql bool comparison bugs

Dan Meltzer parallelgrapefruit at gmail.com
Tue Nov 6 06:37:10 CET 2007


On 11/5/07, Seb Ruiz <ruiz at kde.org> wrote:
> Hi All,
> There is a rather serious bug with the postgres backend which makes
> all boolean values to be incorrectly read from the database. Case in
> point is saving "auto transfer" or "purge" properties from podcast
> channel settings. I have established that the correct boolean entry is
> written to the database, but our code is always returning false.
>
> If you look at this code:
>
> pcb.setAutoScan( *++it == boolT() ? true : false );
>
> Where *++it is the iterator pointing to a QString which is the result
> returned from the database.
>
> boolT() returns "true" for postgres connections, however the database
> will return "t" as an indicator for a true boolean. The converse is
> not a problem since psql accepts any sort of 'truthy' value as input
> (eg, 1, true, t, y).
>
> I do not know if psql < 8 return "t" or "true" - this is my only
> concern. Except, that most distros will ship psql 8.1/8.2.

Checking the postgre handbook, it appears "t" has been returned from
at least 6.2.
>
> I am not actually running psql so I cannot test it, it is simply a
> theory which I am confident that I am correct with.
>
> Thoughts please.
>
>
> --
> Seb Ruiz
>
> http://www.sebruiz.net/
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel
>


More information about the Amarok-devel mailing list