diff options
author | kaa@mbp.local <> | 2008-02-01 13:00:40 +0500 |
---|---|---|
committer | kaa@mbp.local <> | 2008-02-01 13:00:40 +0500 |
commit | 663453d572cdce425787885cf25b6a547b6f2bb1 (patch) | |
tree | db2f46689e159d75cd24ebf189781616442b2aae /mysql-test/t/create.test | |
parent | 6619db580d6b8f4dadd831062be04131e92d8d89 (diff) | |
download | mariadb-git-663453d572cdce425787885cf25b6a547b6f2bb1.tar.gz |
Fix for bug #25162: Backing up DB from 5.1 adds 'USING BTREE' to KEYs
on table creates
The problem was in incompatible syntax for key definition in CREATE
TABLE.
5.0 supports only the following syntax for key definition (see "CREATE
TABLE syntax" in the manual):
{INDEX|KEY} [index_name] [index_type] (index_col_name,...)
While 5.1 parser supports the above syntax, the "preferred" syntax was
changed to:
{INDEX|KEY} [index_name] (index_col_name,...) [index_type]
The above syntax is used in 5.1 for the SHOW CREATE TABLE output, which
led to dumps generated by 5.1 being incompatible with 5.0.
Fixed by changing the parser in 5.0 to support both 5.0 and 5.1 syntax
for key definition.
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r-- | mysql-test/t/create.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 64081c0248a..97a7ea71b29 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1148,4 +1148,28 @@ create table t2 select sql_big_result f1,count(f2) from t1 group by f1; show status like 'handler_read%'; drop table t1,t2; +# +# Bug #25162: Backing up DB from 5.1 adds 'USING BTREE' to KEYs on table creates +# + +# Show that the old syntax for index type is supported +CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1)); +DROP TABLE t1; + +# Show that the new syntax for index type is supported +CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE); +DROP TABLE t1; + +# Show that in case of multiple index type definitions, the last one takes +# precedence + +CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY; +SHOW INDEX FROM t1; +DROP TABLE t1; + +CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY; +SHOW INDEX FROM t1; +DROP TABLE t1; + + --echo End of 5.0 tests |