mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-8220 Server crashes if started with --enforce-storage-engine option
This commit is contained in:
parent
d602574542
commit
9c41b35b6a
4 changed files with 24 additions and 0 deletions
14
mysql-test/r/enforce_storage_engine_opt.result
Normal file
14
mysql-test/r/enforce_storage_engine_opt.result
Normal file
|
@ -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;
|
1
mysql-test/t/enforce_storage_engine_opt.opt
Normal file
1
mysql-test/t/enforce_storage_engine_opt.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--enforce-storage-engine=myisam
|
6
mysql-test/t/enforce_storage_engine_opt.test
Normal file
6
mysql-test/t/enforce_storage_engine_opt.test
Normal file
|
@ -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;
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue