[prev in list] [next in list] [prev in thread] [next in thread] 

List:       amarok-devel
Subject:    Postgresql bool comparison bugs
From:       "Seb Ruiz" <ruiz () kde ! org>
Date:       2007-11-06 4:38:54
Message-ID: 60ebdd0b0711052038u706dbefesf4ec020a278e645a () mail ! gmail ! com
[Download RAW message or body]

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/
_______________________________________________
Amarok-devel mailing list
Amarok-devel@kde.org
https://mail.kde.org/mailman/listinfo/amarok-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic