| 1 |
CREATE TABLE t1 (a <INT_COLUMN>, |
| 2 |
b <CHAR_COLUMN>, |
| 3 |
<CUSTOM_INDEX> (a) |
| 4 |
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; |
| 5 |
SHOW KEYS IN t1; |
| 6 |
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment |
| 7 |
t1 1 a 1 a # # NULL NULL # BTREE |
| 8 |
DROP TABLE t1; |
| 9 |
CREATE TABLE t1 (a <INT_COLUMN>, |
| 10 |
b <CHAR_COLUMN>, |
| 11 |
<CUSTOM_INDEX> a_b (a,b) COMMENT 'a_b index' |
| 12 |
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; |
| 13 |
SHOW KEYS IN t1; |
| 14 |
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment |
| 15 |
t1 1 a_b 1 a # # NULL NULL # BTREE a_b index |
| 16 |
t1 1 a_b 2 b # # NULL NULL # BTREE a_b index |
| 17 |
DROP TABLE t1; |
| 18 |
CREATE TABLE t1 (a <INT_COLUMN>, |
| 19 |
b <CHAR_COLUMN>, |
| 20 |
<CUSTOM_INDEX> (a), |
| 21 |
<CUSTOM_INDEX> (b) |
| 22 |
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; |
| 23 |
SHOW KEYS IN t1; |
| 24 |
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment |
| 25 |
t1 1 a 1 a # # NULL NULL # BTREE |
| 26 |
t1 1 b 1 b # # NULL NULL # BTREE |
| 27 |
DROP TABLE t1; |
| 28 |
CREATE TABLE t1 (a <INT_COLUMN>, |
| 29 |
b <CHAR_COLUMN>, |
| 30 |
UNIQUE INDEX (a) |
| 31 |
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; |
| 32 |
SHOW KEYS IN t1; |
| 33 |
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment |
| 34 |
t1 0 a 1 a # # NULL NULL # BTREE |
| 35 |
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); |
| 36 |
INSERT INTO t1 (a,b) VALUES (1,'c'); |
| 37 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 38 |
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). |
| 39 |
# If you got a difference in error message, just add it to rdiff file |
| 40 |
DROP TABLE t1; |
| 41 |
CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; |
| 42 |
INSERT INTO t1 (a,b) VALUES (100,'z'); |
| 43 |
ALTER TABLE t1 ADD <CUSTOM_INDEX> (a) COMMENT 'simple index on a'; |
| 44 |
SHOW INDEX FROM t1; |
| 45 |
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment |
| 46 |
t1 1 a 1 a # # NULL NULL # BTREE simple index on a |
| 47 |
ALTER TABLE t1 DROP KEY a; |
| 48 |
DROP TABLE t1; |
| 49 |
CREATE TABLE t1 (a <INT_COLUMN>, |
| 50 |
b <CHAR_COLUMN>, |
| 51 |
UNIQUE INDEX (a) |
| 52 |
) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>; |
| 53 |
SHOW KEYS IN t1; |
| 54 |
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment |
| 55 |
t1 0 a 1 a # # NULL NULL # BTREE |
| 56 |
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'); |
| 57 |
INSERT INTO t1 (a,b) VALUES (1,'c'); |
| 58 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 59 |
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). |
| 60 |
# If you got a difference in error message, just add it to rdiff file |
| 61 |
ALTER TABLE t1 DROP INDEX a; |
| 62 |
INSERT INTO t1 (a,b) VALUES (1,'c'); |
| 63 |
ALTER TABLE t1 ADD UNIQUE INDEX a(a) ; |
| 64 |
ERROR 23000: Duplicate entry '1' for key 'a' |
| 65 |
# Statement ended with one of expected results (ER_DUP_ENTRY,ER_DUP_KEY). |
| 66 |
# If you got a difference in error message, just add it to rdiff file |
| 67 |
DROP TABLE t1; |