Debian Codegraph @

mysql-test/suite/innodb/t/import_hidden_fts_debug.test

raw
1 --source include/have_innodb.inc
2 --source include/have_debug.inc
3 CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
4 f2 CHAR(2) NOT NULL, FULLTEXT f_idx(f2),
5 f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
6 INSERT INTO t1(f1, f2) VALUES(1, "on");
7 ALTER TABLE t1 DROP INDEX f_idx;
8 FLUSH TABLE t1 FOR EXPORT;
9 let MYSQLD_DATADIR =`SELECT @@datadir`;
10 perl;
11 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
12 ib_backup_tablespaces("test", "t1");
13 EOF
14 UNLOCK TABLES;
15 DROP TABLE t1;
16
17 CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
18 f2 CHAR(2) NOT NULL,
19 f3 CHAR(2) NOT NULL,
20 f4 INT AS (f1) VIRTUAL, INDEX(f4))ENGINE=InnoDB;
21 ALTER TABLE t1 DISCARD TABLESPACE;
22 perl;
23 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
24 ib_discard_tablespaces("test", "t1");
25 ib_restore_tablespaces("test", "t1");
26 EOF
27 --error ER_TABLE_SCHEMA_MISMATCH
28 ALTER TABLE t1 IMPORT TABLESPACE;
29 DROP TABLE t1;
30
31 CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
32 f2 CHAR(2) NOT NULL,
33 f3 INT as (f1) VIRTUAL, INDEX(f3))ENGINE=InnoDB;
34 ALTER TABLE t1 DISCARD TABLESPACE;
35 perl;
36 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
37 ib_discard_tablespaces("test", "t1");
38 ib_restore_tablespaces("test", "t1");
39 EOF
40
41 --disable_warnings
42 SET @save_debug=@@debug_dbug;
43 SET DEBUG_DBUG="+d,ib_import_set_index_root_failure";
44 --error ER_TOO_MANY_CONCURRENT_TRXS
45 ALTER TABLE t1 IMPORT TABLESPACE;
46 set DEBUG_DBUG=@save_dbug;
47
48 SET @save_debug=@@debug_dbug;
49 SET DEBUG_DBUG="+d,ib_import_vcol_update_fail";
50 --error ER_DUP_KEY
51 ALTER TABLE t1 IMPORT TABLESPACE;
52 set DEBUG_DBUG=@save_dbug;
53
54 perl;
55 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
56 ib_discard_tablespaces("test", "t1");
57 ib_restore_tablespaces("test", "t1");
58 EOF
59
60 SET @save_dbug=@@debug_dbug;
61 SET DEBUG_DBUG="+d,ib_import_fts_error";
62 --error ER_DUP_KEY
63 ALTER TABLE t1 IMPORT TABLESPACE;
64 SET DEBUG_DBUG=@save_dbug;
65 --enable_warnings
66
67 perl;
68 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
69 ib_unlink_tablespace("test", "t1");
70 EOF
71
72 SELECT NAME FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
73 WHERE table_id IN (SELECT table_id FROM information_schema.innodb_sys_tables where name="test/t1");
74
75 SHOW CREATE TABLE t1;
76 DROP TABLE t1;
77
78 # Manually add the FTS_DOC_ID Column with mismatched data type
79 CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
80 FTS_DOC_ID BIGINT SIGNED NOT NULL,
81 f2 CHAR(2) NOT NULL,
82 FULLTEXT f_idx(f2))ENGINE=InnoDB;
83 INSERT INTO t1 VALUES(1, 1, "on");
84 ALTER TABLE t1 DROP INDEX f_idx;
85 FLUSH TABLE t1 FOR EXPORT;
86 let MYSQLD_DATADIR =`SELECT @@datadir`;
87 perl;
88 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
89 ib_backup_tablespaces("test", "t1");
90 EOF
91 UNLOCK TABLES;
92 DROP TABLE t1;
93
94 CREATE TABLE t1(f1 INT NOT NULL PRIMARY KEY,
95 f2 CHAR(2) NOT NULL)ENGINE=InnoDB;
96 ALTER TABLE t1 DISCARD TABLESPACE;
97 perl;
98 do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
99 ib_discard_tablespaces("test", "t1");
100 ib_restore_tablespaces("test", "t1");
101 EOF
102 --error ER_TABLE_SCHEMA_MISMATCH
103 ALTER TABLE t1 IMPORT TABLESPACE;
104 DROP TABLE t1;