• unknown's avatar
    A patch for Bug#18834: ALTER TABLE ADD INDEX on table with · 5704c7fe
    unknown authored
    two timestamp fields.
      
    The actual problem here was that CREATE TABLE allowed zero
    date as a default value for a TIMESTAMP column in NO_ZERO_DATE mode.
      
    The thing is that for TIMESTAMP date type specific rule is applied:
      column_name TIMESTAMP == column_name TIMESTAMP DEFAULT 0
    whever for any other date data type
      column_name TYPE == column_name TYPE DEFAULT NULL
      
    The fix is to raise an error when we're in NO_ZERO_DATE mode and
    there is TIMESTAMP column w/o default value.
    
    
    mysql-test/r/create.result:
      Update result file.
    mysql-test/t/create.test:
      Test case for Bug#18834: ALTER TABLE ADD INDEX on table with
      two timestamp fields.
    sql/sql_table.cc:
      Report an error if NO_ZERO_MODE is set and we have zero date
      as a default.
    5704c7fe
create.result 104 KB