mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Add test cases to verify that SHOW CREATE TABLE always outputs the
key algorithm for keys where they were explicitly specified. mysql-test/r/show_check.result: Add results mysql-test/t/show_check.test: Add tests for preservation of key algorithm in SHOW CREATE TABLE output
This commit is contained in:
@ -405,3 +405,73 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
|||||||
delete from mysql.db
|
delete from mysql.db
|
||||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` (`i`)
|
||||||
|
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` TYPE HASH (`i`)
|
||||||
|
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` TYPE BTREE (`i`)
|
||||||
|
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` (`i`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` TYPE BTREE (`i`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` (`i`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
ALTER TABLE t1 ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` (`i`)
|
||||||
|
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` TYPE BTREE (`i`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
ALTER TABLE t1 ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`i` int(11) default NULL,
|
||||||
|
KEY `i` TYPE BTREE (`i`)
|
||||||
|
) ENGINE=HEAP DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -321,3 +321,35 @@ flush privileges;
|
|||||||
#--replace_column 7 # 8 # 9 #
|
#--replace_column 7 # 8 # 9 #
|
||||||
#show table status from `<60>` LIKE '<27>';
|
#show table status from `<60>` LIKE '<27>';
|
||||||
#drop database `<60>`;
|
#drop database `<60>`;
|
||||||
|
|
||||||
|
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
|
||||||
|
# specified during table creation, but not otherwise. (Bug #7235)
|
||||||
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
# Test that when an index is created with the default key algorithm and
|
||||||
|
# altered to another storage engine, it gets the default key algorithm
|
||||||
|
# for that storage engine, but when it is specified, the specified type is
|
||||||
|
# preserved.
|
||||||
|
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
ALTER TABLE t1 ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
ALTER TABLE t1 ENGINE=MEMORY;
|
||||||
|
SHOW CREATE TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
Reference in New Issue
Block a user