summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2015-03-10 08:28:51 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2015-03-12 12:17:14 +0200
commit8249dcaaebf8cd1944bd4ab7ccaa8b199e76d6f9 (patch)
tree66a9b1c65f0f220e305681fa41811886fa05d908 /mysql-test/r
parentba3573cae8f0d269452cc6213f1a8243e455830e (diff)
downloadmariadb-git-8249dcaaebf8cd1944bd4ab7ccaa8b199e76d6f9.tar.gz
MDEV-6858: enforce_storage_engine option
Merge from Percona Server enforced use of a specific storage engine authored by Stewart Smith. Modified to be session variable and modifiable only by SUPER. Use similar implementation as default_storage_engine.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/enforce_storage_engine.result102
-rw-r--r--mysql-test/r/mysqld--help.result3
2 files changed, 105 insertions, 0 deletions
diff --git a/mysql-test/r/enforce_storage_engine.result b/mysql-test/r/enforce_storage_engine.result
new file mode 100644
index 00000000000..3b29d5ecb09
--- /dev/null
+++ b/mysql-test/r/enforce_storage_engine.result
@@ -0,0 +1,102 @@
+drop table if exists t1;
+SET SESSION enforce_storage_engine=MyISAM;
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+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
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+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
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+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
+DROP TABLE t1;
+SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+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
+INSERT INTO t1 values (1,'abba');
+CREATE TABLE t2 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+ERROR 42000: Unknown storage engine 'MEMORY'
+SET SESSION sql_mode='';
+SET SESSION enforce_storage_engine=MyISAM;
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+select * from t1;
+c1 c2
+1 abba
+drop table t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+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
+DROP TABLE t1;
+SET SESSION enforce_storage_engine=FooBar;
+ERROR 42000: Unknown storage engine 'FooBar'
+select @@session.enforce_storage_engine;
+@@session.enforce_storage_engine
+MyISAM
+SET SESSION enforce_storage_engine=MyISAM;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SET SESSION enforce_storage_engine=NULL;
+SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
+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=MEMORY DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=MyISAM;
+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
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10));
+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
+DROP TABLE t1;
+SET GLOBAL enforce_storage_engine=NULL;
+ERROR HY000: Variable 'enforce_storage_engine' is a SESSION variable and can't be used with SET GLOBAL
diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result
index 3036700be6f..7d59ecd1dc2 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -169,6 +169,8 @@ The following options may be given as the first argument:
Which encryption algorithm to use for table encryption.
aes_cbc is the recommended one.. One of: none, aes_ecb,
aes_cbc, aes_ctr
+ --enforce-storage-engine=name
+ Force the use of a storage engine for new tables
--event-scheduler[=name]
Enable the event scheduler. Possible values are ON, OFF,
and DISABLED (keep the event scheduler completely
@@ -1150,6 +1152,7 @@ delayed-queue-size 1000
div-precision-increment 4
encrypt-tmp-disk-tables FALSE
encryption-algorithm none
+enforce-storage-engine (No default value)
event-scheduler OFF
expensive-subquery-limit 100
expire-logs-days 0