Bug #7217 information_schema: columns are varbinary() instead of timestamp
Submitted: 13 Dec 2004 1:26 Modified: 23 Feb 2005 14:07
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha-debug OS:Linux (SUSE 9.2)
Assigned to: Sergei Glukhov CPU Architecture:Any

[13 Dec 2004 1:26] Peter Gulutzan
Description:
There are information_schema columnss which contain the date and 
time of the last creation or update. They have data type = 
'varbinary(19)'. But that's not appropriate. 
They should have data type = 'timestamp'. 
This is true for the TABLES table (create_time, update_time, check_time) 
and for the ROUTINES table (created, last_altered). 
 
 

How to repeat:
mysql> select column_name, data_type from information_schema.columns where 
table_name = 'routines' and column_name='created'; 
+-------------+-----------+ 
| column_name | data_type | 
+-------------+-----------+ 
| CREATED     | varbinary | 
+-------------+-----------+ 
1 row in set (0.52 sec)
[16 Feb 2005 10:38] Alexander Barkov
I suggest to add a new function:

create_tmp_field_for_schema() and to move datetime handling inside
this new function. And then change this code 

+      Field *new_field;
+      if (param->schema_table && item->field_type() == MYSQL_TYPE_DATETIME)
+        new_field= new Field_datetime(item->maybe_null, item->name, table,
+                                      &my_charset_bin);
+      else
+        new_field= create_tmp_field(thd, table, item, type, &copy_func,
+                                    tmp_from_field, group != 0,
+                                    not_all_columns || group !=0,
+                                    param->convert_blob_length);

To this:

+      Field *new_field= (param->schema_table) ?
+        create_tmp_field_for_schema(<necessary arguments>) :
+        create_tmp_field(thd, table, item, type, &copy_func,
+                                 tmp_from_field, group != 0,
+                                 not_all_columns || group !=0,
+                                  param->convert_blob_length);
[23 Feb 2005 11:17] Alexander Barkov
Ok to push.
[23 Feb 2005 11:39] Sergei Glukhov
Fixed in 5.0.3
[23 Feb 2005 14:07] Paul DuBois
Noted in 5.0.3 changelog.