summaryrefslogtreecommitdiff
path: root/mysql-test/t/show_check.test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-01-13 18:22:35 +0100
committerunknown <jimw@mysql.com>2005-01-13 18:22:35 +0100
commita28f221f35622b799e34a6e05c66555a6ffe9b81 (patch)
tree3b07a4fe42380db195f53c3c2236b030be226dcb /mysql-test/t/show_check.test
parent76266f19e8a1f3fd4ec019a07775e3c8edf699a4 (diff)
downloadmariadb-git-a28f221f35622b799e34a6e05c66555a6ffe9b81.tar.gz
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
Diffstat (limited to 'mysql-test/t/show_check.test')
-rw-r--r--mysql-test/t/show_check.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 7788215dd27..cd8d4dba6ab 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -321,3 +321,35 @@ flush privileges;
#--replace_column 7 # 8 # 9 #
#show table status from `ä` LIKE 'ä';
#drop database `ä`;
+
+# 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;