#At file:///Users/pcrews/usr/local/bin/data1/work/mysqldump/mysql-5.1-mysqldump/
2725 Patrick Crews 2008-08-29
Bug#37938 Test "mysqldump" lacks various INSERT statements / values
Found that the test was failing due to INSERTs not being fully processed before a call to mysqldump.
Inserted --sleep statements to ensure some time passes before a mysqldump call.
Ran the test 2500 times without failure. The test was failing ~1/5 times before the changes.
modified:
mysql-test/t/mysqldump.test
=== modified file 'mysql-test/t/mysqldump.test'
--- a/mysql-test/t/mysqldump.test 2008-03-05 09:16:20 +0000
+++ b/mysql-test/t/mysqldump.test 2008-08-29 13:29:07 +0000
@@ -17,6 +17,7 @@ drop view if exists v1, v2, v3;
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
INSERT INTO t1 VALUES (1), (2);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
DROP TABLE t1;
@@ -27,6 +28,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a decimal(64, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
+--sleep 0.1
--exec $MYSQL_DUMP --compact test t1
DROP TABLE t1;
@@ -39,6 +41,7 @@ INSERT INTO t1 VALUES ('-9e999999');
# The following replaces is here because some systems replaces the above
# double with '-inf' and others with MAX_DOUBLE
--replace_result (-1.79769313486232e+308) (RES) (NULL) (RES)
+--sleep 0.1
--exec $MYSQL_DUMP --compact test t1
DROP TABLE t1;
@@ -70,6 +73,7 @@ DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3));
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
+--sleep 0.1
--exec $MYSQL_DUMP --skip-create --compact -X test t1
DROP TABLE t1;
@@ -79,6 +83,7 @@ DROP TABLE t1;
CREATE TABLE t1 (`a"b"` char(2));
INSERT INTO t1 VALUES ("1\""), ("\"2");
+--sleep 0.1
--exec $MYSQL_DUMP --compact --skip-create -X test t1
DROP TABLE t1;
@@ -89,6 +94,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1
DROP TABLE t1;
@@ -98,6 +104,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --compatible=mysql40 test t1
--exec $MYSQL_DUMP --skip-comments --compatible=mysql323 test t1
DROP TABLE t1;
@@ -129,6 +136,7 @@ drop table t1;
create table t1(a int);
insert into t1 values (1),(2),(3);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
--cat_file $MYSQLTEST_VARDIR/tmp/t1.sql
--cat_file $MYSQLTEST_VARDIR/tmp/t1.txt
@@ -158,6 +166,7 @@ drop database mysqldump_test_db;
CREATE TABLE t1 (a CHAR(10));
INSERT INTO t1 VALUES (_latin1 '��');
+--sleep 0.1
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
--echo #
@@ -182,6 +191,7 @@ CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t2 VALUES (4),(5),(6);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test
DROP TABLE t1;
DROP TABLE t2;
@@ -192,6 +202,7 @@ DROP TABLE t2;
CREATE TABLE t1 (`b` blob);
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
DROP TABLE t1;
@@ -202,6 +213,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
--exec $MYSQL_DUMP --skip-comments --insert-ignore --delayed-insert test t1
DROP TABLE t1;
@@ -542,6 +554,7 @@ create table t1 (
F_6faa8040da20ef399b63a72d0e4ab575 int,
F_fe73f687e5bc5280214e0486b273a5f9 int);
insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments -c test
drop table t1;
@@ -551,6 +564,7 @@ drop table t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1),(2),(3);
+--sleep 0.1
--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
DROP TABLE t1;
@@ -564,6 +578,7 @@ CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( a INT );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db
@@ -644,6 +659,7 @@ create table t2 (pk int primary key auto
a int(10), b varchar(30), c datetime, d blob, e text);
insert into t1 values (NULL), (10), (20);
insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;
@@ -686,6 +702,7 @@ select * from t1;
show create table `t1`;
+
--exec $MYSQL_DUMP --skip-comments test t1 > $MYSQLTEST_VARDIR/tmp/bug19025.sql
DROP TABLE `t1`;
@@ -730,7 +747,7 @@ CREATE TABLE `t1` (
PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);
-
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
--exec $MYSQL_DUMP --skip-comments --order-by-primary test t1
DROP TABLE `t1`;
@@ -826,6 +843,7 @@ INSERT INTO t2 VALUES ('bingo');
INSERT INTO t2 VALUES ('waffle');
INSERT INTO t2 VALUES ('lemon');
create view v2 as select * from t2 where a like 'a%' with check option;
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments mysqldump_test_db
drop table t2;
drop view v2;
@@ -838,6 +856,7 @@ use test;
CREATE TABLE t1 (a char(10));
INSERT INTO t1 VALUES ('\'');
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments test t1
DROP TABLE t1;
@@ -899,6 +918,7 @@ delimiter ;|
show triggers like "t1";
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
update t1 set a = 4 where a=3;
+--sleep 0.1
# Triggers should be dumped by default
--exec $MYSQL_DUMP --skip-comments --databases test
# Skip dumping triggers
@@ -1063,6 +1083,7 @@ INSERT INTO `t1 test` VALUES (3);
SELECT * FROM `t2 test`;
# dump with compatible=ansi. Everything except triggers should be double
# quoted
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test
DROP TRIGGER `test trig`;
@@ -1122,6 +1143,7 @@ DROP TABLE t1;
create table t1 (a binary(1), b blob);
insert into t1 values ('','');
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --skip-extended-insert --hex-blob test t1
--exec $MYSQL_DUMP --skip-comments --hex-blob test t1
drop table t1;
@@ -1247,6 +1269,7 @@ insert into t1 values (1232131);
insert into t1 values (4711);
insert into t1 values (3231);
insert into t1 values (0815);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_test_db
drop view v1;
drop table t1;
@@ -1431,6 +1454,7 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f1 int(10), data MEDIUMBLOB);
INSERT INTO t1 VALUES(1,0xff00fef0);
+--sleep 0.1
--exec $MYSQL_DUMP --xml --hex-blob --skip-create-options test t1
DROP TABLE t1;
@@ -1538,6 +1562,7 @@ drop database mysqldump_test_db;
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-create --compact --hex-blob test t1
DROP TABLE t1;
@@ -1607,6 +1632,7 @@ CREATE TABLE t1(a int, b int);
INSERT INTO t1 VALUES (1,1);
INSERT INTO t1 VALUES (2,3);
INSERT INTO t1 VALUES (3,4), (4,5);
+--sleep 0.1
--exec $MYSQL_DUMP --replace --skip-comments test t1
DROP TABLE t1;
@@ -1709,6 +1735,7 @@ insert into t1 values (1232131);
insert into t1 values (4711);
insert into t1 values (3231);
insert into t1 values (0815);
+--sleep 0.1
--exec $MYSQL_DUMP --skip-comments --add-drop-database --databases mysqldump_test_db
drop view v1;
drop table t1;
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (pcrews:2725) Bug#37938 | Patrick Crews | 29 Aug |