1 # Embedded server doesn't support external clients
2 --source include/not_embedded.inc
5 --source include/have_log_bin.inc
7 # Save the initial number of concurrent sessions
8 --source include/count_sessions.inc
11 --echo # Bug#37938 Test "mysqldump" lacks various insert statements
12 --echo # Turn off concurrent inserts to avoid random errors
13 --echo # NOTE: We reset the variable back to saved value at the end of test
14 SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
15 SET @@GLOBAL.CONCURRENT_INSERT = 0;
19 DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
20 drop database if exists mysqldump_test_db;
21 drop database if exists db1;
22 drop database if exists db2;
23 drop view if exists v1, v2, v3;
28 CREATE TABLE t1(a INT, KEY (a)) KEY_BLOCK_SIZE=1024;
29 INSERT INTO t1 VALUES (1), (2);
30 --exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
34 --echo # Bug#2005 Long decimal comparison bug.
37 CREATE TABLE t1 (a decimal(64, 20));
38 INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
39 ("0987654321098765432109876543210987654321");
40 --exec $MYSQL_DUMP --compact test t1
44 --echo # Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
47 CREATE TABLE t1 (a double);
48 INSERT INTO t1 VALUES ('-9e999999');
49 # The following replaces is here because some systems replaces the above
50 # double with '-inf' and others with MAX_DOUBLE
51 --replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
52 --exec $MYSQL_DUMP --compact test t1
56 --echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently
59 CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
61 # check at first how mysql work with quoted decimal
63 INSERT INTO t1 VALUES (1.2345, 2.3456);
64 INSERT INTO t1 VALUES ('1.2345', 2.3456);
65 INSERT INTO t1 VALUES ("1.2345", 2.3456);
67 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES';
68 INSERT INTO t1 VALUES (1.2345, 2.3456);
69 INSERT INTO t1 VALUES ('1.2345', 2.3456);
70 --error ER_BAD_FIELD_ERROR
71 INSERT INTO t1 VALUES ("1.2345", 2.3456);
72 SET SQL_MODE=@OLD_SQL_MODE;
74 # check how mysqldump make quoting
75 --exec $MYSQL_DUMP --compact test t1
76 --exec $MYSQL_DUMP --compact --skip-create test t1
77 --exec $MYSQL_DUMP --skip-create --skip-comments test t1
78 --exec $MYSQL_DUMP --skip-opt --extended-insert --skip-comments test t1
81 CREATE TABLE t1(a int, b text, c varchar(3));
82 INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
83 --exec $MYSQL_DUMP --skip-create --compact -X test t1
87 --echo # Bug#1707 mysqldump -X does't quote field and table names
90 CREATE TABLE t1 (`a"b"` char(2));
91 INSERT INTO t1 VALUES ("1\""), ("\"2");
92 --exec $MYSQL_DUMP --compact --skip-create -X test t1
96 --echo # Bug#1994 mysqldump does not correctly dump UCS2 data
97 --echo # Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
100 CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
101 INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
102 --exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1
106 --echo # Bug#2634 mysqldump in --compatible=mysql4
109 CREATE TABLE t1 (a int) ENGINE=MYISAM;
110 INSERT INTO t1 VALUES (1), (2);
111 --exec $MYSQL_DUMP --skip-comments --compatible=mysql40 test t1
112 --exec $MYSQL_DUMP --skip-comments --compatible=mysql323 test t1
116 --echo # Bug#2592 mysqldump doesn't quote "tricky" names correctly
119 create table ```a` (i int);
120 --exec $MYSQL_DUMP --compact test
124 --echo # Bug#2591 mysqldump quotes names inconsistently
127 create table t1(a int);
128 --exec $MYSQL_DUMP --comments=0 test
129 --exec $MYSQL_DUMP --comments=0 --compatible=ansi test
130 set global sql_mode='ANSI_QUOTES';
131 --exec $MYSQL_DUMP --comments=0 test
132 --exec $MYSQL_DUMP --comments=0 --compatible=ansi test
133 set global sql_mode='';
137 --echo # Bug#2705 mysqldump --tab extra output
140 create table t1(a int);
141 insert into t1 values (1),(2),(3);
142 --exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
143 --cat_file $MYSQLTEST_VARDIR/tmp/t1.sql
144 --cat_file $MYSQLTEST_VARDIR/tmp/t1.txt
145 --remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
146 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
147 --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
148 --remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
149 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
153 --echo # Bug#6101 create database problem
156 --exec $MYSQL_DUMP --skip-comments --databases test
158 create database mysqldump_test_db character set latin2 collate latin2_bin;
159 --exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db
160 drop database mysqldump_test_db;
163 --echo # Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char...
164 --echo # Check that we don't dump in UTF8 in compatible mode by default,
165 --echo # but use the default compiled values, or the values given in
166 --echo # --default-character-set=xxx. However, we should dump in UTF8
167 --echo # if it is explicitely set.
169 CREATE TABLE t1 (a CHAR(10));
170 INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
171 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
174 --echo # Bug#8063 make test mysqldump [ fail ]
175 --echo # We cannot test this command because its output depends
176 --echo # on --default-character-set incompiled into "mysqldump" program.
177 --echo # If the future we can move this command into a separate test with
178 --echo # checking that "mysqldump" is compiled with "latin1"
181 #--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1
182 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
183 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
184 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
188 --echo # WL#2319 Exclude Tables from dump
191 CREATE TABLE t1 (a int);
192 CREATE TABLE t2 (a int);
193 INSERT INTO t1 VALUES (1),(2),(3);
194 INSERT INTO t2 VALUES (4),(5),(6);
195 --exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test
200 --echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
203 CREATE TABLE t1 (`b` blob);
204 INSERT INTO `t1` VALUES (0x602010000280100005E71A);
205 --exec $MYSQL_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
209 --echo # Test for --insert-ignore
212 CREATE TABLE t1 (a INT);
213 INSERT INTO t1 VALUES (1),(2),(3);
214 INSERT INTO t1 VALUES (4),(5),(6);
215 --exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
216 --exec $MYSQL_DUMP --skip-comments --insert-ignore --delayed-insert test t1
220 --echo # Bug#10286 mysqldump -c crashes on table that has many fields with long
224 F_c4ca4238a0b923820dcc509a6f75849b int,
225 F_c81e728d9d4c2f636f067f89cc14862c int,
226 F_eccbc87e4b5ce2fe28308fd9f2a7baf3 int,
227 F_a87ff679a2f3e71d9181a67b7542122c int,
228 F_e4da3b7fbbce2345d7772b0674a318d5 int,
229 F_1679091c5a880faf6fb5e6087eb1b2dc int,
230 F_8f14e45fceea167a5a36dedd4bea2543 int,
231 F_c9f0f895fb98ab9159f51fd0297e236d int,
232 F_45c48cce2e2d7fbdea1afc51c7c6ad26 int,
233 F_d3d9446802a44259755d38e6d163e820 int,
234 F_6512bd43d9caa6e02c990b0a82652dca int,
235 F_c20ad4d76fe97759aa27a0c99bff6710 int,
236 F_c51ce410c124a10e0db5e4b97fc2af39 int,
237 F_aab3238922bcc25a6f606eb525ffdc56 int,
238 F_9bf31c7ff062936a96d3c8bd1f8f2ff3 int,
239 F_c74d97b01eae257e44aa9d5bade97baf int,
240 F_70efdf2ec9b086079795c442636b55fb int,
241 F_6f4922f45568161a8cdf4ad2299f6d23 int,
242 F_1f0e3dad99908345f7439f8ffabdffc4 int,
243 F_98f13708210194c475687be6106a3b84 int,
244 F_3c59dc048e8850243be8079a5c74d079 int,
245 F_b6d767d2f8ed5d21a44b0e5886680cb9 int,
246 F_37693cfc748049e45d87b8c7d8b9aacd int,
247 F_1ff1de774005f8da13f42943881c655f int,
248 F_8e296a067a37563370ded05f5a3bf3ec int,
249 F_4e732ced3463d06de0ca9a15b6153677 int,
250 F_02e74f10e0327ad868d138f2b4fdd6f0 int,
251 F_33e75ff09dd601bbe69f351039152189 int,
252 F_6ea9ab1baa0efb9e19094440c317e21b int,
253 F_34173cb38f07f89ddbebc2ac9128303f int,
254 F_c16a5320fa475530d9583c34fd356ef5 int,
255 F_6364d3f0f495b6ab9dcf8d3b5c6e0b01 int,
256 F_182be0c5cdcd5072bb1864cdee4d3d6e int,
257 F_e369853df766fa44e1ed0ff613f563bd int,
258 F_1c383cd30b7c298ab50293adfecb7b18 int,
259 F_19ca14e7ea6328a42e0eb13d585e4c22 int,
260 F_a5bfc9e07964f8dddeb95fc584cd965d int,
261 F_a5771bce93e200c36f7cd9dfd0e5deaa int,
262 F_d67d8ab4f4c10bf22aa353e27879133c int,
263 F_d645920e395fedad7bbbed0eca3fe2e0 int,
264 F_3416a75f4cea9109507cacd8e2f2aefc int,
265 F_a1d0c6e83f027327d8461063f4ac58a6 int,
266 F_17e62166fc8586dfa4d1bc0e1742c08b int,
267 F_f7177163c833dff4b38fc8d2872f1ec6 int,
268 F_6c8349cc7260ae62e3b1396831a8398f int,
269 F_d9d4f495e875a2e075a1a4a6e1b9770f int,
270 F_67c6a1e7ce56d3d6fa748ab6d9af3fd7 int,
271 F_642e92efb79421734881b53e1e1b18b6 int,
272 F_f457c545a9ded88f18ecee47145a72c0 int,
273 F_c0c7c76d30bd3dcaefc96f40275bdc0a int,
274 F_2838023a778dfaecdc212708f721b788 int,
275 F_9a1158154dfa42caddbd0694a4e9bdc8 int,
276 F_d82c8d1619ad8176d665453cfb2e55f0 int,
277 F_a684eceee76fc522773286a895bc8436 int,
278 F_b53b3a3d6ab90ce0268229151c9bde11 int,
279 F_9f61408e3afb633e50cdf1b20de6f466 int,
280 F_72b32a1f754ba1c09b3695e0cb6cde7f int,
281 F_66f041e16a60928b05a7e228a89c3799 int,
282 F_093f65e080a295f8076b1c5722a46aa2 int,
283 F_072b030ba126b2f4b2374f342be9ed44 int,
284 F_7f39f8317fbdb1988ef4c628eba02591 int,
285 F_44f683a84163b3523afe57c2e008bc8c int,
286 F_03afdbd66e7929b125f8597834fa83a4 int,
287 F_ea5d2f1c4608232e07d3aa3d998e5135 int,
288 F_fc490ca45c00b1249bbe3554a4fdf6fb int,
289 F_3295c76acbf4caaed33c36b1b5fc2cb1 int,
290 F_735b90b4568125ed6c3f678819b6e058 int,
291 F_a3f390d88e4c41f2747bfa2f1b5f87db int,
292 F_14bfa6bb14875e45bba028a21ed38046 int,
293 F_7cbbc409ec990f19c78c75bd1e06f215 int,
294 F_e2c420d928d4bf8ce0ff2ec19b371514 int,
295 F_32bb90e8976aab5298d5da10fe66f21d int,
296 F_d2ddea18f00665ce8623e36bd4e3c7c5 int,
297 F_ad61ab143223efbc24c7d2583be69251 int,
298 F_d09bf41544a3365a46c9077ebb5e35c3 int,
299 F_fbd7939d674997cdb4692d34de8633c4 int,
300 F_28dd2c7955ce926456240b2ff0100bde int,
301 F_35f4a8d465e6e1edc05f3d8ab658c551 int,
302 F_d1fe173d08e959397adf34b1d77e88d7 int,
303 F_f033ab37c30201f73f142449d037028d int,
304 F_43ec517d68b6edd3015b3edc9a11367b int,
305 F_9778d5d219c5080b9a6a17bef029331c int,
306 F_fe9fc289c3ff0af142b6d3bead98a923 int,
307 F_68d30a9594728bc39aa24be94b319d21 int,
308 F_3ef815416f775098fe977004015c6193 int,
309 F_93db85ed909c13838ff95ccfa94cebd9 int,
310 F_c7e1249ffc03eb9ded908c236bd1996d int,
311 F_2a38a4a9316c49e5a833517c45d31070 int,
312 F_7647966b7343c29048673252e490f736 int,
313 F_8613985ec49eb8f757ae6439e879bb2a int,
314 F_54229abfcfa5649e7003b83dd4755294 int,
315 F_92cc227532d17e56e07902b254dfad10 int,
316 F_98dce83da57b0395e163467c9dae521b int,
317 F_f4b9ec30ad9f68f89b29639786cb62ef int,
318 F_812b4ba287f5ee0bc9d43bbf5bbe87fb int,
319 F_26657d5ff9020d2abefe558796b99584 int,
320 F_e2ef524fbf3d9fe611d5a8e90fefdc9c int,
321 F_ed3d2c21991e3bef5e069713af9fa6ca int,
322 F_ac627ab1ccbdb62ec96e702f07f6425b int,
323 F_f899139df5e1059396431415e770c6dd int,
324 F_38b3eff8baf56627478ec76a704e9b52 int,
325 F_ec8956637a99787bd197eacd77acce5e int,
326 F_6974ce5ac660610b44d9b9fed0ff9548 int,
327 F_c9e1074f5b3f9fc8ea15d152add07294 int,
328 F_65b9eea6e1cc6bb9f0cd2a47751a186f int,
329 F_f0935e4cd5920aa6c7c996a5ee53a70f int,
330 F_a97da629b098b75c294dffdc3e463904 int,
331 F_a3c65c2974270fd093ee8a9bf8ae7d0b int,
332 F_2723d092b63885e0d7c260cc007e8b9d int,
333 F_5f93f983524def3dca464469d2cf9f3e int,
334 F_698d51a19d8a121ce581499d7b701668 int,
335 F_7f6ffaa6bb0b408017b62254211691b5 int,
336 F_73278a4a86960eeb576a8fd4c9ec6997 int,
337 F_5fd0b37cd7dbbb00f97ba6ce92bf5add int,
338 F_2b44928ae11fb9384c4cf38708677c48 int,
339 F_c45147dee729311ef5b5c3003946c48f int,
340 F_eb160de1de89d9058fcb0b968dbbbd68 int,
341 F_5ef059938ba799aaa845e1c2e8a762bd int,
342 F_07e1cd7dca89a1678042477183b7ac3f int,
343 F_da4fb5c6e93e74d3df8527599fa62642 int,
344 F_4c56ff4ce4aaf9573aa5dff913df997a int,
345 F_a0a080f42e6f13b3a2df133f073095dd int,
346 F_202cb962ac59075b964b07152d234b70 int,
347 F_c8ffe9a587b126f152ed3d89a146b445 int,
348 F_3def184ad8f4755ff269862ea77393dd int,
349 F_069059b7ef840f0c74a814ec9237b6ec int,
350 F_ec5decca5ed3d6b8079e2e7e7bacc9f2 int,
351 F_76dc611d6ebaafc66cc0879c71b5db5c int,
352 F_d1f491a404d6854880943e5c3cd9ca25 int,
353 F_9b8619251a19057cff70779273e95aa6 int,
354 F_1afa34a7f984eeabdbb0a7d494132ee5 int,
355 F_65ded5353c5ee48d0b7d48c591b8f430 int,
356 F_9fc3d7152ba9336a670e36d0ed79bc43 int,
357 F_02522a2b2726fb0a03bb19f2d8d9524d int,
358 F_7f1de29e6da19d22b51c68001e7e0e54 int,
359 F_42a0e188f5033bc65bf8d78622277c4e int,
360 F_3988c7f88ebcb58c6ce932b957b6f332 int,
361 F_013d407166ec4fa56eb1e1f8cbe183b9 int,
362 F_e00da03b685a0dd18fb6a08af0923de0 int,
363 F_1385974ed5904a438616ff7bdb3f7439 int,
364 F_0f28b5d49b3020afeecd95b4009adf4c int,
365 F_a8baa56554f96369ab93e4f3bb068c22 int,
366 F_903ce9225fca3e988c2af215d4e544d3 int,
367 F_0a09c8844ba8f0936c20bd791130d6b6 int,
368 F_2b24d495052a8ce66358eb576b8912c8 int,
369 F_a5e00132373a7031000fd987a3c9f87b int,
370 F_8d5e957f297893487bd98fa830fa6413 int,
371 F_47d1e990583c9c67424d369f3414728e int,
372 F_f2217062e9a397a1dca429e7d70bc6ca int,
373 F_7ef605fc8dba5425d6965fbd4c8fbe1f int,
374 F_a8f15eda80c50adb0e71943adc8015cf int,
375 F_37a749d808e46495a8da1e5352d03cae int,
376 F_b3e3e393c77e35a4a3f3cbd1e429b5dc int,
377 F_1d7f7abc18fcb43975065399b0d1e48e int,
378 F_2a79ea27c279e471f4d180b08d62b00a int,
379 F_1c9ac0159c94d8d0cbedc973445af2da int,
380 F_6c4b761a28b734fe93831e3fb400ce87 int,
381 F_06409663226af2f3114485aa4e0a23b4 int,
382 F_140f6969d5213fd0ece03148e62e461e int,
383 F_b73ce398c39f506af761d2277d853a92 int,
384 F_bd4c9ab730f5513206b999ec0d90d1fb int,
385 F_82aa4b0af34c2313a562076992e50aa3 int,
386 F_0777d5c17d4066b82ab86dff8a46af6f int,
387 F_fa7cdfad1a5aaf8370ebeda47a1ff1c3 int,
388 F_9766527f2b5d3e95d4a733fcfb77bd7e int,
389 F_7e7757b1e12abcb736ab9a754ffb617a int,
390 F_5878a7ab84fb43402106c575658472fa int,
391 F_006f52e9102a8d3be2fe5614f42ba989 int,
392 F_3636638817772e42b59d74cff571fbb3 int,
393 F_149e9677a5989fd342ae44213df68868 int,
394 F_a4a042cf4fd6bfb47701cbc8a1653ada int,
395 F_1ff8a7b5dc7a7d1f0ed65aaa29c04b1e int,
396 F_f7e6c85504ce6e82442c770f7c8606f0 int,
397 F_bf8229696f7a3bb4700cfddef19fa23f int,
398 F_82161242827b703e6acf9c726942a1e4 int,
399 F_38af86134b65d0f10fe33d30dd76442e int,
400 F_96da2f590cd7246bbde0051047b0d6f7 int,
401 F_8f85517967795eeef66c225f7883bdcb int,
402 F_8f53295a73878494e9bc8dd6c3c7104f int,
403 F_045117b0e0a11a242b9765e79cbf113f int,
404 F_fc221309746013ac554571fbd180e1c8 int,
405 F_4c5bde74a8f110656874902f07378009 int,
406 F_cedebb6e872f539bef8c3f919874e9d7 int,
407 F_6cdd60ea0045eb7a6ec44c54d29ed402 int,
408 F_eecca5b6365d9607ee5a9d336962c534 int,
409 F_9872ed9fc22fc182d371c3e9ed316094 int,
410 F_31fefc0e570cb3860f2a6d4b38c6490d int,
411 F_9dcb88e0137649590b755372b040afad int,
412 F_a2557a7b2e94197ff767970b67041697 int,
413 F_cfecdb276f634854f3ef915e2e980c31 int,
414 F_0aa1883c6411f7873cb83dacb17b0afc int,
415 F_58a2fc6ed39fd083f55d4182bf88826d int,
416 F_bd686fd640be98efaae0091fa301e613 int,
417 F_a597e50502f5ff68e3e25b9114205d4a int,
418 F_0336dcbab05b9d5ad24f4333c7658a0e int,
419 F_084b6fbb10729ed4da8c3d3f5a3ae7c9 int,
420 F_85d8ce590ad8981ca2c8286f79f59954 int,
421 F_0e65972dce68dad4d52d063967f0a705 int,
422 F_84d9ee44e457ddef7f2c4f25dc8fa865 int,
423 F_3644a684f98ea8fe223c713b77189a77 int,
424 F_757b505cfd34c64c85ca5b5690ee5293 int,
425 F_854d6fae5ee42911677c739ee1734486 int,
426 F_e2c0be24560d78c5e599c2a9c9d0bbd2 int,
427 F_274ad4786c3abca69fa097b85867d9a4 int,
428 F_eae27d77ca20db309e056e3d2dcd7d69 int,
429 F_7eabe3a1649ffa2b3ff8c02ebfd5659f int,
430 F_69adc1e107f7f7d035d7baf04342e1ca int,
431 F_091d584fced301b442654dd8c23b3fc9 int,
432 F_b1d10e7bafa4421218a51b1e1f1b0ba2 int,
433 F_6f3ef77ac0e3619e98159e9b6febf557 int,
434 F_eb163727917cbba1eea208541a643e74 int,
435 F_1534b76d325a8f591b52d302e7181331 int,
436 F_979d472a84804b9f647bc185a877a8b5 int,
437 F_ca46c1b9512a7a8315fa3c5a946e8265 int,
438 F_3b8a614226a953a8cd9526fca6fe9ba5 int,
439 F_45fbc6d3e05ebd93369ce542e8f2322d int,
440 F_63dc7ed1010d3c3b8269faf0ba7491d4 int,
441 F_e96ed478dab8595a7dbda4cbcbee168f int,
442 F_c0e190d8267e36708f955d7ab048990d int,
443 F_ec8ce6abb3e952a85b8551ba726a1227 int,
444 F_060ad92489947d410d897474079c1477 int,
445 F_bcbe3365e6ac95ea2c0343a2395834dd int,
446 F_115f89503138416a242f40fb7d7f338e int,
447 F_13fe9d84310e77f13a6d184dbf1232f3 int,
448 F_d1c38a09acc34845c6be3a127a5aacaf int,
449 F_9cfdf10e8fc047a44b08ed031e1f0ed1 int,
450 F_705f2172834666788607efbfca35afb3 int,
451 F_74db120f0a8e5646ef5a30154e9f6deb int,
452 F_57aeee35c98205091e18d1140e9f38cf int,
453 F_6da9003b743b65f4c0ccd295cc484e57 int,
454 F_9b04d152845ec0a378394003c96da594 int,
455 F_be83ab3ecd0db773eb2dc1b0a17836a1 int,
456 F_e165421110ba03099a1c0393373c5b43 int,
457 F_289dff07669d7a23de0ef88d2f7129e7 int,
458 F_577ef1154f3240ad5b9b413aa7346a1e int,
459 F_01161aaa0b6d1345dd8fe4e481144d84 int,
460 F_539fd53b59e3bb12d203f45a912eeaf2 int,
461 F_ac1dd209cbcc5e5d1c6e28598e8cbbe8 int,
462 F_555d6702c950ecb729a966504af0a635 int,
463 F_335f5352088d7d9bf74191e006d8e24c int,
464 F_f340f1b1f65b6df5b5e3f94d95b11daf int,
465 F_e4a6222cdb5b34375400904f03d8e6a5 int,
466 F_cb70ab375662576bd1ac5aaf16b3fca4 int,
467 F_9188905e74c28e489b44e954ec0b9bca int,
468 F_0266e33d3f546cb5436a10798e657d97 int,
469 F_38db3aed920cf82ab059bfccbd02be6a int,
470 F_3cec07e9ba5f5bb252d13f5f431e4bbb int,
471 F_621bf66ddb7c962aa0d22ac97d69b793 int,
472 F_077e29b11be80ab57e1a2ecabb7da330 int,
473 F_6c9882bbac1c7093bd25041881277658 int,
474 F_19f3cd308f1455b3fa09a282e0d496f4 int,
475 F_03c6b06952c750899bb03d998e631860 int,
476 F_c24cd76e1ce41366a4bbe8a49b02a028 int,
477 F_c52f1bd66cc19d05628bd8bf27af3ad6 int,
478 F_fe131d7f5a6b38b23cc967316c13dae2 int,
479 F_f718499c1c8cef6730f9fd03c8125cab int,
480 F_d96409bf894217686ba124d7356686c9 int,
481 F_502e4a16930e414107ee22b6198c578f int,
482 F_cfa0860e83a4c3a763a7e62d825349f7 int,
483 F_a4f23670e1833f3fdb077ca70bbd5d66 int,
484 F_b1a59b315fc9a3002ce38bbe070ec3f5 int,
485 F_36660e59856b4de58a219bcf4e27eba3 int,
486 F_8c19f571e251e61cb8dd3612f26d5ecf int,
487 F_d6baf65e0b240ce177cf70da146c8dc8 int,
488 F_e56954b4f6347e897f954495eab16a88 int,
489 F_f7664060cc52bc6f3d620bcedc94a4b6 int,
490 F_eda80a3d5b344bc40f3bc04f65b7a357 int,
491 F_8f121ce07d74717e0b1f21d122e04521 int,
492 F_06138bc5af6023646ede0e1f7c1eac75 int,
493 F_39059724f73a9969845dfe4146c5660e int,
494 F_7f100b7b36092fb9b06dfb4fac360931 int,
495 F_7a614fd06c325499f1680b9896beedeb int,
496 F_4734ba6f3de83d861c3176a6273cac6d int,
497 F_d947bf06a885db0d477d707121934ff8 int,
498 F_63923f49e5241343aa7acb6a06a751e7 int,
499 F_db8e1af0cb3aca1ae2d0018624204529 int,
500 F_20f07591c6fcb220ffe637cda29bb3f6 int,
501 F_07cdfd23373b17c6b337251c22b7ea57 int,
502 F_d395771085aab05244a4fb8fd91bf4ee int,
503 F_92c8c96e4c37100777c7190b76d28233 int,
504 F_e3796ae838835da0b6f6ea37bcf8bcb7 int,
505 F_6a9aeddfc689c1d0e3b9ccc3ab651bc5 int,
506 F_0f49c89d1e7298bb9930789c8ed59d48 int,
507 F_46ba9f2a6976570b0353203ec4474217 int,
508 F_0e01938fc48a2cfb5f2217fbfb00722d int,
509 F_16a5cdae362b8d27a1d8f8c7b78b4330 int,
510 F_918317b57931b6b7a7d29490fe5ec9f9 int,
511 F_48aedb8880cab8c45637abc7493ecddd int,
512 F_839ab46820b524afda05122893c2fe8e int,
513 F_f90f2aca5c640289d0a29417bcb63a37 int,
514 F_9c838d2e45b2ad1094d42f4ef36764f6 int,
515 F_1700002963a49da13542e0726b7bb758 int,
516 F_53c3bce66e43be4f209556518c2fcb54 int,
517 F_6883966fd8f918a4aa29be29d2c386fb int,
518 F_49182f81e6a13cf5eaa496d51fea6406 int,
519 F_d296c101daa88a51f6ca8cfc1ac79b50 int,
520 F_9fd81843ad7f202f26c1a174c7357585 int,
521 F_26e359e83860db1d11b6acca57d8ea88 int,
522 F_ef0d3930a7b6c95bd2b32ed45989c61f int,
523 F_94f6d7e04a4d452035300f18b984988c int,
524 F_34ed066df378efacc9b924ec161e7639 int,
525 F_577bcc914f9e55d5e4e4f82f9f00e7d4 int,
526 F_11b9842e0a271ff252c1903e7132cd68 int,
527 F_37bc2f75bf1bcfe8450a1a41c200364c int,
528 F_496e05e1aea0a9c4655800e8a7b9ea28 int,
529 F_b2eb7349035754953b57a32e2841bda5 int,
530 F_8e98d81f8217304975ccb23337bb5761 int,
531 F_a8c88a0055f636e4a163a5e3d16adab7 int,
532 F_eddea82ad2755b24c4e168c5fc2ebd40 int,
533 F_06eb61b839a0cefee4967c67ccb099dc int,
534 F_9dfcd5e558dfa04aaf37f137a1d9d3e5 int,
535 F_950a4152c2b4aa3ad78bdd6b366cc179 int,
536 F_158f3069a435b314a80bdcb024f8e422 int,
537 F_758874998f5bd0c393da094e1967a72b int,
538 F_ad13a2a07ca4b7642959dc0c4c740ab6 int,
539 F_3fe94a002317b5f9259f82690aeea4cd int,
540 F_5b8add2a5d98b1a652ea7fd72d942dac int,
541 F_432aca3a1e345e339f35a30c8f65edce int,
542 F_8d3bba7425e7c98c50f52ca1b52d3735 int,
543 F_320722549d1751cf3f247855f937b982 int,
544 F_caf1a3dfb505ffed0d024130f58c5cfa int,
545 F_5737c6ec2e0716f3d8a7a5c4e0de0d9a int,
546 F_bc6dc48b743dc5d013b1abaebd2faed2 int,
547 F_f2fc990265c712c49d51a18a32b39f0c int,
548 F_89f0fd5c927d466d6ec9a21b9ac34ffa int,
549 F_a666587afda6e89aec274a3657558a27 int,
550 F_b83aac23b9528732c23cc7352950e880 int,
551 F_cd00692c3bfe59267d5ecfac5310286c int,
552 F_6faa8040da20ef399b63a72d0e4ab575 int,
553 F_fe73f687e5bc5280214e0486b273a5f9 int);
554 insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
555 --exec $MYSQL_DUMP --skip-comments -c test
559 --echo # Test for --add-drop-database
562 CREATE TABLE t1 (a int);
563 INSERT INTO t1 VALUES (1),(2),(3);
564 --exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
568 --echo # Bug#9558 mysqldump --no-data db t1 t2 format still dumps data
571 CREATE DATABASE mysqldump_test_db;
572 USE mysqldump_test_db;
573 CREATE TABLE t1 ( a INT );
574 CREATE TABLE t2 ( a INT );
575 INSERT INTO t1 VALUES (1), (2);
576 INSERT INTO t2 VALUES (1), (2);
577 --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db
578 --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
579 --exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db
580 --exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2
582 DROP DATABASE mysqldump_test_db;
585 --echo # Testing with tables and databases that don't exists
586 --echo # or contains illegal characters
587 --echo # (Bug#9358 mysqldump crashes if tablename starts with \)
589 create database mysqldump_test_db;
590 use mysqldump_test_db;
591 create table t1(a varchar(30) primary key, b int not null);
592 create table t2(a varchar(30) primary key, b int not null);
593 create table t3(a varchar(30) primary key, b int not null);
596 select '------ Testing with illegal table names ------' as test_sequence ;
599 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
602 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
605 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
608 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
611 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
614 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
617 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
620 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
623 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
626 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
629 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
632 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
635 select '------ Testing with illegal database names ------' as test_sequence ;
638 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_d 2>&1
641 --exec $MYSQL_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
643 drop table t1, t2, t3;
644 drop database mysqldump_test_db;
649 --echo # Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly
652 create table t1 (a int(10));
653 create table t2 (pk int primary key auto_increment,
654 a int(10), b varchar(30), c datetime, d blob, e text);
655 insert into t1 values (NULL), (10), (20);
656 insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
657 --exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
662 --echo # Bug#12123 mysqldump --tab results in text file which can't be imported
665 create table t1 (a text character set utf8, b text character set latin1);
666 insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
668 --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
669 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
670 --exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
677 --echo # Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
680 --exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
683 --echo # Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]"
687 t1_name varchar(255) default null,
688 t1_id int(10) unsigned not null auto_increment,
691 ) auto_increment = 1000 default charset=latin1;
693 insert into t1 (t1_name) values('bla');
694 insert into t1 (t1_name) values('bla');
695 insert into t1 (t1_name) values('bla');
699 show create table `t1`;
701 --exec $MYSQL_DUMP --skip-comments test t1 > $MYSQLTEST_VARDIR/tmp/bug19025.sql
704 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
708 show create table `t1`;
711 --remove_file $MYSQLTEST_VARDIR/tmp/bug19025.sql
715 --echo # Bug#18536 wrong table order
718 create table t1(a int);
719 create table t2(a int);
720 create table t3(a int);
722 --exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
723 drop table t1, t2, t3;
727 --echo # Bug#21288 mysqldump segmentation fault when using --where
730 create table t1 (a int);
732 --exec $MYSQL_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
737 --echo # Bug#13926 --order-by-primary fails if PKEY contains quote character
741 DROP TABLE IF EXISTS `t1`;
746 PRIMARY KEY (`a b`, `c"d`, `e``f`)
747 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
748 insert into t1 values (0815, 4711, 2006);
750 --exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
751 --exec $MYSQL_DUMP --skip-comments --order-by-primary test t1
755 --echo End of 4.1 tests
759 --echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
766 a varchar(30) default NULL,
770 INSERT INTO t2 VALUES ('alfred');
771 INSERT INTO t2 VALUES ('angie');
772 INSERT INTO t2 VALUES ('bingo');
773 INSERT INTO t2 VALUES ('waffle');
774 INSERT INTO t2 VALUES ('lemon');
775 create view v2 as select * from t2 where a like 'a%' with check option;
776 --exec $MYSQL_DUMP --skip-comments db1
784 --echo # Bug#10713 mysqldump includes database in create view and referenced tables
787 # create table and views in db2
790 create table t1 (a int);
791 create table t2 (a int, b varchar(10), primary key(a));
792 insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
793 insert into t1 values (289), (298), (234), (456), (789);
794 create view v1 as select * from t2;
795 create view v2 as select * from t1;
797 # dump tables and view from db2
798 --exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
800 # drop the db, tables and views
806 # create db1 and reload dump
809 --exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
811 # check that all tables and views could be created
813 select * from t2 order by a;
818 --remove_file $MYSQLTEST_VARDIR/tmp/bug10713.sql
824 create table t1(a int);
825 create view v1 as select * from t1;
826 --exec $MYSQL_DUMP --skip-comments test
832 --echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
835 create database mysqldump_test_db;
836 use mysqldump_test_db;
839 a varchar(30) default NULL,
843 INSERT INTO t2 VALUES ('alfred');
844 INSERT INTO t2 VALUES ('angie');
845 INSERT INTO t2 VALUES ('bingo');
846 INSERT INTO t2 VALUES ('waffle');
847 INSERT INTO t2 VALUES ('lemon');
848 create view v2 as select * from t2 where a like 'a%' with check option;
849 --exec $MYSQL_DUMP --skip-comments mysqldump_test_db
852 drop database mysqldump_test_db;
856 --echo # Bug#9756 mysql client failing on dumps containing certain \ sequences
859 CREATE TABLE t1 (a char(10));
860 INSERT INTO t1 VALUES ('\'');
861 --exec $MYSQL_DUMP --skip-comments test t1
865 --echo # Bug#10927 mysqldump: Can't reload dump with view that consist of other view
868 create table t1(a int, b int, c varchar(30));
870 insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three");
876 select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
879 select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
881 --exec $MYSQL_DUMP --skip-comments test
883 drop view v1, v2, v3;
887 --echo # Test for dumping triggers
890 CREATE TABLE t1 (a int, b bigint default NULL);
891 CREATE TABLE t2 (a int);
893 create trigger trg1 before insert on t1 for each row
900 create trigger trg2 before update on t1 for each row begin
901 if old.a % 2 = 0 then set new.b := 12; end if;
903 set sql_mode="traditional"|
904 create trigger trg3 after update on t1 for each row
910 create trigger trg4 before insert on t2 for each row
916 set sql_mode=default|
918 --replace_column 6 '0000-00-00 00:00:00'
919 show triggers like "t1";
920 INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
921 update t1 set a = 4 where a=3;
922 # Triggers should be dumped by default
923 --exec $MYSQL_DUMP --skip-comments --databases test
924 # Skip dumping triggers
925 --exec $MYSQL_DUMP --skip-comments --databases --skip-triggers test
927 --exec $MYSQL_DUMP --skip-comments --databases test > $MYSQLTEST_VARDIR/tmp/mysqldump.sql
929 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump.sql
930 # Check that tables have been reloaded
937 --echo # Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
938 --echo # Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries
939 --echo # (Problems with --defaults-extra-file option)
942 --write_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
946 --exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1
947 --exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1
948 --remove_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
951 --echo # Test of fix to Bug#12597 mysqldump dumps triggers wrongly
954 DROP TABLE IF EXISTS `test1`;
955 CREATE TABLE `test1` (
956 `a1` int(11) default NULL
957 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
959 DROP TABLE IF EXISTS `test2`;
960 CREATE TABLE `test2` (
961 `a2` int(11) default NULL
962 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
965 CREATE TRIGGER `testref` BEFORE INSERT ON `test1` FOR EACH ROW BEGIN
966 INSERT INTO test2 SET a2 = NEW.a1; END //
969 INSERT INTO `test1` VALUES (1);
970 SELECT * FROM `test2`;
973 --exec $MYSQL_DUMP --skip-comments --databases test > $MYSQLTEST_VARDIR/tmp/mysqldump.sql
975 #DROP TRIGGER testref;
979 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqldump.sql
981 SELECT * FROM `test1`;
982 SELECT * FROM `test2`;
984 DROP TRIGGER testref;
987 --remove_file $MYSQLTEST_VARDIR/tmp/mysqldump.sql
991 --echo # Bug#9056 mysqldump does not dump routines
995 DROP TABLE IF EXISTS t1;
996 DROP FUNCTION IF EXISTS bug9056_func1;
997 DROP FUNCTION IF EXISTS bug9056_func2;
998 DROP PROCEDURE IF EXISTS bug9056_proc1;
999 DROP PROCEDURE IF EXISTS bug9056_proc2;
1000 DROP PROCEDURE IF EXISTS `a'b`;
1003 CREATE TABLE t1 (id int);
1004 INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
1007 CREATE FUNCTION `bug9056_func1`(a INT, b INT) RETURNS int(11) RETURN a+b //
1008 CREATE PROCEDURE `bug9056_proc1`(IN a INT, IN b INT, OUT c INT)
1009 BEGIN SELECT a+b INTO c; end //
1011 create function bug9056_func2(f1 char binary) returns char
1013 set f1= concat( 'hello', f1 );
1017 CREATE PROCEDURE bug9056_proc2(OUT a INT)
1019 select sum(id) from t1 into a;
1024 set sql_mode='ansi';
1025 create procedure `a'b` () select 1; # to fix syntax highlighting :')
1028 # Dump the DB and ROUTINES
1029 --exec $MYSQL_DUMP --skip-comments --routines --databases test
1031 # ok, now blow it all away
1032 DROP FUNCTION bug9056_func1;
1033 DROP FUNCTION bug9056_func2;
1034 DROP PROCEDURE bug9056_proc1;
1035 DROP PROCEDURE bug9056_proc2;
1036 DROP PROCEDURE `a'b`;
1041 --echo # Bug#13052 mysqldump timestamp reloads broken
1045 drop table if exists t1;
1048 create table t1 (`d` timestamp, unique (`d`));
1049 set time_zone='+00:00';
1050 insert into t1 values ('2003-10-25 22:00:00'),('2003-10-25 23:00:00');
1051 # results should show two different time values
1053 set time_zone='Europe/Moscow';
1054 # results should show two same time values, despite unique
1056 set global time_zone='Europe/Moscow';
1057 --exec $MYSQL_DUMP --skip-comments --databases test
1058 --exec $MYSQL_DUMP --skip-tz-utc --skip-comments --databases test
1060 set global time_zone=default;
1061 set time_zone=default;
1064 --echo # Test of fix to Bug#13146 ansi quotes break loading of triggers
1068 DROP TABLE IF EXISTS `t1 test`;
1069 DROP TABLE IF EXISTS `t2 test`;
1072 CREATE TABLE `t1 test` (
1073 `a1` int(11) default NULL
1074 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1076 CREATE TABLE `t2 test` (
1077 `a2` int(11) default NULL
1078 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
1081 CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
1082 INSERT INTO `t2 test` SET a2 = NEW.a1; END //
1085 INSERT INTO `t1 test` VALUES (1);
1086 INSERT INTO `t1 test` VALUES (2);
1087 INSERT INTO `t1 test` VALUES (3);
1088 SELECT * FROM `t2 test`;
1089 # dump with compatible=ansi. Everything except triggers should be double
1091 --exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test
1093 DROP TRIGGER `test trig`;
1094 DROP TABLE `t1 test`;
1095 DROP TABLE `t2 test`;
1098 --echo # Bug#12838 mysqldump -x with views exits with error
1102 drop table if exists t1;
1104 create table t1 (a int, b varchar(32), c varchar(32));
1105 insert into t1 values (1, 'first value', 'xxxx');
1106 insert into t1 values (2, 'second value', 'tttt');
1107 insert into t1 values (3, 'third value', 'vvv vvv');
1109 create view v1 as select * from t1;
1110 create view v0 as select * from v1;
1111 create view v2 as select * from v0;
1114 --exec $MYSQL_DUMP -x --skip-comments --databases test
1122 --echo # Bug#14554 mysqldump does not separate words "ROW" and "BEGIN"
1123 --echo # for tables with trigger created in the IGNORE_SPACE sql mode.
1126 SET @old_sql_mode = @@SQL_MODE;
1127 SET SQL_MODE = IGNORE_SPACE;
1129 CREATE TABLE t1 (a INT);
1131 CREATE TRIGGER tr1 BEFORE INSERT ON t1
1138 SET SQL_MODE = @old_sql_mode;
1140 --exec $MYSQL_DUMP --skip-comments --databases test
1146 --echo # Bug#13318 Bad result with empty field and --hex-blob
1149 create table t1 (a binary(1), b blob);
1150 insert into t1 values ('','');
1151 --exec $MYSQL_DUMP --skip-comments --skip-extended-insert --hex-blob test t1
1152 --exec $MYSQL_DUMP --skip-comments --hex-blob test t1
1156 --echo # Bug#14871 Invalid view dump output
1159 create table t1 (a int);
1160 insert into t1 values (289), (298), (234), (456), (789);
1161 create definer = CURRENT_USER view v1 as select * from t1;
1162 create SQL SECURITY INVOKER view v2 as select * from t1;
1163 create view v3 as select * from t1 with local check option;
1164 create algorithm=merge view v4 as select * from t1 with cascaded check option;
1165 create algorithm =temptable view v5 as select * from t1;
1167 # dump tables and views
1168 --exec $MYSQL_DUMP test > $MYSQLTEST_VARDIR/tmp/bug14871.sql
1170 # drop the db, tables and views
1172 drop view v1, v2, v3, v4, v5;
1175 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug14871.sql
1177 # check that all tables and views could be created
1179 select * from v3 order by a;
1182 drop view v1, v2, v3, v4, v5;
1183 --remove_file $MYSQLTEST_VARDIR/tmp/bug14871.sql
1187 --echo # Bug#16878 dump of trigger
1190 create table t1 (a int, created datetime);
1191 create table t2 (b int, created datetime);
1192 create trigger tr1 before insert on t1 for each row set
1195 create trigger tr2 after insert on t1
1198 insert into t2 set b=new.a and created=new.created;
1202 # dump table and trigger
1203 --exec $MYSQL_DUMP test > $MYSQLTEST_VARDIR/tmp/bug16878.sql
1209 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug16878.sql
1210 --replace_column 6 #
1215 --remove_file $MYSQLTEST_VARDIR/tmp/bug16878.sql
1219 --echo # Bug#18462 mysqldump does not dump view structures correctly
1222 create table t (qty int, price int);
1223 insert into t values(3, 50);
1224 insert into t values(5, 51);
1225 create view v1 as select qty, price, qty*price as value from t;
1226 create view v2 as select qty from v1;
1228 --exec $MYSQL_DUMP --compact -F --tab $MYSQLTEST_VARDIR/tmp test
1229 --cat_file $MYSQLTEST_VARDIR/tmp/v1.sql
1230 --echo } mysqldump {
1231 --cat_file $MYSQLTEST_VARDIR/tmp/v2.sql
1236 --remove_file $MYSQLTEST_VARDIR/tmp/v1.sql
1237 --remove_file $MYSQLTEST_VARDIR/tmp/v2.sql
1238 --remove_file $MYSQLTEST_VARDIR/tmp/t.sql
1239 --remove_file $MYSQLTEST_VARDIR/tmp/t.txt
1243 --echo # Bug#14857 Reading dump files with single statement stored routines fails.
1244 --echo # fixed by patch for Bug#16878
1248 /*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
1250 /*!50003 CREATE PROCEDURE `p`()
1253 show create function f;
1254 show create procedure p;
1259 --echo # Bug#17371 Unable to dump a schema with invalid views
1262 create table t1 ( id serial );
1263 create view v1 as select * from t1;
1265 # mysqldump gets 1356 from server, but gives us 2
1268 --exec $MYSQL_DUMP --force -N --compact --skip-comments test
1273 --echo # Bug#17201 Spurious 'DROP DATABASE' in output,
1274 --echo # also confusion between tables and views.
1275 --echo # Example code from Markus Popp
1277 create database mysqldump_test_db;
1278 use mysqldump_test_db;
1279 create table t1 (id int);
1280 create view v1 as select * from t1;
1281 insert into t1 values (1232131);
1282 insert into t1 values (4711);
1283 insert into t1 values (3231);
1284 insert into t1 values (0815);
1285 --exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_test_db
1288 drop database mysqldump_test_db;
1292 --echo # Bug#21014 Segmentation fault of mysqldump on view
1295 create database mysqldump_tables;
1296 use mysqldump_tables;
1297 create table basetable ( id serial, tag varchar(64) );
1299 create database mysqldump_views;
1300 use mysqldump_views;
1301 create view nasishnasifu as select mysqldump_tables.basetable.id from mysqldump_tables.basetable;
1303 --exec $MYSQL_DUMP --skip-comments --compact --databases mysqldump_tables mysqldump_views
1305 drop view nasishnasifu;
1306 drop database mysqldump_views;
1307 drop table mysqldump_tables.basetable;
1308 drop database mysqldump_tables;
1311 --echo # Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps
1314 create database mysqldump_dba;
1316 create table t1 (f1 int, f2 int);
1317 insert into t1 values (1,1);
1318 create view v1 as select f1, f2 from t1;
1320 create database mysqldump_dbb;
1322 create table t1 (f1 int, f2 int);
1323 insert into t1 values (2,2);
1324 create view v1 as select f1, f2 from t1;
1326 --exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_dba mysqldump_dbb > $MYSQLTEST_VARDIR/tmp/bug20221_backup
1330 drop database mysqldump_dbb;
1334 drop database mysqldump_dba;
1336 --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20221_backup
1338 select * from mysqldump_dba.v1;
1339 select * from mysqldump_dbb.v1;
1344 drop database mysqldump_dba;
1348 drop database mysqldump_dbb;
1349 --remove_file $MYSQLTEST_VARDIR/tmp/bug20221_backup
1353 --echo # Bug#21215 mysqldump creating incomplete backups without warning
1356 # Create user without sufficient privs to perform the requested operation
1357 create user mysqltest_1@localhost;
1358 create table t1(a int, b varchar(34));
1360 # To get consistent output, reset the master, starts over from first log
1363 # Execute mysqldump, will fail on FLUSH TABLES
1365 --exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
1367 # Execute mysqldump, will fail on FLUSH TABLES
1368 # use --force, should no affect behaviour
1370 --exec $MYSQL_DUMP --compact --force --master-data -u mysqltest_1 test 2>&1
1373 grant RELOAD on *.* to mysqltest_1@localhost;
1375 # Execute mysqldump, will fail on SHOW MASTER STATUS
1377 --exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
1379 # Execute mysqldump, will fail on SHOW MASTER STATUS.
1380 # use --force, should not alter behaviour
1382 --exec $MYSQL_DUMP --compact --force --master-data -u mysqltest_1 test 2>&1
1384 # Add REPLICATION CLIENT grants
1385 grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
1387 # Execute mysqldump, should now succeed
1388 --disable_result_log
1389 --exec $MYSQL_DUMP --compact --master-data -u mysqltest_1 test 2>&1
1394 drop user mysqltest_1@localhost;
1398 --echo # Bug#21424 mysqldump failing to export/import views
1402 connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
1404 create database mysqldump_myDB;
1406 create user myDB_User@localhost;
1407 grant create, create view, select, insert on mysqldump_myDB.* to myDB_User@localhost;
1408 create table t1 (c1 int);
1409 insert into t1 values (3);
1412 connect (user1,localhost,myDB_User,,mysqldump_myDB,$MASTER_MYPORT,$MASTER_MYSOCK);
1415 create table u1 (f1 int);
1416 insert into u1 values (4);
1417 create view v1 (c1) as select * from t1;
1419 # Backup should not fail for Bug#21527. Flush priviliges test begins.
1420 --exec $MYSQL_DUMP --skip-comments --add-drop-table --flush-privileges --ignore-table=mysql.general_log --ignore-table=mysql.slow_log --databases mysqldump_myDB mysql > $MYSQLTEST_VARDIR/tmp/bug21527.sql
1428 revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
1429 drop user myDB_User@localhost;
1430 drop database mysqldump_myDB;
1434 --echo # Bug#21424 continues from here.
1435 --echo # Restore. Flush Privileges test ends.
1438 --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21527.sql
1444 # Ultimate test for correct data.
1445 select * from mysqldump_myDB.v1;
1446 select * from mysqldump_myDB.u1;
1455 revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
1456 drop user myDB_User@localhost;
1457 drop database mysqldump_myDB;
1460 --remove_file $MYSQLTEST_VARDIR/tmp/bug21527.sql
1464 --echo # Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
1465 --echo # information_schema database.
1467 --echo # Bug #33762: mysqldump can not dump INFORMATION_SCHEMA
1469 --exec $MYSQL_DUMP --compact --opt -d information_schema TABLES
1472 --echo # Bug#19745 mysqldump --xml produces invalid xml
1476 DROP TABLE IF EXISTS t1;
1479 CREATE TABLE t1 (f1 int(10), data MEDIUMBLOB);
1480 INSERT INTO t1 VALUES(1,0xff00fef0);
1482 --exec $MYSQL_DUMP --xml --hex-blob --skip-create-options test t1
1488 --echo # Bug#26346 stack + buffer overrun in mysqldump
1491 CREATE TABLE t1(a int);
1492 INSERT INTO t1 VALUES (1), (2);
1494 # too long a file path causes an error
1496 --exec $MYSQL_DUMP --tab=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa test
1507 --remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
1508 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
1514 # Bug#25993 crashes with a merge table and -c
1517 CREATE TABLE t2 (a INT);
1518 CREATE TABLE t3 (a INT);
1519 CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
1520 --exec $MYSQL_DUMP --skip-comments -c test
1521 DROP TABLE t1, t2, t3;
1525 --echo # Bug#23491 MySQLDump prefix function call in a view by database name
1529 create database bug23491_original;
1530 create database bug23491_restore;
1531 use bug23491_original;
1532 create table t1 (c1 int);
1533 create view v1 as select * from t1;
1534 create procedure p1() select 1;
1535 create function f1() returns int return 1;
1536 create view v2 as select f1();
1537 create function f2() returns int return f1();
1538 create view v3 as select bug23491_original.f1();
1541 --exec $MYSQL_DUMP --skip-comments -uroot --opt --routines bug23491_original > $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql
1544 --exec $MYSQL bug23491_restore < $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql
1547 use bug23491_restore;
1548 show create view bug23491_restore.v2;
1549 show create view bug23491_restore.v3;
1552 drop database bug23491_original;
1553 drop database bug23491_restore;
1555 --remove_file $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql
1560 --echo # Bug#27293 mysqldump crashes when dumping routines
1561 --echo # defined by a different user
1563 --echo # Bug#22761 mysqldump reports no errors when using
1564 --echo # --routines without mysql.proc privileges
1567 create database mysqldump_test_db;
1569 grant all privileges on mysqldump_test_db.* to user1;
1570 grant all privileges on mysqldump_test_db.* to user2;
1572 connect (user27293,localhost,user1,,mysqldump_test_db,$MASTER_MYPORT,$MASTER_MYSOCK);
1573 connection user27293;
1575 create procedure mysqldump_test_db.sp1() select 'hello';
1578 --exec $MYSQL_DUMP -f --compact --user=user2 --password= -h 127.0.0.1 -P $MASTER_MYPORT --routines mysqldump_test_db
1580 --exec $MYSQL_DUMP -f --compact --user=user1 --password= -h 127.0.0.1 -P $MASTER_MYPORT --routines mysqldump_test_db
1585 disconnect user27293;
1589 drop database mysqldump_test_db;
1592 --echo # Bug#28522 buffer overrun by '\0' byte using --hex-blob.
1595 CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
1596 INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
1597 --exec $MYSQL_DUMP --skip-create --compact --hex-blob test t1
1601 --echo # Bug#28524 mysqldump --skip-add-drop-table is not
1602 --echo # compatible with views
1605 CREATE VIEW v1 AS SELECT 1;
1606 --exec $MYSQL_DUMP --skip-add-drop-table test > $MYSQLTEST_VARDIR/tmp/bug28524.sql
1609 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql
1612 --remove_file $MYSQLTEST_VARDIR/tmp/bug28524.sql
1616 --echo # Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
1617 --echo # the SQL_MODE variable after the dumping of triggers.
1620 CREATE TABLE t1 (c1 INT);
1621 CREATE TRIGGER t1bd BEFORE DELETE ON t1 FOR EACH ROW BEGIN END;
1623 CREATE TABLE t2 (c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
1625 SET @TMP_SQL_MODE = @@SQL_MODE;
1626 SET SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO';
1627 INSERT INTO t2 VALUES (0), (1), (2);
1628 SET SQL_MODE = @TMP_SQL_MODE;
1631 --exec $MYSQL_DUMP --routines test >$MYSQLTEST_VARDIR/tmp/bug29788.sql
1632 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug29788.sql
1636 --remove_file $MYSQLTEST_VARDIR/tmp/bug29788.sql
1640 --echo # Bug#29815 new option for suppressing last line of mysqldump:
1641 --echo # "Dump completed on"
1644 --echo # --skip-dump-date:
1645 --replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*//
1646 --exec $MYSQL_DUMP --skip-dump-date test
1648 --echo # --dump-date:
1649 --replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
1650 --exec $MYSQL_DUMP --dump-date test
1652 --echo # --dump-date (default):
1653 --replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
1654 --exec $MYSQL_DUMP test
1657 --echo # Bug #42635: mysqldump includes views that were excluded using
1658 --echo # the --ignore-table option
1661 create database db42635;
1663 create table t1 (id int);
1664 create view db42635.v1 (c) as select * from db42635.t1;
1665 create view db42635.v2 (c) as select * from db42635.t1;
1666 --exec $MYSQL_DUMP --skip-comments --ignore-table=db42635.v1 db42635
1668 drop database db42635;
1671 --echo # Bug#33550 mysqldump 4.0 compatibility broken
1675 CREATE TABLE `straße` ( f1 INT );
1676 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
1677 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
1678 DROP TABLE `straße`;
1680 CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT );
1681 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test
1683 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=latin1 --compatible=mysql323 test
1684 DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`;
1688 --echo # End of 5.0 tests
1691 # Check new --replace option
1694 drop table if exists t1;
1697 CREATE TABLE t1(a int, b int);
1698 INSERT INTO t1 VALUES (1,1);
1699 INSERT INTO t1 VALUES (2,3);
1700 INSERT INTO t1 VALUES (3,4), (4,5);
1701 --exec $MYSQL_DUMP --replace --skip-comments test t1
1705 # Added for use-thread option
1708 create table t1 (a text , b text);
1709 create table t2 (a text , b text);
1710 insert t1 values ("Duck, Duck", "goose");
1711 insert t1 values ("Duck, Duck", "pidgeon");
1712 insert t2 values ("We the people", "in order to perform");
1713 insert t2 values ("a more perfect", "union");
1716 --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
1717 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
1718 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t2.sql
1719 # The first load tests the pausing code
1720 --exec $MYSQL_IMPORT --use-threads=1 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
1721 # Now we test with multiple threads!
1722 --exec $MYSQL_IMPORT --silent --use-threads=5 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
1725 # Now we test with multiple threads, but less threads than files.
1726 create table words(a varchar(255));
1727 create table words2(b varchar(255));
1728 --exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat
1731 select * from words;
1732 select * from words2;
1734 # Drop table "words" and run with threads, should fail
1736 --replace_regex /.*mysqlimport(\.exe)*/mysql-import/
1738 --exec $MYSQL_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data/words.dat $MYSQLTEST_VARDIR/std_data/words2.dat 2>&1
1746 --echo # Bug#16853 mysqldump doesn't show events
1749 create database first;
1751 set time_zone = 'UTC';
1753 ## prove one works (with spaces and tabs on the end)
1754 create event ee1 on schedule at '2035-12-31 20:01:23' do set @a=5;
1756 show create event ee1;
1757 --exec $MYSQL_DUMP --events first > $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
1758 drop database first;
1760 create database second;
1762 --exec $MYSQL second < $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
1764 show create event ee1;
1765 --remove_file $MYSQLTEST_VARDIR/tmp/bug16853-1.sql
1767 ## prove three works (with spaces and tabs on the end)
1768 # start with one from the previous restore
1769 create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
1770 create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
1772 --exec $MYSQL_DUMP --events second > $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
1773 drop database second;
1775 create database third;
1777 --exec $MYSQL third < $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
1779 drop database third;
1780 --remove_file $MYSQLTEST_VARDIR/tmp/bug16853-2.sql
1782 # revert back to normal settings
1783 set time_zone = 'SYSTEM';
1787 --echo # Bug#17201 Spurious 'DROP DATABASE' in output,
1788 --echo # also confusion between tables and views.
1789 --echo # Example code from Markus Popp
1792 create database mysqldump_test_db;
1793 use mysqldump_test_db;
1794 create table t1 (id int);
1795 create view v1 as select * from t1;
1796 insert into t1 values (1232131);
1797 insert into t1 values (4711);
1798 insert into t1 values (3231);
1799 insert into t1 values (0815);
1800 --exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_test_db
1803 drop database mysqldump_test_db;
1806 # Bug#26121 mysqldump includes LOCK TABLES general_log WRITE
1808 --exec $MYSQL_DUMP --all-databases > $MYSQLTEST_VARDIR/tmp/bug26121.sql
1809 --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug26121.sql
1810 --remove_file $MYSQLTEST_VARDIR/tmp/bug26121.sql
1812 ###########################################################################
1815 --echo # Bug#30027 mysqldump does not dump views properly.
1822 DROP DATABASE IF EXISTS mysqldump_test_db;
1826 --echo # Create objects.
1828 CREATE DATABASE mysqldump_test_db;
1832 CREATE VIEW mysqldump_test_db.v2 AS SELECT 1 AS ËÏÌÏÎËÁ1;
1833 CREATE VIEW mysqldump_test_db.v1 AS SELECT ËÏÌÏÎËÁ1 FROM mysqldump_test_db.v2;
1838 --echo # Dump mysqldump_test_db to bug30027.sql.
1840 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30027.sql
1843 --echo # Drop mysqldump_test_db.
1845 DROP DATABASE mysqldump_test_db;
1848 --echo # Restore mysqldump_test_db from bug30027.sql.
1850 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug30027.sql
1853 --echo # Check the view.
1857 SHOW CREATE VIEW mysqldump_test_db.v1;
1858 SHOW CREATE VIEW mysqldump_test_db.v2;
1865 DROP DATABASE mysqldump_test_db;
1866 --remove_file $MYSQLTEST_VARDIR/tmp/bug30027.sql
1868 ###########################################################################
1871 --echo # Bug#29938 wrong behavior of mysqldump --skip-events
1872 --echo # with --all-databases
1875 TRUNCATE mysql.event;
1878 CREATE event e29938 ON SCHEDULE AT '2035-12-31 20:01:23' DO SET @bug29938=29938;
1880 --exec $MYSQL_DUMP --skip-events --all-databases > $MYSQLTEST_VARDIR/tmp/bug29938.sql
1882 TRUNCATE mysql.event;
1883 --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug29938.sql
1885 --remove_file $MYSQLTEST_VARDIR/tmp/bug29938.sql
1889 --echo # Bug#31113 mysqldump 5.1 can't handle a dash ("-") in database names
1891 create database `test-database`;
1892 use `test-database`;
1893 create table test (a int);
1894 --exec $MYSQL_DUMP --compact --opt --quote-names test-database
1895 drop database `test-database`;
1898 ###########################################################################
1901 --echo # -----------------------------------------------------------------
1902 --echo # -- Bug#30217 Views: changes in metadata behaviour between 5.0 and 5.1.
1903 --echo # -----------------------------------------------------------------
1907 DROP DATABASE IF EXISTS mysqldump_test_db;
1910 CREATE DATABASE mysqldump_test_db;
1911 use mysqldump_test_db;
1915 CREATE VIEW v1(x, y) AS SELECT 'a', 'a';
1919 SELECT view_definition
1920 FROM INFORMATION_SCHEMA.VIEWS
1921 WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
1925 --echo ---> Dumping mysqldump_test_db to bug30217.sql
1926 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --databases mysqldump_test_db > $MYSQLTEST_VARDIR/tmp/bug30217.sql
1930 DROP DATABASE mysqldump_test_db;
1935 --echo ---> Restoring mysqldump_test_db...
1936 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug30217.sql
1940 SELECT view_definition
1941 FROM INFORMATION_SCHEMA.VIEWS
1942 WHERE table_schema = 'mysqldump_test_db' AND table_name = 'v1';
1946 DROP DATABASE mysqldump_test_db;
1947 --remove_file $MYSQLTEST_VARDIR/tmp/bug30217.sql
1950 --echo # -- End of test case for Bug#32538.
1954 --echo # Bug#37377 Incorrect DROP TABLE statement in dump of a VIEW using --tab
1957 create table t1 (a int);
1958 create view v1 as select a from t1;
1960 --exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test t1 v1
1965 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
1966 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/v1.sql
1971 --remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
1972 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
1973 --remove_file $MYSQLTEST_VARDIR/tmp/v1.sql
1977 --echo # Bug#28071 mysqlimport does not quote or escape table name
1981 drop table if exists `load`;
1983 create table `load` (a varchar(255));
1985 --copy_file std_data/words.dat $MYSQLTEST_VARDIR/tmp/load.txt
1986 --chmod 0644 $MYSQLTEST_VARDIR/tmp/load.txt
1988 --exec $MYSQL_IMPORT --ignore test $MYSQLTEST_VARDIR/tmp/load.txt
1990 select count(*) from `load`;
1992 --remove_file $MYSQLTEST_VARDIR/tmp/load.txt
1996 # We reset concurrent_inserts value to whatever it was at the start of the
1997 # test This line must be executed _after_ all test cases.
1998 SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
2001 ###########################################################################
2004 --echo Bug #34861 - mysqldump with --tab gives weird output for triggers.
2007 CREATE TABLE t1 (f1 INT);
2008 CREATE TRIGGER tr1 BEFORE UPDATE ON t1 FOR EACH ROW SET @f1 = 1;
2009 CREATE PROCEDURE pr1 () SELECT "Meow";
2010 CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT "Meow";
2015 SELECT name,body FROM mysql.proc WHERE NAME = 'pr1';
2018 --echo dump table; if anything goes to stdout, it ends up here: ---------------
2019 --exec $MYSQL_DUMP --compact --routines --triggers --events --result-file=$MYSQLTEST_VARDIR/tmp/test_34861.sql --tab=$MYSQLTEST_VARDIR/tmp/ test
2022 --echo drop everything
2029 --echo reload table; this should restore table and trigger
2030 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
2033 SELECT name,body FROM mysql.proc WHERE NAME = 'pr1';
2036 --echo reload db; this should restore routines and events
2037 --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/test_34861.sql
2040 SELECT name,body FROM mysql.proc WHERE NAME = 'pr1';
2044 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
2045 --remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
2046 --remove_file $MYSQLTEST_VARDIR/tmp/test_34861.sql
2048 DROP EVENT IF EXISTS ev1;
2049 DROP PROCEDURE IF EXISTS pr1;
2050 DROP TRIGGER IF EXISTS tr1;
2051 DROP TABLE IF EXISTS t1;
2054 ###########################################################################
2057 --echo # Bug #30946: mysqldump silently ignores --default-character-set
2058 --echo # when used with --tab
2060 --echo # Also see outfile_loaddata.test
2064 CREATE TABLE t1 (a INT, b CHAR(10) CHARSET koi8r, c CHAR(10) CHARSET latin1);
2065 CREATE TABLE t2 LIKE t1;
2066 INSERT INTO t1 VALUES (1, 'ABC-АБВ', 'DEF-ÂÃÄ'), (2, NULL, NULL);
2068 --let $file=$MYSQLTEST_VARDIR/tmp/t1.txt
2071 --echo # error on multi-character ENCLOSED/ESCAPED BY
2074 --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-enclosed-by='12345' test t1
2078 --exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --fields-escaped-by='12345' test t1
2081 --echo # default '--default-charset' (binary):
2083 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --tab=$MYSQLTEST_VARDIR/tmp/ test t1
2084 --echo ##################################################
2086 --echo ##################################################
2088 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2089 --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET binary
2091 SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
2096 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=utf8 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
2097 --echo ##################################################
2099 --echo ##################################################
2101 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2102 --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET utf8
2104 SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
2107 --echo # latin1 (data corruption is expected):
2109 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$MYSQLTEST_VARDIR/tmp/ test t1
2110 --echo ##################################################
2112 --echo ##################################################
2114 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2115 --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET latin1
2117 SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
2120 --echo # koi8r (data corruption is expected):
2122 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=koi8r --tab=$MYSQLTEST_VARDIR/tmp/ test t1
2123 --echo ##################################################
2125 --echo ##################################################
2127 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2128 --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET koi8r
2130 SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c;
2136 ###########################################################################
2139 --echo # Bug #53088: mysqldump with -T & --default-character-set set
2140 --echo # truncates text/blob to 766 chars
2142 --echo # Also see outfile_loaddata.test
2145 CREATE TABLE t1 (a BLOB) CHARSET latin1;
2146 CREATE TABLE t2 LIKE t1;
2149 let $dir= $MYSQLTEST_VARDIR/tmp;
2150 let $file= $dir/$table.txt;
2153 --eval INSERT INTO t1 VALUES (REPEAT('.', $length))
2155 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --default-character-set=latin1 --tab=$dir/ test $table
2156 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2158 --eval LOAD DATA INFILE '$file' INTO TABLE t2 CHARACTER SET latin1
2161 --echo # should be $length
2162 SELECT LENGTH(a) FROM t2;
2166 ###########################################################################
2169 --echo # Bug #13618 : mysqldump --xml ommit comment on table field
2172 CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT';
2173 --exec $MYSQL_DUMP --compact --skip-create --xml test
2174 DROP TABLE `comment_table`;
2177 --echo # BUG#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN
2178 --echo # DATABASE NAMES IN ALTER DATABASE
2181 CREATE DATABASE `test-database`;
2182 USE `test-database`;
2183 CREATE TABLE `test` (`c1` VARCHAR(10)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2186 CREATE TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
2190 ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
2191 ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
2193 --exec $MYSQL_DUMP --quote-names --compact test-database
2195 DROP DATABASE `test-database`;
2196 # Switching back to test database.
2200 --echo # BUG#11760384 : 52792: mysqldump in XML mode does not dump routines.
2202 CREATE DATABASE BUG52792;
2204 CREATE TABLE t1 (c1 INT, c2 VARCHAR(20));
2205 CREATE TABLE t2 (c1 INT);
2206 INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc');
2207 INSERT INTO t2 VALUES (1),(2),(3);
2209 --echo # Stored Procedures.
2212 CREATE PROCEDURE simpleproc1 (OUT param1 INT)
2214 SELECT COUNT(*) INTO param1 FROM t1;
2219 CREATE PROCEDURE simpleproc2 (OUT param1 INT)
2221 SELECT COUNT(*) INTO param1 FROM t2;
2227 CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
2228 CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792;
2232 CREATE FUNCTION `hello1` (s CHAR(20))
2233 RETURNS CHAR(50) DETERMINISTIC
2234 RETURN CONCAT('Hello, ' ,s ,'!');
2236 CREATE FUNCTION `hello2` (s CHAR(20))
2237 RETURNS CHAR(50) DETERMINISTIC
2238 RETURN CONCAT(']]>, ' , s ,'!');
2243 CREATE TRIGGER trig1 BEFORE INSERT ON t2
2245 INSERT INTO t2 VALUES(1);
2251 CREATE TRIGGER trig2 AFTER INSERT ON t2
2253 INSERT INTO t2 VALUES(1, ']]>');
2254 INSERT INTO t2 VALUES(2, '<![CDATA]]>');
2255 INSERT INTO t2 VALUES(3, '<![CDATA[');
2256 INSERT INTO t2 VALUES(4, '< > & \ " _');
2263 CREATE VIEW v1 AS SELECT * FROM t1;
2264 CREATE VIEW v2 AS SELECT * FROM t2;
2266 --echo # Dumping BUG52792 database in xml format.
2268 --echo # Running 'replace_regex on timestamp'
2269 --replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/
2270 --exec $MYSQL_DUMP --user=root --compact -R -E --triggers -X BUG52792
2272 --echo # Dumping BUG52792 database in xml format with comments.
2274 --echo # Running 'replace_regex on timestamp'
2275 --replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/
2276 --exec $MYSQL_DUMP --comments --user=root -R -E --triggers -X BUG52792
2279 --echo # Test to check 'Insufficient privileges' error.
2282 GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
2284 connect (conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK);
2287 --echo # Running 'replace_regex on timestamp'
2288 --replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/
2290 --exec $MYSQL_DUMP --user=user1 -R -E --triggers -X BUG52792
2296 DROP DATABASE BUG52792;
2298 CREATE DATABASE BUG52792;
2301 CREATE FUNCTION `straße` ( c1 CHAR(20))
2302 RETURNS CHAR(50) DETERMINISTIC
2303 RETURN CONCAT(']]>, ', s, '!');
2305 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 -R -X BUG52792
2307 DROP DATABASE BUG52792;
2311 # Wait till we reached the initial number of concurrent sessions
2312 --source include/wait_until_count_sessions.inc
2315 --echo # Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM
2317 SET @old_log_output_state= @@global.log_output;
2318 SET @old_general_log_state= @@global.general_log;
2319 SET @old_slow_query_log_state= @@global.slow_query_log;
2321 call mtr.add_suppression("Failed to write to mysql.general_log");
2322 --exec $MYSQL_DUMP -uroot --all-databases > $MYSQLTEST_VARDIR/tmp/bug45740.sql
2323 # Make log_output as table and enable general_log and slow_log
2324 SET @@global.log_output="TABLE";
2325 SET @@global.general_log='ON';
2326 SET @@global.slow_query_log='ON';
2327 DROP DATABASE mysql;
2328 --exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug45740.sql
2329 SHOW CREATE TABLE mysql.general_log;
2330 SHOW CREATE TABLE mysql.slow_log;
2331 --remove_file $MYSQLTEST_VARDIR/tmp/bug45740.sql
2333 SET @@global.log_output= @old_log_output_state;
2334 SET @@global.slow_query_log= @old_slow_query_log_state;
2335 SET @@global.general_log= @old_general_log_state;
2338 --echo # End of 5.1 tests