Bug #43361 msyql_client_test output lost
Submitted: 4 Mar 2009 10:10 Modified: 25 Mar 2009 16:52
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[4 Mar 2009 10:10] Magnus Blåudd
Description:
mysql_client_test is a C program with 19219 lines(not couinting the 100k lines in MySQL C API it tests) and have a lot of test cases. We compile it and run from mysqltest with --exec and when it fails, the report(output) is lost.

We should improve this by making the output from mysql_client_test be output to screen when it fails so it's immediately possible to see where it failed.

How to repeat:
.

Suggested fix:
=== modified file 'client/mysqltest.cc'
--- client/mysqltest.cc	2009-02-11 11:12:08 +0000
+++ client/mysqltest.cc	2009-03-04 09:56:23 +0000
@@ -2708,10 +2708,9 @@ void do_exec(struct st_command *command)
 
     if (command->abort_on_error)
     {
-      log_msg("exec of '%s' failed, error: %d, status: %d, errno: %d",
-              ds_cmd.str, error, status, errno);
       dynstr_free(&ds_cmd);
-      die("command \"%s\" failed", command->first_argument);
+      die("command \"%s\" failed\n\nOutput from before failure:\n%s\n",
+          command->first_argument, ds_res.str);
     }
 
     DBUG_PRINT("info",

=== removed file 'mysql-test/r/mysql_client_test.result'
--- mysql-test/r/mysql_client_test.result	2008-11-13 19:19:00 +0000
+++ mysql-test/r/mysql_client_test.result	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
-SET @old_general_log= @@global.general_log;
-ok
-SET @@global.general_log= @old_general_log;

=== modified file 'mysql-test/t/mysql_client_test.test'
--- mysql-test/t/mysql_client_test.test	2008-11-13 19:19:00 +0000
+++ mysql-test/t/mysql_client_test.test	2009-03-04 10:07:18 +0000
@@ -10,10 +10,11 @@ SET @old_general_log= @@global.general_l
 # server or run mysql-test-run --debug mysql_client_test and check
 # var/log/mysql_client_test.trace
 
---exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1
 
-# End of 4.1 tests
-echo ok;
+let $CMD = $MYSQL_CLIENT_TEST --getopt-ll-test=25600M 2>&1;
+echo Running $CMD;
+--exec $CMD;
 
 SET @@global.general_log= @old_general_log;
+
+exit;
[13 Mar 2009 15:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/69162

2757 Magnus Svensson	2009-03-13
      Bug#43361 msyql_client_test output lost
       - Print the output(if any) from the command that failed, in many 
         cases this will make it possible to immediately see what went wrong.
      modified:
        client/mysqltest.cc
[16 Mar 2009 15:13] Bjørn Munch
Looks good, OK to push
[19 Mar 2009 9:54] Bugs System
Pushed into 5.1.32-ndb-7.0.5 (revid:msvensson@mysql.com-20090319095048-pdr8kwnzsyv3m26o) (version source revid:msvensson@mysql.com-20090319095048-pdr8kwnzsyv3m26o) (merge vers: 5.1.32-ndb-7.0.5) (pib:6)
[19 Mar 2009 12:52] Bugs System
Pushed into 5.1.34 (revid:alik@sun.com-20090319121953-frpl3uvd05v07sho) (version source revid:msvensson@mysql.com-20090319114255-myxxxiwika9qodju) (merge vers: 5.1.34) (pib:6)
[19 Mar 2009 12:55] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090319122149-fpfkb3vxi7gk3guh) (version source revid:msvensson@mysql.com-20090319113135-ryyjv3dn6sgkjoud) (merge vers: 6.0.11-alpha) (pib:6)
[19 Mar 2009 13:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/69800

2758 Magnus Svensson	2009-03-19
      Bug#43361 msyql_client_test output lost
       - Additional patch that discards the output from "exec false" to avoid
         that the new printout need to be recorded in .result file
         Unfortunately it also removes the printout that says the command has failed,
         but the test is only supposed to check that an exec that fails return 1 -> fine anyway.
[19 Mar 2009 14:31] Bugs System
Pushed into 5.1.32-ndb-7.0.5 (revid:msvensson@mysql.com-20090319140642-xk0h0436si2t67hl) (version source revid:msvensson@mysql.com-20090319140642-xk0h0436si2t67hl) (merge vers: 5.1.32-ndb-7.0.5) (pib:6)
[25 Mar 2009 16:52] Paul Dubois
Test suite change. No changelog entry needed.
[9 May 2009 16:46] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (merge vers: 5.1.34-ndb-6.2.18) (pib:6)
[9 May 2009 17:43] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (merge vers: 5.1.34-ndb-6.3.25) (pib:6)