Commit 9d2420b9 authored by Anel Husakovic's avatar Anel Husakovic Committed by Vicențiu Ciorbaru

MDEV-12914: Disable silently call of myisam

parent 1cc1d042
...@@ -10460,16 +10460,12 @@ bool check_engine(THD *thd, const char *db_name, ...@@ -10460,16 +10460,12 @@ bool check_engine(THD *thd, const char *db_name,
} }
if (create_info->tmp_table() && if (create_info->tmp_table() &&
ha_check_storage_engine_flag(*new_engine, HTON_TEMPORARY_NOT_SUPPORTED)) ha_check_storage_engine_flag(*new_engine, HTON_TEMPORARY_NOT_SUPPORTED))
{
if (create_info->used_fields & HA_CREATE_USED_ENGINE)
{ {
my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0), my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
hton_name(*new_engine)->str, "TEMPORARY"); hton_name(*new_engine)->str, "TEMPORARY");
*new_engine= 0; *new_engine= 0;
DBUG_RETURN(true); DBUG_RETURN(true);
} }
*new_engine= myisam_hton;
}
DBUG_RETURN(false); DBUG_RETURN(false);
} }
...@@ -18,7 +18,12 @@ t2 CREATE TABLE `t2` ( ...@@ -18,7 +18,12 @@ t2 CREATE TABLE `t2` (
) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 ) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb; CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb;
ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY' ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
#
# MDEV-12914: Engine for temporary tables which are implicitly
# created as RocksDB is substitued siliently with MyIsam
DROP TABLE t2; DROP TABLE t2;
CREATE TEMPORARY TABLE t2 LIKE t1;
ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
SET default_storage_engine = rocksdb; SET default_storage_engine = rocksdb;
CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t1 (a INT PRIMARY KEY);
...@@ -41,6 +46,8 @@ a ...@@ -41,6 +46,8 @@ a
1 1
2 2
FLUSH LOGS; FLUSH LOGS;
CREATE TEMPORARY TABLE t2;
ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1(c1 INT,c2 INT,c3 INT,c4 INT,c5 INT,c6 INT,c7 INT,c8 INT,c9 INT, CREATE TABLE t1(c1 INT,c2 INT,c3 INT,c4 INT,c5 INT,c6 INT,c7 INT,c8 INT,c9 INT,
c10 INT,c11 INT,c12 INT,c13 INT,c14 INT,c15 INT,c16 INT,c17 INT, c10 INT,c11 INT,c12 INT,c13 INT,c14 INT,c15 INT,c16 INT,c17 INT,
......
...@@ -32,19 +32,15 @@ SHOW CREATE TABLE t2; ...@@ -32,19 +32,15 @@ SHOW CREATE TABLE t2;
--error ER_ILLEGAL_HA_CREATE_OPTION --error ER_ILLEGAL_HA_CREATE_OPTION
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb; CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=rocksdb;
--disable_parsing --echo #
--echo # MDEV-12914: Engine for temporary tables which are implicitly
--echo # created as RocksDB is substitued siliently with MyIsam
DROP TABLE t2; DROP TABLE t2;
--error ER_ILLEGAL_HA_CREATE_OPTION
CREATE TEMPORARY TABLE t2 LIKE t1; CREATE TEMPORARY TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
DROP TEMPORARY TABLE t2;
--enable_parsing
DROP TABLE t2;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
# CREATE .. AS SELECT # CREATE .. AS SELECT
...@@ -65,6 +61,10 @@ SELECT * FROM t1; ...@@ -65,6 +61,10 @@ SELECT * FROM t1;
# Just to add FLUSH LOGS into the mix while we are in the most common test # Just to add FLUSH LOGS into the mix while we are in the most common test
FLUSH LOGS; FLUSH LOGS;
# Test temporary tables with default engine, part of MDEV-12914
--error ER_ILLEGAL_HA_CREATE_OPTION
CREATE TEMPORARY TABLE t2;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
# CREATE TABLE with MAX_INDEXES (64) keys and no primary key # CREATE TABLE with MAX_INDEXES (64) keys and no primary key
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment