summaryrefslogtreecommitdiff
path: root/sql/handler.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/handler.cc
parentdd939d6f7e57e418a6f80fb9057eef8823beaff6 (diff)
downloadmariadb-git-5a19908b955a6aeeeb09fb2ce7744d1c52b65a3b.tar.gz
MDEV-19653 Add class Sql_cmd_create_table
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 0b7fbc93cb5..3d091401f4b 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -211,6 +211,40 @@ redo:
}
+bool
+Storage_engine_name::resolve_storage_engine_with_error(THD *thd,
+ handlerton **ha,
+ bool tmp_table)
+{
+#if MYSQL_VERSION_ID < 100300
+ /*
+ Please remove tmp_name when merging to 10.3 and pass m_storage_engine_name
+ directly to ha_resolve_by_name().
+ */
+ LEX_STRING tmp_name;
+ tmp_name.str= const_cast<char*>(m_storage_engine_name.str);
+ tmp_name.length= m_storage_engine_name.length;
+#endif
+ if (plugin_ref plugin= ha_resolve_by_name(thd, &tmp_name, tmp_table))
+ {
+ *ha= plugin_hton(plugin);
+ return false;
+ }
+
+ *ha= NULL;
+ if (thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION)
+ {
+ my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), m_storage_engine_name.str);
+ return true;
+ }
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
+ ER_UNKNOWN_STORAGE_ENGINE,
+ ER_THD(thd, ER_UNKNOWN_STORAGE_ENGINE),
+ m_storage_engine_name.str);
+ return false;
+}
+
+
plugin_ref ha_lock_engine(THD *thd, const handlerton *hton)
{
if (hton)