Bug #41307 Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call
Submitted: 8 Dec 2008 18:53 Modified: 8 Apr 2009 0:28
Reporter: Patrick Crews Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:5.0+ OS:Microsoft Windows
Assigned to: Patrick Crews CPU Architecture:Any
Tags: grep, ndb, test, windows
Triage: Triaged: D3 (Medium)

[8 Dec 2008 18:53] Patrick Crews
Description:
Tests that use include/ndb_backup.inc will not run on Windows without Cygwin or GNU utils due to its use of 'grep;

include/ndb_backup.inc:9:--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat

The two tests that use this are:
ndb_restore.test
ndb_restore_print.test

These tests will be disabled on Windows as part of my patch for:
Bug #38831	11 test cases fail on Windows due to missing commands

How to repeat:
Try to run either of the two above tests on Windows without Cygwin or GNU utilities and observe the test failure:

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

Suggested fix:
Alter the test so that we accomplish the same testing without needing to resort to Unix calls.
[11 Mar 2009 22:02] 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/68969

2774 Patrick Crews	2009-03-11
      Bug#41307:  Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call
      
      Removed the use of grep from this file.  Tests work as before on Unix, tests now works on Windows.
[11 Mar 2009 23:34] 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/68972

2774 Patrick Crews	2009-03-11
      Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call
      
      Removed the use of grep.  Test still performs as before, but now works on Windows w/o Cygwin.
      New patch to re-enable warnings at end of patched code
[12 Mar 2009 12:25] Matthias Leich
Results of the review:
The patch basically works in 5.0-bugteam except that
- ndb_restore_print fails on my box
- --check-testcases is unhappy
Some --remove_file ... are missing.

I will upload an archive 41307.tgz with a version of
these tests where these issues are fixed and the
formatting is improved.
Please correct the comment in ndb_backup.inc line 14.

Ok to push if the issues above are fixed.
[12 Mar 2009 12:26] Matthias Leich
improved scripts/results

Attachment: 41307.tgz (application/x-compressed-tar, text), 4.86 KiB.

[15 Mar 2009 16:25] 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/69252

2774 Patrick Crews	2009-03-15
      Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call.
      
      Revised patch incorporating cleaner test code brought up during review.
      Removed the use of grep and accomplished same actions via SQL / use of the server.
      
      Runs as before on *nix systems and now runs on Windows without Cygwin as well.
[16 Mar 2009 21: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/69360

2841 Patrick Crews	2009-03-16
      Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to 'grep' call.
      
      Re-recording of .result files for additional tests that use this include file.
[18 Mar 2009 13:19] Bugs System
Pushed into 6.0.11-alpha (revid:joro@sun.com-20090318122208-1b5kvg6zeb4hxwp9) (version source revid:joro@sun.com-20090317133112-41qn6aly7arljtlq) (merge vers: 6.0.11-alpha) (pib:6)
[27 Mar 2009 14:32] Bugs System
Pushed into 5.0.80 (revid:joro@sun.com-20090327142516-55gumdxj39z6eijj) (version source revid:leonard@mysql.com-20090324072904-7w2lxdxzw8hx1rnm) (merge vers: 5.0.80) (pib:6)
[27 Mar 2009 14:58] Bugs System
Pushed into 5.1.34 (revid:joro@sun.com-20090327143448-wuuuycetc562ty6o) (version source revid:leonard@mysql.com-20090316090622-sr8lylqvsl1jrcnv) (merge vers: 5.1.34) (pib:6)
[8 Apr 2009 0:28] 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-20090508185236-p9b3as7qyauybefl) (merge vers: 5.1.34-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-20090509063138-1u3q3v09wnn2txyt) (merge vers: 5.1.34-ndb-6.3.25) (pib:6)
[9 May 2009 18:35] Bugs System
Pushed into 5.1.34-ndb-7.0.6 (revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (version source revid:jonas@mysql.com-20090509154927-im9a7g846c6u1hzc) (merge vers: 5.1.34-ndb-7.0.6) (pib:6)