Commit 459bee9c authored by Akhila Maddukuri's avatar Akhila Maddukuri

Bug #15930494 MYSQLDUMP TEST SOMETIMES FAILS DUE TO MIXING STDOUT AND

STDERR

      Fix: Added a destination file to mysqldump.
parent 54324117
...@@ -5115,15 +5115,12 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); ...@@ -5115,15 +5115,12 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
# Note : In the following dump the transaction # Note : In the following dump the transaction
# should start only after the logs are # should start only after the logs are
# flushed, as 'flush logs' causes implicit # flushed, as 'flush logs' causes implicit
# commit starting 5.5. # commit starting 5.5.Also, as stderr is
# unbuffered, it is redirected to a different
# file to avoid diffs due to bad stdout/stderr
# order in the output.
#### Dump starts here #### #### Dump starts here ####
-- Connecting to localhost...
-- main : logs flushed successfully!
-- Starting transaction...
-- Retrieving table structure for table t1...
-- Sending SELECT query...
-- Retrieving rows...
-- --
-- Host: localhost Database: b12809202_db -- Host: localhost Database: b12809202_db
-- ------------------------------------------------------ -- ------------------------------------------------------
...@@ -5158,9 +5155,6 @@ CREATE TABLE `t1` ( ...@@ -5158,9 +5155,6 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (1),(2),(3); INSERT INTO `t1` VALUES (1),(2),(3);
-- Retrieving table structure for table t2...
-- Sending SELECT query...
-- Retrieving rows...
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
...@@ -5185,7 +5179,6 @@ LOCK TABLES `t2` WRITE; ...@@ -5185,7 +5179,6 @@ LOCK TABLES `t2` WRITE;
INSERT INTO `t2` VALUES (1),(2),(3); INSERT INTO `t2` VALUES (1),(2),(3);
/*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
-- Disconnecting from localhost...
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
...@@ -5197,6 +5190,18 @@ UNLOCK TABLES; ...@@ -5197,6 +5190,18 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed -- Dump completed
## stderr ##
-- Connecting to localhost...
-- main : logs flushed successfully!
-- Starting transaction...
-- Retrieving table structure for table t1...
-- Sending SELECT query...
-- Retrieving rows...
-- Retrieving table structure for table t2...
-- Sending SELECT query...
-- Retrieving rows...
-- Disconnecting from localhost...
#### Dump ends here #### #### Dump ends here ####
DROP TABLE b12809202_db.t1; DROP TABLE b12809202_db.t1;
DROP TABLE b12809202_db.t2; DROP TABLE b12809202_db.t2;
......
...@@ -2347,11 +2347,17 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); ...@@ -2347,11 +2347,17 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
--echo # Note : In the following dump the transaction --echo # Note : In the following dump the transaction
--echo # should start only after the logs are --echo # should start only after the logs are
--echo # flushed, as 'flush logs' causes implicit --echo # flushed, as 'flush logs' causes implicit
--echo # commit starting 5.5. --echo # commit starting 5.5.Also, as stderr is
--echo # unbuffered, it is redirected to a different
--echo # file to avoid diffs due to bad stdout/stderr
--echo # order in the output.
--echo --echo
--echo #### Dump starts here #### --echo #### Dump starts here ####
--replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/ --replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/
--exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>&1 --exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>$MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql
--echo
--echo ## stderr ##
--cat_file $MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql
--echo --echo
--echo #### Dump ends here #### --echo #### Dump ends here ####
...@@ -2359,6 +2365,7 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); ...@@ -2359,6 +2365,7 @@ INSERT INTO b12809202_db.t2 VALUES (1), (2), (3);
DROP TABLE b12809202_db.t1; DROP TABLE b12809202_db.t1;
DROP TABLE b12809202_db.t2; DROP TABLE b12809202_db.t2;
DROP DATABASE b12809202_db; DROP DATABASE b12809202_db;
--remove_file $MYSQLTEST_VARDIR/tmp/b12809202_stderr.sql
--echo # --echo #
--echo # Delete all existing binary logs. --echo # Delete all existing binary logs.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment