List:Commits« Previous MessageNext Message »
From:msvensson Date:June 29 2007 8:26am
Subject:bk commit into 5.0 tree (msvensson:1.2487) BUG#28356
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 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

  mysql-test/r/rpl_misc_functions.result@stripped, 2007-06-29 10:26:19+02:00, msvensson@pilot.(none) +12 -4
    Dump t1 on slave and load it back into temporary table on master
    to allow comapre with SQL

  mysql-test/t/rpl_misc_functions.test@stripped, 2007-06-29 10:26:19+02:00, msvensson@pilot.(none) +26 -16
    Dump t1 on slave and load it back into temporary table on master
    to allow comapre with SQL

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	pilot.(none)
# Root:	/data/msvensson/mysql/bug28356/my50-bug28356

--- 1.5/mysql-test/r/rpl_misc_functions.result	2007-03-09 18:18:25 +01:00
+++ 1.6/mysql-test/r/rpl_misc_functions.result	2007-06-29 10:26:19 +02:00
@@ -40,7 +40,15 @@ CALL test_replication_sp2();
 INSERT INTO t1 VALUES (test_replication_sf());
 INSERT INTO t1 VALUES (test_replication_sf());
 INSERT INTO t1 VALUES (test_replication_sf());
-DROP PROCEDURE IF EXISTS test_replication_sp1;
-DROP PROCEDURE IF EXISTS test_replication_sp2;
-DROP FUNCTION IF EXISTS test_replication_sf;
-DROP TABLE IF EXISTS t1;
+select * from t1 into outfile "../tmp/t1_slave.txt";
+create temporary table t1_slave select * from t1 where 1=0;
+load data infile '../tmp/t1_slave.txt' into table t1_slave;
+select count(*) into @aux from t1, t1_slave
+where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ;
+SELECT @aux;
+@aux
+12
+DROP PROCEDURE test_replication_sp1;
+DROP PROCEDURE test_replication_sp2;
+DROP FUNCTION test_replication_sf;
+DROP TABLE t1, t1_slave;

--- 1.7/mysql-test/t/rpl_misc_functions.test	2007-03-22 15:07:29 +01:00
+++ 1.8/mysql-test/t/rpl_misc_functions.test	2007-06-29 10:26:19 +02:00
@@ -77,27 +77,37 @@ INSERT INTO t1 VALUES (test_replication_
 INSERT INTO t1 VALUES (test_replication_sf());
 INSERT INTO t1 VALUES (test_replication_sf());
 
-# Record the results of the query on the master
---exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
-
 --sync_slave_with_master
 
-# Record the results of the query on the slave
---exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+# Dump table on slave
+select * from t1 into outfile "../tmp/t1_slave.txt";
+
+# Load data from slave into temp table on master
+connection master;
+create temporary table t1_slave select * from t1 where 1=0;
+load data infile '../tmp/t1_slave.txt' into table t1_slave;
+--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt
 
-# Compare the results from the master to the slave.
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+# Compare master and slave temp table, use subtraction
+# for floating point comparison of "double"
+select count(*) into @aux from t1, t1_slave
+where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ;
+SELECT @aux;
+if (`SELECT @aux <> 12 OR @aux IS NULL`)
+{
+   --echo # ERROR: We expected to get count(*) = 12.
+   SELECT col_a FROM t1;
+   SELECT col_a FROM t1_slave;
+   --echo # abort
+   exit;
+}
 
 # Cleanup
 connection master;
---disable_warnings
-DROP PROCEDURE IF EXISTS test_replication_sp1;
-DROP PROCEDURE IF EXISTS test_replication_sp2;
-DROP FUNCTION IF EXISTS test_replication_sf;
-DROP TABLE IF EXISTS t1;
---enable_warnings
+DROP PROCEDURE test_replication_sp1;
+DROP PROCEDURE test_replication_sp2;
+DROP FUNCTION test_replication_sf;
+DROP TABLE t1, t1_slave;
 --sync_slave_with_master
 
-# If all is good, when can cleanup our dump files.
---system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
---system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
+
Thread
bk commit into 5.0 tree (msvensson:1.2487) BUG#28356msvensson29 Jun