Re: Boolean data types and Creole

Lukas Smith <[email protected]>
Newsgroups gmane.comp.php.pear.liveuser
Organization BackendMedia GbR
Message-ID <[email protected]>
DrSlump wrote:
> Hi,
> 
> I've implemented auth and perm drivers for the Creole library. I have a 
> doubt though, MDB2 seems to use a CHAR(1) type (at least for MySQL) to 
> repressent a boolean value. It can be 'Y' or 'N' depending on if it's 
> true or false respectively. However Creole will return true for any 
> character which is not an space or '0', basicly it casts to bool the 
> field value.
> The problem is that the 'N' used by MDB2 will be handled as true by 
> Creole. This shouldn't be a problem if the tables are to be created and 
> used by the same drivers but if they are created by one of them and then 
> used later by another this can cause unexpected results.
> 
> So, should I modify the Creole drivers to check for the 'N' as a value 
> for false or should all the DB drivers (in liveuser_admin I suppose) 
> threat boolean fields in the same way?

No, its quite a lot of work to get this to work in the admin container 
(especially in the admin api). we have the same issue with the DB 
driver. so just use 0/1.

> As a side note, I'm going to implement support for Creole in 
> liveuser_admin. That seems a more complex task though, so I'm wondering 
> if there are some unit tests already made for that package :)

cool .. there are no real unit tests .. i started on some for the client 
a while back .. as you can see from the roadmap .. its on the todo

regards,
Lukas Smith
[email protected]
_______________________________
   BackendMedia
   www.backendmedia.com
   [email protected]

   Linn Zwoch Smith GbR
   Pariser Str. 44
   D-10707 Berlin

   Tel +49 30 83 22 50 00
   Fax +49 30 83 22 50 07
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.