From 5c9c8ef1eac0a3868a57ed8fda8bda8cd2453b37 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 22 Sep 2015 14:01:54 +0400 Subject: MDEV-3929 Add system variable explicit_defaults_for_timestamp for compatibility with MySQL --- sql/sql_table.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 61120970ecb..d3a72533ec8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4995,7 +4995,9 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, else create_table_mode= C_ASSISTED_DISCOVERY; - promote_first_timestamp_column(&alter_info->create_list); + if (!opt_explicit_defaults_for_timestamp) + promote_first_timestamp_column(&alter_info->create_list); + if (mysql_create_table_no_lock(thd, db, table_name, create_info, alter_info, &is_trans, create_table_mode) > 0) { @@ -8534,7 +8536,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, } set_table_default_charset(thd, create_info, alter_ctx.db); - promote_first_timestamp_column(&alter_info->create_list); + + if (!opt_explicit_defaults_for_timestamp) + promote_first_timestamp_column(&alter_info->create_list); #ifdef WITH_PARTITION_STORAGE_ENGINE if (fast_alter_partition) -- cgit v1.2.1