diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-10-30 16:42:46 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-10-30 16:42:46 +0400 |
commit | 003cb2f42477772ae43228c0bc0f8492246b9340 (patch) | |
tree | 680314d232d55b5a41dc2b2f5b500677e4aff183 /sql/sql_table.cc | |
parent | 84ed288f6807a4602e0af8615bfb17080df15160 (diff) | |
parent | 58e0dcb93dc2b2bf49f76c754bd216dbdf875a0d (diff) | |
download | mariadb-git-003cb2f42477772ae43228c0bc0f8492246b9340.tar.gz |
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c85a8be85ab..c9057849ed5 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4037,7 +4037,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (!sql_field->default_value && !sql_field->has_default_function() && (sql_field->flags & NOT_NULL_FLAG) && - !sql_field->is_timestamp_type()) + (!sql_field->is_timestamp_type() || + opt_explicit_defaults_for_timestamp)) { sql_field->flags|= NO_DEFAULT_VALUE_FLAG; sql_field->pack_flag|= FIELDFLAG_NO_DEFAULT; @@ -4046,6 +4047,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, if (thd->variables.sql_mode & MODE_NO_ZERO_DATE && !sql_field->default_value && !sql_field->vcol_info && sql_field->is_timestamp_type() && + !opt_explicit_defaults_for_timestamp && (sql_field->flags & NOT_NULL_FLAG) && (type == Field::NONE || type == Field::TIMESTAMP_UN_FIELD)) { @@ -6930,7 +6932,6 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled, case Alter_info::LEAVE_AS_IS: if (!indexes_were_disabled) break; - /* disabled indexes */ /* fall through */ case Alter_info::DISABLE: error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE); |