Postgresql bool comparison bugs

Peter C. Ndikuwera pndiku at gmail.com
Tue Nov 6 09:19:46 CET 2007


Strange.

I've run postgres with Amarok
exclusively for ages and haven't seen any such bugs. But... since I
don't use podcasts much, I'll test this and get back to you.

Peter

On 06/11/2007, 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.
>
> 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/
>



-- 
"Happiness makes up in height what it lacks in length"
-- Robert Frost
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/amarok-devel/attachments/20071106/fd47ab07/attachment.html 


More information about the Amarok-devel mailing list