Bug #9019 When using tinyInt1isBit=true updates with 'true' are not converted to 1 but 0
Submitted: 7 Mar 2005 12:42 Modified: 8 Mar 2005 19:02
Reporter: Hack Kampbjørn Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version: OS:
Assigned to: CPU Architecture:Any

[7 Mar 2005 12:42] Hack Kampbjørn
Description:
When a connection is made with tinyInt1isBit=true (default property) SQL scripts that use 'true' as a column value for the tinyint columns are treated as false.

UPDATE plane_legs
      SET allow_get_off = 'true',
            allow_get_on = 'true'
 WHERE plane_legs_id = 5

The two columns will be set to 0 (false) and not true as expected.

How to repeat:
Open a table with bit columns (tinyint(1)) in DbVisualizer and right click on a record in the data tab and select SCRIPT: UPDATE WHERE. Execute the script created in the SQL Commander and set all the tinyint columns to true. Refresh the data view. All the tinyint columns are reported as 'false'

Suggested fix:
Update the driver to change 'true'/'false' in updates for tinyint columns to 1/0
[8 Mar 2005 19:02] Mark Matthews
It looks like what you're asking for is for the driver to re-write your query, which is something we won't ever do.

If you need to use true/false in your queries, than the SQL standard way is _not_ to quote them, i.e. 'true' != true and 'false' != false.