File: dd_upgrade_error.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (399 lines) | stat: -rw-r--r-- 17,380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
--echo # This test scripts covers upgrade of tables, views, tablespaces,
--echo # events, stored routines and triggers from 5.7 to 8.0.

--echo # Set different paths for --datadir
let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57;

--echo # Stop DB server which was created by MTR default
--source include/shutdown_mysqld.inc

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57.zip $MYSQL_TMP_DIR/data57.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57.zip

--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR

--echo # Create a bootstrap file in temp location
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
--exec echo $MYSQL_TMP_DIR/bootstrap.log

--echo # Copy mismatch .frms to test_mismatch dir
--copy_files_wildcard $MYSQL_TMP_DIR/data57/mismatch_frms/ $MYSQL_TMP_DIR/data57/test_mismatch/ *

--echo # Copy pre 5.0 decimal files to test dir
--copy_file $MYSQLTEST_VARDIR/std_data/41_decimal.frm $MYSQL_TMP_DIR/data57/test/41_decimal.frm

--echo # Starting the DB server will fail since the data dir contains
--echo # tables with non native partitioning.
let MYSQLD_LOG= $MYSQL_TMP_DIR/server.log;
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

let SEARCH_FILE= $MYSQLD_LOG;
--let SEARCH_PATTERN=  Unknown storage engine 'partition'
--source include/search_pattern.inc

--let SEARCH_PATTERN= Table upgrade required for `test`.`41_decimal`. Please dump/reload table to fix it!
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in creating TABLE_SHARE from p4_hash.frm file.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t1_col_name
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t2_col_type
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t3_col_num
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t4_index_name
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t5_index_cols
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t6_indexes_num
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t7_indexes_unique
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t8_col_type_nulls
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in fixing SE data for test_mismatch.t9_index_prefix_len
--source include/search_pattern.inc

--let SEARCH_PATTERN= Table mismatch_frms/t1_col_name is not found in InnoDB dictionary
--source include/search_pattern.inc

--echo # ------------------------------------------------------------------
--echo # Check upgrade of tablespaces with a missing tablespace file.
--echo # ------------------------------------------------------------------

--echo # Upgrade fails for the case where the general tablespace file is removed.
--remove_file $MYSQL_TMP_DIR/data57/test_tablespace_2.ibd
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--let SEARCH_PATTERN= Error in fixing SE data for tablespace.t3
--source include/search_pattern.inc

--echo # Upgrade fails for the case where the file per tablespace is removed.
--remove_file $MYSQL_TMP_DIR/data57/test/parent.ibd

--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--let SEARCH_PATTERN= Got error 197 from SE while migrating tablespaces
--source include/search_pattern.inc

--echo # Remove copied files
#--remove_file $MYSQLD_LOG
--remove_file $MYSQL_TMP_DIR/data57.zip
--force-rmdir $MYSQL_TMP_DIR/data57

--echo # ------------------------------------------------------------------
--echo # Check upgrade of tables and stored programs using long enum elements.
--echo # ------------------------------------------------------------------

--echo # Set different path for --datadir
let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57_enum;

--echo # DB server which was started above is not running, no need for shutdown

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57_enum.zip $MYSQL_TMP_DIR/data57_enum.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57_enum.zip

--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57_enum.zip -d $MYSQL_TMP_DIR

# Copy .frm file with generated column containing removed function.
--copy_file $MYSQLTEST_VARDIR/std_data/t_gcol_dep.frm $MYSQL_TMP_DIR/data57_enum/test/t_gcol_dep.frm

--echo #
--echo # BUG#26743291 : VIEW WITH EXPLICIT COLUMN NAME > 64 IS MARKED
--echo #                INVALID WHEN UPGRADED TO 8.0.

--write_file $MYSQL_TMP_DIR/data57_enum/test/v1.frm
TYPE=VIEW
query=select 1 AS `a123456789012345678901234567890123456789012345678901234567890123456789`
md5=fc83a6c1fde1c4183a3c24c91751f36f
updatable=0
algorithm=0
definer_user=root
definer_host=localhost
suid=2
with_check_option=0
timestamp=2017-10-20 06:39:41
create-version=1
source=select 1
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select 1 AS `a123456789012345678901234567890123456789012345678901234567890123456789`
EOF

--echo # Starting the DB server will fail since the data dir contains
--echo # a table and a stored program with a too long enum literals.
let MYSQLD_LOG= $MYSQL_TMP_DIR/server.log;
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--let SEARCH_PATTERN= Error in Creating DD entry for test.t_long_enum
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in creating stored program 'test.p_long_enum'
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in processing \(possibly deprecated\) expression or function 'des_encrypt\(`b`\)' for generated column test.t_gcol_dep.c
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in processing generated columns for table test.t_gcol_dep
--source include/search_pattern.inc

--let SEARCH_PATTERN= No database selected
--source include/search_pattern.inc

--let SEARCH_PATTERN= Incorrect column name 'a123456789012345678901234567890123456789012345678901234567890123456789'
--source include/search_pattern.inc

--echo # Remove copied files
--remove_file $MYSQLD_LOG
--remove_file $MYSQL_TMP_DIR/data57_enum.zip
--force-rmdir $MYSQL_TMP_DIR/data57_enum

--echo # ------------------------------------------------------------------
--echo # Check upgrade from 5.7 when events/triggers/views/routines contain GROUP BY DESC.
--echo # ------------------------------------------------------------------

--echo # Set different path for --datadir
let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57_upgrade_groupby_desc;

--echo # DB server which was started above is not running, no need for shutdown

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57_upgrade_groupby_desc.zip $MYSQL_TMP_DIR/data57_upgrade_groupby_desc.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57_upgrade_groupby_desc.zip

--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57_upgrade_groupby_desc.zip -d $MYSQL_TMP_DIR

--echo #
--echo # Upgrade tests for WL#8693
--echo #

--echo # Starting the DB server will fail since the data dir contains
--echo # events/triggers/views/routines contain GROUP BY DESC
let MYSQLD_LOG= $MYSQL_TMP_DIR/server.log;
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--let SEARCH_PATTERN= Trigger 'trigger_groupby_desc' has an error in its body
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in parsing Triggers from t1.TRG file
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in parsing Event 'test'.'event_groupby_desc' during upgrade
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in parsing Routine 'test'.'function_groupby_desc' during upgrade
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in parsing Routine 'test'.'procedure_groupby_desc' during upgrade
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in parsing View 'test'.'view_groupby_desc' during upgrade
--source include/search_pattern.inc

--let SEARCH_PATTERN= Failed to Populate DD tables.
--source include/search_pattern.inc

--echo # Remove copied files
--remove_file $MYSQLD_LOG
--remove_file $MYSQL_TMP_DIR/data57_upgrade_groupby_desc.zip
--force-rmdir $MYSQL_TMP_DIR/data57_upgrade_groupby_desc


--echo # ------------------------------------------------------------------
--echo # Bug#28760011: UPGRADE TO 8.0.12 FAILS
--echo # Check upgrade from 5.7 when triggers are listed in wrong order in the TRG file.
--echo # ------------------------------------------------------------------

--echo # Set different path for log file and datadir, and unzip the zip file.
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/save_dd_upgrade_57_trigger_order.log
--let $MYSQLD_DATADIR_57 = $MYSQL_TMP_DIR/data57_upgrade_trigger_order
--exec unzip -qo $MYSQLTEST_VARDIR/std_data/data57_upgrade_trigger_order.zip -d $MYSQL_TMP_DIR

--echo # DB server which was started above is not running, no need for shutdown, just start
--echo # the server. This will not fail after the bugfix since the trigger order is now corrected.
--exec echo "restart: --datadir=$MYSQLD_DATADIR_57 --log-error-verbosity=3 --log-error=$MYSQLD_LOG --upgrade=MINIMAL" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--let $wait_counter= 3000
--source include/wait_until_connected_again.inc

--echo # Stop the server.
--source include/shutdown_mysqld.inc

--echo # Remove the datadir, but keep the error log in case.
--force-rmdir $MYSQL_TMP_DIR/data57_upgrade_trigger_order


--echo
--echo # ------------------------------------------------------------------
--echo # Bug#31335554 8.0 CRASHES ON UPGRADING DATADIR WITH ORPHAN EVENTS
--echo # ------------------------------------------------------------------


--echo
--echo # Testcase 1: Upgrading with orphan event should fail with an error.

--echo
--echo # Copy the 5.7 data zip file to working directory.
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/data_57_orphan_event.zip $MYSQL_TMP_DIR/data_57_orphan_event.zip

--echo # Check that the zip file exists in the working directory.
--file_exists $MYSQL_TMP_DIR/data_57_orphan_event.zip

--echo # Unzip 5.7 data directory.
--exec unzip -qo $MYSQL_TMP_DIR/data_57_orphan_event.zip -d $MYSQL_TMP_DIR/data_57_orphan_event

--echo # Set data directory to the 5.7 data directory.
--let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_57_orphan_event/db

--echo # Set log directory.
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/data_57_orphan_event.log

--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG

--echo # Start server to trigger upgrade.
--echo # Upgrade will fail due to presence of orphan event.
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--echo
--echo # Should find this error in the log.
--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= The schema "the_cake_is_a_lie" referenced by event "e1" does not exist\. Please clean up any orphan events before upgrading\.
--source include/search_pattern.inc

--echo
--echo # Cleanup.
--remove_file $MYSQL_TMP_DIR/data_57_orphan_event.zip
--force-rmdir $MYSQL_TMP_DIR/data_57_orphan_event

--echo
--echo # Testcase 2: Upgrading with orphan routine should fail with an error.

--echo
--echo # Copy the 5.7 data zip file to working directory.
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/data_57_orphan_routine.zip $MYSQL_TMP_DIR/data_57_orphan_routine.zip

--echo # Check that the zip file exists in the working directory.
--file_exists $MYSQL_TMP_DIR/data_57_orphan_routine.zip

--echo # Unzip 5.7 data directory.
--exec unzip -qo $MYSQL_TMP_DIR/data_57_orphan_routine.zip -d $MYSQL_TMP_DIR/data_57_orphan_routine

--echo # Set data directory to the 5.7 data directory.
--let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_57_orphan_routine/db

--echo # Set log directory.
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/data_57_orphan_routine.log

--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG

--echo # Start server to trigger upgrade.
--echo # Upgrade will fail due to presence of orphan routine.
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--echo
--echo # Should find this error in the log.
--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= The schema "xyz" referenced by routine "p1" does not exist\. Please clean up any orphan routines before upgrading\.
--source include/search_pattern.inc

--echo
--echo # Cleanup.
--remove_file $MYSQL_TMP_DIR/data_57_orphan_routine.zip
--force-rmdir $MYSQL_TMP_DIR/data_57_orphan_routine

--echo
--echo # -----------------------------------------------------------------------
--echo # Bug#33148961 FAILURE TO UPGRADE FROM 5.7, INVALID UTF8 CHARACTER STRING
--echo # -----------------------------------------------------------------------

--echo
--echo # Upgrade 5.7 data directory containing a table, index, column, and
--echo # stored routine, each having an invalid character string in their
--echo # comments. Also contains a stored routine with invalid character string
--echo # in the body definition.
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/data_57_invalid_comment_string.zip $MYSQL_TMP_DIR/data_57_invalid_comment_string.zip
--file_exists $MYSQL_TMP_DIR/data_57_invalid_comment_string.zip
--exec unzip -qo $MYSQL_TMP_DIR/data_57_invalid_comment_string.zip -d $MYSQL_TMP_DIR/data_57_invalid_comment_string
--let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_57_invalid_comment_string/db
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/data_57_invalid_comment_string.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--echo
--echo # Upgrade should fail with these errors in the log.
--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= Comment for index 'test\.t3\.idx1' contains an invalid utf8mb3 character string: '\\\xBF\\\xE1'\.
--source include/search_pattern.inc
--let SEARCH_PATTERN= Comment for field 'test\.t2\.a' contains an invalid utf8mb3 character string: '\\\xBF\\\xE1'\.
--source include/search_pattern.inc
--let SEARCH_PATTERN= Comment for table 'test\.t1' contains an invalid utf8mb3 character string: '\\\xBF\\\xE1'\.
--source include/search_pattern.inc
--let SEARCH_PATTERN= Definition of stored routine 'test\.p1' contains an invalid utf8mb3 character string: '\\\xF0\\\x9F\\\x90'\.
--source include/search_pattern.inc

--echo
--echo # Cleanup.
--remove_file $MYSQL_TMP_DIR/data_57_invalid_comment_string.zip
--force-rmdir $MYSQL_TMP_DIR/data_57_invalid_comment_string

--echo
--echo # Upgrade 5.7 data directory containing a view with invalid body
--echo # definition string.
# Note : This is not included in above data directory since the upgrade would 
# fail prior to reaching the check for view body definition.
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/data_57_invalid_view_def_string.zip $MYSQL_TMP_DIR/data_57_invalid_view_def_string.zip
--file_exists $MYSQL_TMP_DIR/data_57_invalid_view_def_string.zip
--exec unzip -qo $MYSQL_TMP_DIR/data_57_invalid_view_def_string.zip -d $MYSQL_TMP_DIR/data_57_invalid_view_def_string
--let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_57_invalid_view_def_string/db
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/data_57_invalid_view_def_string.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--error 1
--exec $MYSQLD --no-defaults $extra_args --innodb_dedicated_server=OFF --secure-file-priv="" --log-error=$MYSQLD_LOG --datadir=$MYSQLD_DATADIR1

--echo
--echo # Upgrade should fail with these errors in the log.
--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= Definition of view 'test\.v1' contains an invalid utf8mb3 character string: '\\\xF0\\\x9F\\\x90'\.
--source include/search_pattern.inc

--echo
--echo # Cleanup.
--remove_file $MYSQL_TMP_DIR/data_57_invalid_view_def_string.zip
--force-rmdir $MYSQL_TMP_DIR/data_57_invalid_view_def_string


--echo
--echo # ------------------------------------------------------------------
--echo # End-of-test cleanup.
--echo # ------------------------------------------------------------------
--echo # Restart the server with default options.
--source include/start_mysqld.inc