• unknown's avatar
    Fix for bugs #1885, #2464, #2539. Proper handling of default · 4d83e9d1
    unknown authored
    values for TIMESTAMP columns. The solution is not perfect since
    we just silently ignoring default value for first TIMESTAMP 
    column and properly reflecting this fact in SHOW CREATE TABLE.
    We can't give a warning or simply support standard syntax 
    (niladic functions as legal value for default) for first field 
    since it is 4.0 tree.
    
    
    mysql-test/r/type_timestamp.result:
      Added test for bugs #1885, #2464, #2539
      (proper support of default values for TIMESTAMP columns)
    mysql-test/t/type_timestamp.test:
      Added test for bugs #1885, #2464, #2539
      (proper support of default values for TIMESTAMP columns)
    sql/field.cc:
      Enabled copying of defaults for TIMESTAMP fields when we are 
      creating table with CREATE TABLE x (SELECT ...)
    sql/field.h:
      Set proper DEFAULT value for non-first TIMESTAMP column.
    sql/sql_parse.cc:
      Allowed default values for TIMESTAMP column.
    sql/sql_show.cc:
      Enabled printing of default values in SHOW CREATE TABLE and 
      SHOW COLUMNS for all TIMESTAMP columns except first one.
    4d83e9d1
sql_parse.cc 109 KB