summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-05-31 15:24:40 +0400
committerAlexander Barkov <bar@mariadb.com>2019-05-31 16:22:53 +0400
commit5a19908b955a6aeeeb09fb2ce7744d1c52b65a3b (patch)
tree05da05a68f61c10a340c82ef7ae7286b12e728d6 /sql/sql_alter.cc
parentdd939d6f7e57e418a6f80fb9057eef8823beaff6 (diff)
downloadmariadb-git-5a19908b955a6aeeeb09fb2ce7744d1c52b65a3b.tar.gz
MDEV-19653 Add class Sql_cmd_create_table
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 e37d5471f41..8ec68bf4876 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -193,6 +193,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