Bug #10535 Default value for a bit field is not displayed properly in show create table.
Submitted: 11 May 2005 10:18 Modified: 12 May 2005 21:26
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.5 Beta OS:Windows (Windows 2003)
Assigned to: CPU Architecture:Any

[11 May 2005 10:18] Disha
Description:
The default value specified for a bit column is not displayed properly when viewed through show create table.

How to repeat:
1. Start the MySQL client and connect to the database with valid user and password.
2. Set the delimiter to //
3. Create a table with bit data type specifying a default value as follows:
   create table t1(f1 bit(8) default b'11100011')//
4. Execute the show create table command for the above created table:
   show create table t1//

Expected Results: 
1. The show create table command should display the default value correctly.

Actual Results: 
1. The show create table does not display the default value and displays a question mark as follows:

   mysql> show create table t1//
   +-------+--------------------------------------------
   | Table | Create Table
   +-------+--------------------------------------------
   | t1    | CREATE TABLE `t1` (
     `f1` bit(8) default '?'
   ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
   +-------+--------------------------------------------
   1 row in set (0.00 sec)
   mysql>
[11 May 2005 20:43] MySQL Verification Team
Verified on Linux.
[12 May 2005 21:26] Sergei Golubchik
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

b'...' notation specifies a *string*
And SHOW CREATE TABLE shows it as a string - it's one character string with a value of CHAR(227).  (because 227d = 11100011b)

Depending on your @@character_set_result settings, MySQL can either convert CHAR(227) to
the result character set or print '?' if it cannot be converted.