summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-06-14 07:36:47 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2019-06-14 07:36:47 +0200
commit4a3d51c76c131e7b5348d7c714a619f82de32d39 (patch)
tree4fb180861c733e364af930529565a7b799c4833a /sql/sql_alter.cc
parentd9fe615ef6862c85c5aada96d4f5b62b7093177c (diff)
parent50653e021f1678c3c28c6b5886fadb9fcf8d87ff (diff)
downloadmariadb-git-4a3d51c76c131e7b5348d7c714a619f82de32d39.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r--sql/sql_alter.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 0de39e4970f..b3a036eda9e 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -359,6 +359,18 @@ bool Sql_cmd_alter_table::execute(THD *thd)
SELECT_LEX *select_lex= &lex->select_lex;
/* first table of first SELECT_LEX */
TABLE_LIST *first_table= (TABLE_LIST*) select_lex->table_list.first;
+
+ const bool used_engine= lex->create_info.used_fields & HA_CREATE_USED_ENGINE;
+ DBUG_ASSERT((m_storage_engine_name.str != NULL) == used_engine);
+ if (used_engine)
+ {
+ if (resolve_storage_engine_with_error(thd, &lex->create_info.db_type,
+ lex->create_info.tmp_table()))
+ return true; // Engine not found, substitution is not allowed
+ if (!lex->create_info.db_type) // Not found, but substitution is allowed
+ lex->create_info.used_fields&= ~HA_CREATE_USED_ENGINE;
+ }
+
/*
Code in mysql_alter_table() may modify its HA_CREATE_INFO argument,
so we have to use a copy of this structure to make execution