Bug #3079 Trying to update a Boolean value (tinyint(1) )
Submitted: 5 Mar 2004 15:03 Modified: 5 Mar 2004 15:50
Reporter: Ian Seivert Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.18 OS:Windows (Windows 2000 Server)
Assigned to: Dean Ellis CPU Architecture:Any

[5 Mar 2004 15:03] Ian Seivert
Description:
I have a test database with 4 columns see below.  The isActive field is tinyint(1), supposed to be a (true/false)(yes/no).

+----+-----------+----------+------------+
| id | name      | isActive | date       |
+----+-----------+----------+------------+
|  1 | Ian       |        0 | 0000-00-00 |

See the error below I get everytime I try to update any of the records using the keywords true, True, yes, y.  It works fine if you update to false, but you can not go in reverse.

mysql> update names set name='ian', isactive=true where id=1;
ERROR 1054: Unknown column 'true' in 'field list'

How to repeat:
try to update the isActive field using the SQL keyword True, Yes, y or an alternative

Suggested fix:
Make a True Boolean variable type (single bit) as True/False field. Just like all PostgreSQL, Oracle, and the other SQL servers.
[5 Mar 2004 15:07] Ian Seivert
I over looked the priority with first submit
[5 Mar 2004 15:50] Dean Ellis
TRUE/FALSE constants were implemented in 4.1.0, and a true boolean column type is also on the TODO.  Thank you.