#At file:///home/bm136801/my/difffil-51/ based on revid:bjorn.munch@stripped
2819 Bjorn Munch 2009-08-19
Bug #39003 mtr's diff_files command failed in pushbuild without printing a result diff
diff was actually called but result never outputted before exiting
Added extra code to dump output *unless* failure was expected
modified:
client/mysqltest.cc
mysql-test/t/mysqltest.test
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2009-08-11 21:41:44 +0000
+++ b/client/mysqltest.cc 2009-08-19 11:48:56 +0000
@@ -3440,12 +3440,17 @@ void do_diff_files(struct st_command *co
die("command \"diff_files\" failed, file '%s' does not exist",
ds_filename2.str);
- if ((error= compare_files(ds_filename.str, ds_filename2.str)))
+ if ((error= compare_files(ds_filename.str, ds_filename2.str)) &&
+ match_expected_error(command, error, NULL) < 0)
{
/* Compare of the two files failed, append them to output
- so the failure can be analyzed
+ so the failure can be analyzed, but only if it was not
+ expected to fail.
*/
show_diff(&ds_res, ds_filename.str, ds_filename2.str);
+ log_file.write(&ds_res);
+ log_file.flush();
+ dynstr_set(&ds_res, 0);
}
dynstr_free(&ds_filename);
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2009-05-27 20:54:40 +0000
+++ b/mysql-test/t/mysqltest.test 2009-08-19 11:48:56 +0000
@@ -1710,10 +1710,6 @@ EOF
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
--diff_files $MYSQLTEST_VARDIR/tmp/diff2.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
-# Write the below commands to a intermediary file and execute them with
-# mysqltest in --exec, since the output will vary depending on what "diff"
-# is available it is sent to /dev/null
---write_file $MYSQLTEST_VARDIR/tmp/diff.test
# Compare files that differ in size
--error 2
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff3.tmp
@@ -1725,13 +1721,6 @@ EOF
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp
--error 1
--diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
-exit;
-EOF
-
-# Execute the above diffs, and send their output to /dev/null - only
-# interesting to see that it returns correct error codes
---exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/diff.test > /dev/null 2>&1
-
# Compare equal files, again...
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff2.tmp
@@ -1740,7 +1729,6 @@ EOF
--remove_file $MYSQLTEST_VARDIR/tmp/diff2.tmp
--remove_file $MYSQLTEST_VARDIR/tmp/diff3.tmp
--remove_file $MYSQLTEST_VARDIR/tmp/diff4.tmp
---remove_file $MYSQLTEST_VARDIR/tmp/diff.test
# ----------------------------------------------------------------------------
Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20090819114856-vhqf0peruisse3om.bundle
Thread |
---|
• bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2819) Bug#39003 | Bjorn Munch | 19 Aug |