Bug #67737 mysqldump test sometimes fails due to mixing stdout and stderr

Submitted: 28 Nov 2012 5:14 Modified: 7 Dec 2012 19:19
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.5, 5.0.97, 5.1.67, 5.5.30, 5.7.1 OS:Any
Assigned to: CPU Architecture:Any

[28 Nov 2012 5:14] Stewart Smith
Description:
The mysqldump test case can sometimes fail.

This is because of this line in mysqldump.test:
"---exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>&1"

It mixes stderr output (from --verbose) with the sql dump output that goes to stdout. Since stdout is buffered and stderr is not, this is non-deterministic.

You sometimes end up with a test failure like this:
@@ -5122,8 +5122,6 @@
 -- main : logs flushed successfully!
 -- Starting transaction...
 -- Retrieving table structure for table t1...
--- Sending SELECT query...
--- Retrieving rows...
 --
 -- Host: localhost Database: b12809202_db
 -- ------------------------------------------------------
@@ -5148,7 +5146,9 @@
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `t1` (
   `c1` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+) ENGINE=MyIS-- Sending SELECT query...
+-- Retrieving rows...
+AM DEFAULT CHARSET=latin1;
 /*!40101 SET character_set_client = @saved_cs_client */;

Which is pretty obvious what's going on.

How to repeat:
We've found it most reliable to fail on CentOS 5 64bit

Suggested fix:
Simply discard the stdout output, the test is testing that the verbose messages are called correctly, so simply adding a destination file to mysqldump that is then discarded is sufficient.
[28 Nov 2012 20:41] Sveta Smirnova
Thank you for the report.

Verified as described using code analysis. Actually there are other tests, affected by this issue.
[7 Dec 2012 19:19] Paul DuBois
Changes for test suite. No changelog entry needed.
[26 Feb 2013 6:24] Laurynas Biveinis
The 5.5 fix revision is

5.5$ bzr log -r 4102
------------------------------------------------------------
revno: 4102
committer: Akhila Maddukuri<akhila.x.maddukuri@oracle.com>
branch nick: 5.5-15930494
timestamp: Fri 2012-12-07 18:26:02 +0530
message:
   Bug #15930494 	MYSQLDUMP TEST SOMETIMES FAILS DUE TO MIXING STDOUT AND
  STDERR
  
        Fix: Added a destination file to mysqldump.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.067 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.