Bug #28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
Submitted: 10 May 2007 15:36 Modified: 10 Jul 2007 21:34
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.1.18 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[10 May 2007 15:36] Joerg Bruehe
Description:
The test failure just gives this output:

=====
rpl_misc_functions             [ fail ]

Errors are (from /PATH/mysqltest-time) :
mysqltest: At line 89: command "diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql" failed
(the last lines may be the most important ones)
Result from queries before failure can be found in /PATH/mysql-test/var/log/rpl_misc_functions.log
=====

This "diff" is intended to verify test correctness, but its output is lost -
all I get is the info "failed" which means it had a non-zero exit code.
So I know there was some difference, but do not get its text.

The difference may be harmless, but I cannot verify that.

Happened on our RHAS 3 / x86 host, in both the tar.gz and RPM build, in different runs.

How to repeat:
Found by running the test suite.
[21 May 2007 13:01] 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/27066

ChangeSet@1.2578, 2007-05-21 14:58:13+02:00, mleich@three.local.lan +2 -0
  Changeset for 
     Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
  Attention: This Changeset tries to make the test more robust and to give earlier and 
             more detailed informations when something goes wrong.
             The reason why the test failed in history in some runs remains unknown.
[21 May 2007 13:07] Matthias Leich
Hi Magnus,
my changeset is a side effect of some discussion with Horst
and Trudy during our meeting in Berlin.
The bug is assigned to you, but I do want that my ideas
to solve the problems are simply lost.
Please do whatever you want with this Changeset.
[23 Jun 2007 18:28] Sergei Golubchik
I don't see why we need to complicate mysqltest program even more by adding new commands to support lousy tests. There're a couple of tests that use diff - they shouldn't, the output should simply go to result file, it'll be diff'ed normally, at the end of the test.
[27 Jun 2007 11:01] Matthias Leich
Hi Magnus,
for me the question is:
Must the fix for this bug depend on the availibility of
a "highend" diff built into mysqltest or not ?
If the fix of this test is urgent than we should probably
go with the changeset proposed by me.
- it removes exec's which were at least in history
  error prone
- it performs a portable diff though not presenting
  any difference in common diff style
- It presents at least the complete content of the files
  if they differ. And there is not so much content.
I guess this should be sufficient.
[27 Jun 2007 13:06] Magnus Blåudd
This is a generic problem not only related to "rpl_misc_functions". As it is now, we have two "lowend" diff functions in mysqltest. The normal "compare of output against result file"  and the "diff_files" command.

Probably adding "diff" to our source repo is too much, we should be able to rely on systems builtin diff.

In that case I would like to suggest to write a "mydiff" tool that bridges the difference between different systems "diff". It should use the best flags on the system i.e favors "diff -u" and prompt's user to download diffutils or cygwin diff if they want to see the real diff and a "diff" can't be found.
[27 Jun 2007 16:23] 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/29744

ChangeSet@1.2487, 2007-06-27 18:22:55+02:00, msvensson@pilot.(none) +2 -0
  Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
   - Use SQL for diffing master and slave
[29 Jun 2007 8:26] 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/29932

ChangeSet@1.2487, 2007-06-29 10:26:20+02:00, msvensson@pilot.(none) +2 -0
  Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
   - Use SQL for diffing master and slave
[29 Jun 2007 11:57] Matthias Leich
Sent review for the last changeset via email.
From my point of view the test is now ok.
[29 Jun 2007 12:56] 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/29949

ChangeSet@1.2508, 2007-06-29 14:56:30+02:00, msvensson@pilot.(none) +2 -0
  Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
   - Add primary key to make rand comparison failsafe
[4 Jul 2007 1:48] Timothy Smith
See bug #29537, which I just opened to handle this newly-found problem with DROP PROCEDURE; DROP TABLE ...; & replication.

For now, I will submit a workaround for the rpl_misc_functions test failure, which is simply to move the DROP TABLE command before the DROP PROCEDURE command.
[10 Jul 2007 13:27] Bugs System
Pushed into 5.1.21-beta
[10 Jul 2007 13:28] Bugs System
Pushed into 5.0.46
[10 Jul 2007 21:34] Paul DuBois
No changelog entry needed for this bug report.