boolean needs to return a convertable value over the wire

Bug #708365 reported by Monty Taylor
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Wishlist
Monty Taylor
7.0
Fix Released
Wishlist
Monty Taylor

Bug Description

When we return the boolean type, we need to return it as someting, probably an INT with a value of 0 or 1, which can be consumed by scripting language connnectors without additional context. The current varchar "TRUE"|"FALSE" is opaque at that level and causes test suite failures (specifically in sqlalchemy)

Related branches

Revision history for this message
Marcus Eriksson (krummas) wrote :

Same problem for drizzle-jdbc

TIME is reported as TIMESTAMP and BOOLEAN as VARCHAR

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

In PHP everything coming from mysql or drizzle is stored a string but converted to whatever type is needed on the fly.

So "FALSE" == true in PHP unfortunately, I think either a hack in the PHP module or using 0 and 1 are the only ways to fix it for PHP (of course a hack in the PHP module won't help with mysql connectors).

Revision history for this message
Olaf van der Spek (olafvdspek) wrote :

IMO 0 and 1 are the only right things to send over the wire. Why would you waste 6 bytes for "false" if it can be send with a single bit? Presentation layers can convert the 0/1 to false/true if necessary.

Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

Olaf: to stay compatible with the MySQL protocol (amongst other things) we will need to send it as at least one full byte, possibly 4 bytes (I can't remember how TINYINT is sent on the wire). There are lots of things to consider here.

Monty Taylor has a solution that seems to work now.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.