List:Commits« Previous MessageNext Message »
From:Patrick Crews Date:March 11 2009 11:33pm
Subject:bzr commit into mysql-5.0-bugteam branch (patrick.crews:2774) Bug#41307
View as plain text  
#At file:///Users/pcrews/usr/local/bin/data1/work/ndb_grep/mysql-5.0-ndb_grep/ based on revid:joro@stripped

 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

    modified:
      mysql-test/include/ndb_backup.inc
=== modified file 'mysql-test/include/ndb_backup.inc'
--- a/mysql-test/include/ndb_backup.inc	2009-02-19 20:37:40 +0000
+++ b/mysql-test/include/ndb_backup.inc	2009-03-11 23:33:35 +0000
@@ -3,17 +3,29 @@
 # in test cases and can be reused.                   #
 ######################################################
 
-# Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to
-#            'grep' call
-# This test is disabled on Windows via the next line until the above bug is
-# resolved
---source include/not_windows.inc
-
 --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
 
-# there is no neat way to find the backupid, this is a hack to find it...
-
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
+# To find the backupid, we must dump this data to a table, and SELECT
+# what we want into an outfile.  This could be accomplished with grep, but
+# grep isn't Windows-portable
+
+--disable_query_log
+# create a table to help us out
+--disable_warnings # leave this on until done w/ the entire process
+# cleanup
+DROP TABLE IF EXISTS helper1;
+CREATE TABLE helper1(c1 varchar(20));
+# dump raw data to file
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 > $MYSQLTEST_VARDIR/ndb_backup_tmp.dat
+# load the table from the raw data file
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/ndb_backup_tmp.dat' INTO TABLE helper1;
+# output what we need
+eval SELECT * FROM helper1 WHERE c1 LIKE '%520093696%' INTO OUTFILE '$MYSQLTEST_VARDIR/tmp.dat';
+# cleanup
+DROP TABLE helper1;
+--remove_file $MYSQLTEST_VARDIR/ndb_backup_tmp.dat
+--enable_warnings
+--enable_query_log
 
 CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
 


Attachment: [text/bzr-bundle] bzr/patrick.crews@sun.com-20090311233335-6lt3gm2u3oapa6px.bundle
Thread
bzr commit into mysql-5.0-bugteam branch (patrick.crews:2774) Bug#41307Patrick Crews12 Mar