summaryrefslogtreecommitdiff
path: root/sql/handler.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/handler.cc
parent34b38ad726025b3ede5db0f5b7dfaaafc8d1e754 (diff)
parentb2f76bac035b62899207d443c48da8cd614cd05b (diff)
downloadmariadb-git-4bbd8be482929984b9dceb077187d0fdbbcde4f0.tar.gz
Merge 10.1 into 10.2
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 c20af4e9bc9..914a4dc07b1 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -210,6 +210,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)