summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-09-22 14:01:54 +0400
committerAlexander Barkov <bar@mariadb.org>2015-09-22 14:01:54 +0400
commit5c9c8ef1eac0a3868a57ed8fda8bda8cd2453b37 (patch)
tree88739fffdf78de796c665affa6beb8687ca25a2b /sql/sql_table.cc
parent89af0f11a83188cb2bfbfed0b54c00d718734995 (diff)
downloadmariadb-git-5c9c8ef1eac0a3868a57ed8fda8bda8cd2453b37.tar.gz
MDEV-3929 Add system variable explicit_defaults_for_timestamp for compatibility with MySQL
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc8
1 files changed, 6 insertions, 2 deletions
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)