summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-06-12 10:25:34 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-06-12 10:30:01 +0300
commit4bbd8be482929984b9dceb077187d0fdbbcde4f0 (patch)
tree64e98c1390baa3c35f3a18845ef4155fc3092ac1 /sql/sql_alter.cc
parent34b38ad726025b3ede5db0f5b7dfaaafc8d1e754 (diff)
parentb2f76bac035b62899207d443c48da8cd614cd05b (diff)
downloadmariadb-git-4bbd8be482929984b9dceb077187d0fdbbcde4f0.tar.gz
Merge 10.1 into 10.2
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 b75c3a82858..8716dde5727 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -194,6 +194,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