Current Path : /home/usr.opt/mysql57/mysql-test/suite/innodb/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/innodb/r/import.result |
# # Bug#20977779 CANNOT IMPORT TABLES CONTAINING PREFIX INDEXES # CREATE TABLE t1 (c1 VARCHAR(32), c2 VARCHAR(32), c3 VARCHAR(32), PRIMARY KEY (c1, c2, c3)) ENGINE=InnoDB; ALTER TABLE t1 ADD INDEX ind1(c1(5), c2, c3); ALTER TABLE t1 ADD INDEX ind2(c3, c1(10), c2); ALTER TABLE t1 ADD INDEX ind3(c2, c3, c1(20)); INSERT INTO t1 VALUES ('Test Data -1', 'Test Data -2', 'Test Data -3'); # Test with 2ndary index having prefix FLUSH TABLES test.t1 FOR EXPORT; UNLOCK TABLES; ALTER TABLE test.t1 DISCARD TABLESPACE; ALTER TABLE test.t1 IMPORT TABLESPACE; CHECK TABLE test.t1; Table Op Msg_type Msg_text test.t1 check status OK SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(32) NOT NULL, `c2` varchar(32) NOT NULL, `c3` varchar(32) NOT NULL, PRIMARY KEY (`c1`,`c2`,`c3`), KEY `ind1` (`c1`(5),`c2`,`c3`), KEY `ind2` (`c3`,`c1`(10),`c2`), KEY `ind3` (`c2`,`c3`,`c1`(20)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM test.t1; c1 c2 c3 Test Data -1 Test Data -2 Test Data -3 # Test with PK & 2ndary index with prefix ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(c1(5), c2(10), c3(20)); FLUSH TABLES test.t1 FOR EXPORT; UNLOCK TABLES; ALTER TABLE test.t1 DISCARD TABLESPACE; ALTER TABLE test.t1 IMPORT TABLESPACE; CHECK TABLE test.t1; Table Op Msg_type Msg_text test.t1 check status OK SHOW CREATE TABLE test.t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` varchar(32) NOT NULL, `c2` varchar(32) NOT NULL, `c3` varchar(32) NOT NULL, PRIMARY KEY (`c1`(5),`c2`(10),`c3`(20)), KEY `ind1` (`c1`(5),`c2`,`c3`), KEY `ind2` (`c3`,`c1`(10),`c2`), KEY `ind3` (`c2`,`c3`,`c1`(20)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 SELECT * FROM test.t1; c1 c2 c3 Test Data -1 Test Data -2 Test Data -3 DROP TABLE t1;