diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-06-01 16:33:41 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-06-01 16:33:41 +0200 |
commit | 9c41b35b6aa7eba86273f8634dd6d633b140211e (patch) | |
tree | 06db4a3be3ee5ce1745cb2969f102fb6287f5edc | |
parent | d60257454213ac465c94b441fca477524b7dee82 (diff) | |
download | mariadb-git-9c41b35b6aa7eba86273f8634dd6d633b140211e.tar.gz |
MDEV-8220 Server crashes if started with --enforce-storage-engine option
-rw-r--r-- | mysql-test/r/enforce_storage_engine_opt.result | 14 | ||||
-rw-r--r-- | mysql-test/t/enforce_storage_engine_opt.opt | 1 | ||||
-rw-r--r-- | mysql-test/t/enforce_storage_engine_opt.test | 6 | ||||
-rw-r--r-- | sql/sql_plugin.cc | 3 |
4 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/enforce_storage_engine_opt.result b/mysql-test/r/enforce_storage_engine_opt.result new file mode 100644 index 00000000000..a28461ef091 --- /dev/null +++ b/mysql-test/r/enforce_storage_engine_opt.result @@ -0,0 +1,14 @@ +create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; +Warnings: +Note 1266 Using storage engine MyISAM for table 't1' +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` varchar(10) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +set session sql_mode='no_engine_substitution'; +create table t2 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; +ERROR 42000: Unknown storage engine 'MEMORY' +drop table t1; diff --git a/mysql-test/t/enforce_storage_engine_opt.opt b/mysql-test/t/enforce_storage_engine_opt.opt new file mode 100644 index 00000000000..9f09b57e395 --- /dev/null +++ b/mysql-test/t/enforce_storage_engine_opt.opt @@ -0,0 +1 @@ +--enforce-storage-engine=myisam diff --git a/mysql-test/t/enforce_storage_engine_opt.test b/mysql-test/t/enforce_storage_engine_opt.test new file mode 100644 index 00000000000..82cc4117cdb --- /dev/null +++ b/mysql-test/t/enforce_storage_engine_opt.test @@ -0,0 +1,6 @@ +create table t1 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; +show create table t1; +set session sql_mode='no_engine_substitution'; +--error 1286 +create table t2 (c1 int primary key auto_increment, c2 varchar(10)) engine=memory; +drop table t1; diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 85e2151d888..847669d84ea 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -3107,6 +3107,9 @@ void plugin_thdvar_init(THD *thd) if (global_system_variables.tmp_table_plugin) thd->variables.tmp_table_plugin= intern_plugin_lock(NULL, global_system_variables.tmp_table_plugin); + if (global_system_variables.enforced_table_plugin) + thd->variables.enforced_table_plugin= + intern_plugin_lock(NULL, global_system_variables.enforced_table_plugin); intern_plugin_unlock(NULL, old_table_plugin); intern_plugin_unlock(NULL, old_tmp_table_plugin); intern_plugin_unlock(NULL, old_enforced_table_plugin); |