Bug #38831 11 test cases fail on Windows due to missing commands
Submitted: 16 Aug 2008 6:44 Modified: 18 Mar 2009 14:33
Reporter: Daniel Fischer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S7 (Test Cases)
Version:5.0+ OS:Any
Assigned to: Patrick Crews CPU Architecture:Any
Tags: pb2, test failure
Triage: Triaged: D3 (Medium)

[16 Aug 2008 6:44] Daniel Fischer
Description:
The MySQL 5.0 test cases connect, ctype_big5, grant, mysqlbinlog, mysqltest, openssl_1, outfile, rpl_EE_error, rpl_loaddatalocal, rpl_trigger and trigger-compat fail on Windows because they assume a UNIX environment:

connect [ fail ]

'"diff"' is not recognized as an internal or external command,
operable program or batch file.

ctype_big5 [ fail ]

'rm' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 82: command "rm $MYSQLTEST_VARDIR/master-data/test/t1.txt" failed

grant [ fail ]

'"diff"' is not recognized as an internal or external command,
operable program or batch file.

mysqlbinlog [ fail ]

'grep' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 229: command "$MYSQL_BINLOG --hexdump --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000011 | grep 'Query' | sed 's/[0-9]\{1,\}/REMOVED/g'" failed

mysqltest [ fail ]

'touch' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 1432: command "touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result" failed

openssl_1 [ fail ]

'"diff"' is not recognized as an internal or external command,
operable program or batch file.

outfile [ fail ]

'rm' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 128: command "rm $MYSQLTEST_VARDIR/tmp/outfile-test.4" failed

rpl_EE_error [ fail ]

'rm' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 11: system command 'rm $MYSQLTEST_VARDIR/master-data/test/t1.MYI ' failed

rpl_loaddatalocal [ fail ]

'rm' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 28: system command 'rm $MYSQLTEST_VARDIR/master-data/rpl_loaddatalocal.select_outfile ' failed

rpl_trigger [ fail ]

'cp' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 296: command "cp $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLTEST_VARDIR/log/master-bin.000001" failed

trigger-compat [ fail ]

'grep' is not recognized as an internal or external command,
operable program or batch file.
mysqltest: At line 64: command "grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG" failed

How to repeat:
Run the 5.0 test suite on Windows without Cygwin.

Suggested fix:
Use appropriate mysqltest commands where available and require not_windows elsewhere.
[16 Aug 2008 6:54] Valeriy Kravchuk
Thank you for a problem report.
[15 Sep 2008 21:36] Patrick Crews
The test files listing 'diff' as the cause for failure do not contain calls to diff.

mysqltest / mysql-test-run apparently use diff for reporting the difference between expected and actual results.
[8 Oct 2008 22:44] Patrick Crews
Removed the use of 'rm' from the test suite (5.0 on up) as a fix for Bug #38311	Some tests use 'rm', which is not portable
[12 Oct 2008 20:18] Miguel Solorzano
See bug: http://bugs.mysql.com/bug.php?id=39465 probably related.
[8 Dec 2008 22:03] 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/60987

2736 Patrick Crews	2008-12-08
      Bug#38831:  11 test cases fail on Windows due to missing commands
      
      Removed Unix calls or disabled the tests on Windows via include/not_windows.inc for
      those tests using grep and sed calls that will take longer to resolve.
[5 Jan 2009 17:55] Matthias Leich
The fix is mostly ok.
1. mysql-test/t/rpl_trigger.test
   line 296
   --remove_file $MYSQLTEST_VARDIR/log/master-bin.000001
   I think there should be a preceding "--error 0,1".
2. If there is enough time left over please
   replace error numbers with error names if this fits to
   the affected command or subtest.
grep -ine "-- *error" mysql-test/include/ndb_backup.inc mysql-test/t/mysqlbinlog.test mysql-test/t/mysqltest.test mysql-test/t/ndb_autodiscover.test mysql-test/t/rpl_trigger.test mysql-test/t/trigger-compat.test 
.....
3. You mention within your patch ... "that will take longer to resolve".
   This means that some modifications are only temporary fixes.
   Please take care that "temporary" does not become "permanent".
   a) merge + push and let the current bug stay in state "in progress"
   or
   b) merge + push and set the current bug to "patch queued" but
      report new bugs for all tests where a replacement of sed/grep/
      ... by SQL and/or mysqltest builtin commands could be done.
4. Please ensure that your modifications are not the reason
   for the failures I got on my actual 5.0 bugteam tree (Linux).
   ./mysql-test-run.pl --mem --force mysqlbinlog mysqltest ndb_autodiscover rpl_trigger trigger-compat
    ...
    rpl_trigger                    [ fail ]

--- /work2/5.0/mysql-5.0-work/mysql-test/r/rpl_trigger.result   2008-09-16 13:19:47.000000000 +0300
+++ /work2/5.0/mysql-5.0-work/mysql-test/r/rpl_trigger.reject   2009-01-05 20:34:24.000000000 +0300
@@ -97,6 +97,8 @@
 WHERE trigger_name = 't1_first';
 trigger_name   definer
 t1_first       root@localhost
+Warnings:
+Warning        1033    Incorrect information in file: './test/t10.frm'

 --- On slave --
 SELECT routine_name, definer
@@ -897,6 +899,8 @@
 Tables_in_test (t_)
 SHOW TRIGGERS;
 Trigger        Event   Table   Statement       Timing  Created sql_mode        Definer
+Warnings:
+Warning        1033    Incorrect information in file: './test/t10.frm'
 RESET MASTER;
 START SLAVE;

mysqltest: Result content mismatch

Stopping All Servers
skipped 9 bytes from file: socket (5)
Restoring snapshot of databases
Resuming Tests

trigger-compat                 [ fail ]

mysqltest: At line 72: command "remove_file" failed with error 1

mysql-test-run in default mode: *** Failing the test(s): rpl_trigger trigger-compat

bzr revert

./mysql-test-run.pl --mem --force mysqlbinlog mysqltest ndb_autodiscover rpl_trigger trigger-compat
...
TEST                           RESULT         TIME (ms)
-------------------------------------------------------

mysqlbinlog                    [ pass ]            537
skipped 9 bytes from file: socket (5)
mysqltest                      [ pass ]          26461
ndb_autodiscover               [ pass ]          65783
skipped 9 bytes from file: socket (5)
skipped 9 bytes from file: socket (5)
rpl_trigger                    [ fail ]

--- /work2/5.0/mysql-5.0-work/mysql-test/r/rpl_trigger.result   2008-09-16 13:19:47.000000000 +0300
+++ /work2/5.0/mysql-5.0-work/mysql-test/r/rpl_trigger.reject   2009-01-05 20:50:19.000000000 +0300
@@ -97,6 +97,8 @@
 WHERE trigger_name = 't1_first';
 trigger_name   definer
 t1_first       root@localhost
+Warnings:
+Warning        1033    Incorrect information in file: './test/t10.frm'

 --- On slave --
 SELECT routine_name, definer
@@ -897,6 +899,8 @@
 Tables_in_test (t_)
 SHOW TRIGGERS;
 Trigger        Event   Table   Statement       Timing  Created sql_mode        Definer
+Warnings:
+Warning        1033    Incorrect information in file: './test/t10.frm'
 RESET MASTER;
 START SLAVE;

mysqltest: Result content mismatch

Stopping All Servers
skipped 9 bytes from file: socket (5)
skipped 9 bytes from file: socket (5)
Restoring snapshot of databases
Resuming Tests

trigger-compat                 [ pass ]             80
-------------------------------------------------------
Stopping All Servers
skipped 9 bytes from file: socket (5)
Failed 1/5 tests, 80.00% were successful.

The log files in var/log may give you some hint
of what went wrong.
If you want to report this error, please read first the documentation at
http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
The servers were restarted 5 times
Spent 92.861 of 147 seconds executing testcases

mysql-test-run in default mode: *** Failing the test(s): rpl_trigger
...
   

Regards,

Matthias
[20 Jan 2009 3:51] 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/63586

2733 Patrick Crews	2009-01-19
      Bug#38831: 11 test cases fail on Windows due to missing commands
      
      Removed Unix command usage where possible.  Disabled (w/new bugs) two test cases that will take more time
      to implement without using Unix commands.
      
      Incorporated review feedback and replaced error codes with error names
[2 Feb 2009 0:13] 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/64806

2735 Patrick Crews	2009-02-01
      Bug#38831: 11 test cases fail on Windows due to missing commands
      
      Replaced Unix calls with mysql-test-run language functions where applicable.
      Disabled two tests on Windows due to more complex Unix command usage
      See Bug#41307, Bug#41308
      
      Incorporated review feedback - replacing error numbers with names, etc.
[19 Feb 2009 20:37] 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/66966

2752 Patrick Crews	2009-02-19
      Bug#38831: 11 test cases fail on Windows due to missing commands
      
      Replaced Unix calls with mysql-test-run's built-in functions / SQL manipulation where possible.
      Replaced error codes with error names as well.
      Disabled two tests on Windows due to more complex Unix command usage
      See Bug#41307, Bug#41308
[19 Feb 2009 21:35] 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/66974

2753 Patrick Crews	2009-02-19
      Bug#38831:  11 test cases fail on Windows due to missing commands
      
      Re-enabling mysqlbinlog.test on Windows - removed the use of grep/sed
[20 Feb 2009 14:26] Patrick Crews
Pushed fixes for the 5.0 Unix-isms through 6.0.

Will be removing additional 5.1 and 6.0 Unix calls in separate changesets.
[26 Feb 2009 9:33] Patrick Crews
Closing out this bug / moving to patch pending after discussion with colleagues.

Will be opening new bugs for 5.1 / 6.0 as Unix calls are detected.
[9 Mar 2009 14:12] Bugs System
Pushed into 5.0.79 (revid:joro@sun.com-20090309135922-a0di9ebkxoj4d4wv) (version source revid:aelkin@mysql.com-20090224143545-7xc77386o8mg623c) (merge vers: 5.0.79) (pib:6)
[13 Mar 2009 19:04] Bugs System
Pushed into 5.1.33 (revid:joro@sun.com-20090313111355-7bsi1hgkvrg8pdds) (version source revid:azundris@mysql.com-20090224070618-mr7stu6rfcvoj18g) (merge vers: 5.1.33) (pib:6)
[14 Mar 2009 23:57] Paul Dubois
Test case changes. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[18 Mar 2009 13:20] Bugs System
Pushed into 6.0.11-alpha (revid:joro@sun.com-20090318122208-1b5kvg6zeb4hxwp9) (version source revid:azundris@mysql.com-20090223123708-n9rf2to3g15br7za) (merge vers: 6.0.10-alpha) (pib:6)
[18 Mar 2009 14:33] Paul Dubois
Test case changes. No changelog entry needed.
[9 May 2009 16:41] Bugs System
Pushed into 5.1.34-ndb-6.2.18 (revid:jonas@mysql.com-20090508185236-p9b3as7qyauybefl) (version source revid:jonas@mysql.com-20090508100057-30ote4xggi4nq14v) (merge vers: 5.1.33-ndb-6.2.18) (pib:6)
[9 May 2009 17:38] Bugs System
Pushed into 5.1.34-ndb-6.3.25 (revid:jonas@mysql.com-20090509063138-1u3q3v09wnn2txyt) (version source revid:jonas@mysql.com-20090508175813-s6yele2z3oh6o99z) (merge vers: 5.1.33-ndb-6.3.25) (pib:6)
[9 May 2009 18:36] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509073226-09bljakh9eppogec) (merge vers: 5.1.33-ndb-7.0.6) (pib:6)