Debian Codegraph @

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

raw
1 ##################################################################################
2 # Bug#29992589 MYSQL UPGRADE TO 8.X FAILS IF TABLE NAME CONTAINS 'FTS' AND ' TFTS'
3 ##################################################################################
4
5 --source include/big_test.inc
6 --source include/have_debug.inc
7 --source include/not_valgrind.inc
8 --source include/have_case_sensitive_file_system.inc
9
10 --echo #
11 --echo # This test upgrades a 5.7 database with tables having "FTS"
12 --echo # in their names to 8.0
13 --echo #
14
15 --echo # Stop the running server
16 --source include/shutdown_mysqld.inc
17
18 --echo ##############################################################
19 --echo # Copy and unzip the datadir created with lctn=0
20 --echo ##############################################################
21
22 --copy_file $MYSQLTEST_VARDIR/std_data/data57_fts_nolctn.zip $MYSQL_TMP_DIR/data57_fts_nolctn.zip
23 --file_exists $MYSQL_TMP_DIR/data57_fts_nolctn.zip
24 --exec unzip -qo $MYSQL_TMP_DIR/data57_fts_nolctn.zip -d $MYSQL_TMP_DIR
25 let $DATADIR1 = $MYSQL_TMP_DIR/data57_fts_nolctn;
26
27 --echo # Restart the server with the unzipped datadir
28 --replace_result $DATADIR1 DATADIR
29 --let $wait_counter=3000
30 --let $restart_parameters = restart: --datadir=$DATADIR1 --innodb_page_size=16k
31 --source include/start_mysqld.inc
32
33 --echo # Check the contents of INFORMATION_SCHEMA
34 SHOW TABLES;
35 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLES
36 WHERE name LIKE '%test%'
37 ORDER BY name;
38
39 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
40 WHERE name LIKE '%test%'
41 ORDER BY name;
42
43 --echo # Cleanup
44 --echo # Shutdown server
45 --source include/shutdown_mysqld.inc
46
47 --echo # Remove copied files
48 --file_exists $MYSQL_TMP_DIR/data57_fts_nolctn.zip
49 --force-rmdir $MYSQL_TMP_DIR/data57_fts_nolctn
50 --remove_file $MYSQL_TMP_DIR/data57_fts_nolctn.zip
51
52 --echo ##############################################################
53 --echo # Copy and unzip the datadir created with lctn=1
54 --echo ##############################################################
55
56 --copy_file $MYSQLTEST_VARDIR/std_data/data57_fts_lctn.zip $MYSQL_TMP_DIR/data57_fts_lctn.zip
57 --file_exists $MYSQL_TMP_DIR/data57_fts_lctn.zip
58 --exec unzip -qo $MYSQL_TMP_DIR/data57_fts_lctn.zip -d $MYSQL_TMP_DIR
59 let $DATADIR2 = $MYSQL_TMP_DIR/data57_fts_lctn;
60
61 --echo # Restart the server with the unzipped datadir
62 --replace_result $DATADIR2 DATADIR
63 --let $wait_counter=3000
64 --let $restart_parameters = restart: --datadir=$DATADIR2 --innodb_page_size=16k
65 --source include/start_mysqld.inc
66
67 --echo # Check the contents of INFORMATION_SCHEMA
68 SHOW TABLES;
69 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLES
70 WHERE name LIKE '%test%'
71 ORDER BY name;
72
73 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
74 WHERE name LIKE '%test%'
75 ORDER BY name;
76
77 --echo # Cleanup
78 --echo # Shutdown server
79 --source include/shutdown_mysqld.inc
80
81 --echo # Remove copied files
82 --file_exists $MYSQL_TMP_DIR/data57_fts_lctn.zip
83 --force-rmdir $MYSQL_TMP_DIR/data57_fts_lctn
84 --remove_file $MYSQL_TMP_DIR/data57_fts_lctn.zip
85
86 --echo # Restart the server
87 let $restart_parameters =;
88 --source include/start_mysqld.inc
89
90 --echo #
91 --echo # Bug#30357954 UPGRADE TO 8.0 FAILS WHEN FULLTEXT INDEX HAS BEEN DROPPED
92 --echo #
93 --echo # This test upgrades a 5.7 database with table having "FTS_DOC_ID"
94 --echo # column & "FTS_DOC_ID_INDEX" index to 8.0. (And not having any
95 --echo # FULLTEXT index)
96 --echo #
97
98 --echo # Stop the running server
99 --source include/shutdown_mysqld.inc
100
101 --echo #
102 --echo # Copy and unzip the datadir
103 --echo #
104
105 --copy_file $MYSQLTEST_VARDIR/std_data/data57_drop_fts.zip $MYSQL_TMP_DIR/data57_drop_fts.zip
106 --file_exists $MYSQL_TMP_DIR/data57_drop_fts.zip
107 --exec unzip -qo $MYSQL_TMP_DIR/data57_drop_fts.zip -d $MYSQL_TMP_DIR
108 let $DATADIR1 = $MYSQL_TMP_DIR/data57_drop_fts;
109
110 --echo # Restart the server with the unzipped datadir
111 --replace_result $DATADIR1 DATADIR
112 --let $wait_counter=3000
113 --let $restart_parameters = restart: --datadir=$DATADIR1 --innodb_page_size=16k
114 --source include/start_mysqld.inc
115
116 --echo # Check the contents of INFORMATION_SCHEMA
117 SHOW TABLES;
118 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLES
119 WHERE name LIKE '%test%'
120 ORDER BY name;
121
122 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
123 WHERE name LIKE '%test%'
124 ORDER BY name;
125
126 --echo # Check DDL & DML opearations are working
127 SELECT * FROM t1;
128
129 SET DEBUG='+d,skip_dd_table_access_check';
130 SELECT b.name table_name, a.name column_name, a.ordinal_position, a.hidden
131 FROM mysql.columns a, mysql.tables b
132 WHERE a.table_id = b.id AND b.name = 't1'
133 ORDER BY a.ordinal_position;
134 ALTER TABLE t1 ADD FULLTEXT INDEX val_ft_idx(val);
135 SELECT b.name table_name, a.name column_name, a.ordinal_position, a.hidden
136 FROM mysql.columns a, mysql.tables b
137 WHERE a.table_id = b.id AND b.name = 't1'
138 ORDER BY a.ordinal_position;
139
140 INSERT INTO t1 (val) VALUES ('Upgraded successfully to 8.0 version');
141 SELECT * FROM t1;
142
143 SELECT b.name table_name, a.name column_name, a.ordinal_position, a.hidden
144 FROM mysql.columns a, mysql.tables b
145 WHERE a.table_id = b.id AND b.name = 't1'
146 ORDER BY a.ordinal_position;
147 ALTER TABLE t1 DROP INDEX val_ft_idx;
148 SELECT b.name table_name, a.name column_name, a.ordinal_position, a.hidden
149 FROM mysql.columns a, mysql.tables b
150 WHERE a.table_id = b.id AND b.name = 't1'
151 ORDER BY a.ordinal_position;
152 SET DEBUG='-d,skip_dd_table_access_check';
153
154 DELETE FROM t1 WHERE val LIKE 'Upgrade mysql database to 8.0 version';
155 SELECT * FROM t1;
156 DROP TABLE t1;
157
158 --echo # Cleanup
159 --echo # Shutdown server
160 --source include/shutdown_mysqld.inc
161
162 --echo # Remove copied files
163 --file_exists $MYSQL_TMP_DIR/data57_drop_fts.zip
164 --force-rmdir $MYSQL_TMP_DIR/data57_drop_fts
165 --remove_file $MYSQL_TMP_DIR/data57_drop_fts.zip
166
167 --echo # Restart the server
168 let $restart_parameters =;
169 --source include/start_mysqld.inc
170
171 --echo #
172 --echo # Bug #31749490 OLD FTS FILES AFTER UPGRADE: ASSERTION FAILURE:
173 --echo # PARS0PARS.CC:736:SYM_NODE->TABLE != NULLPTR
174 --echo #
175
176 --echo # Stop the running server
177 --source include/shutdown_mysqld.inc
178
179 --echo #
180 --echo # Copy and unzip the datadir
181 --echo #
182
183 --copy_file $MYSQLTEST_VARDIR/std_data/data57_drop_fts.zip $MYSQL_TMP_DIR/data57_drop_fts.zip
184 --file_exists $MYSQL_TMP_DIR/data57_drop_fts.zip
185 --exec unzip -qo $MYSQL_TMP_DIR/data57_drop_fts.zip -d $MYSQL_TMP_DIR
186 let $DATADIR1 = $MYSQL_TMP_DIR/data57_drop_fts;
187
188 --echo # Restart the server with the unzipped datadir
189 --replace_result $DATADIR1 DATADIR
190 --let $wait_counter=3000
191 --let $restart_parameters = restart: --datadir=$DATADIR1 --innodb_page_size=16k
192 --source include/start_mysqld.inc
193
194 --echo # Check the contents of INFORMATION_SCHEMA
195 SHOW TABLES;
196 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLES
197 WHERE name LIKE '%test%'
198 ORDER BY name;
199
200 SELECT lower(name) FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
201 WHERE name LIKE '%test%'
202 ORDER BY name;
203
204 INSERT INTO t1 (val) VALUES ('Upgraded successfully to 8.0 version');
205 SELECT * FROM t1;
206
207 DELETE FROM t1 WHERE val LIKE 'Upgrade mysql database to 8.0 version';
208 SELECT * FROM t1;
209 DROP TABLE t1;
210
211 --echo # Cleanup
212 --echo # Shutdown server
213 --source include/shutdown_mysqld.inc
214
215 --echo # Remove copied files
216 --file_exists $MYSQL_TMP_DIR/data57_drop_fts.zip
217 --force-rmdir $MYSQL_TMP_DIR/data57_drop_fts
218 --remove_file $MYSQL_TMP_DIR/data57_drop_fts.zip
219
220 --echo # Restart the server
221 let $restart_parameters =;
222 --source include/start_mysqld.inc