mirror of
https://github.com/MariaDB/server.git
synced 2025-07-07 06:01:31 +03:00
Merge pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
into pilot.(none):/data/msvensson/mysql/mysql-5.1-new-maint mysql-test/suite/rpl/r/rpl_misc_functions.result: Auto merged mysql-test/suite/rpl/t/rpl_misc_functions.test: Merge 5.0->5.1 mysql-test/t/sp.test: Merge 5.0->5.1
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
-- require r/have_outfile.require
|
-- require r/have_outfile.require
|
||||||
disable_query_log;
|
disable_query_log;
|
||||||
select load_file(concat(@tmpdir,"/outfile.test"));
|
select load_file(concat(@tmpdir,"/outfile.test"));
|
||||||
--exec rm $MYSQLTEST_VARDIR/tmp/outfile.test
|
--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test
|
||||||
enable_query_log;
|
enable_query_log;
|
||||||
|
@ -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());
|
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;
|
select * from t1 into outfile "../tmp/t1_slave.txt";
|
||||||
DROP PROCEDURE IF EXISTS test_replication_sp2;
|
create temporary table t1_slave select * from t1 where 1=0;
|
||||||
DROP FUNCTION IF EXISTS test_replication_sf;
|
load data infile '../tmp/t1_slave.txt' into table t1_slave;
|
||||||
DROP TABLE IF EXISTS t1;
|
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;
|
||||||
|
@ -77,27 +77,37 @@ INSERT INTO t1 VALUES (test_replication_sf());
|
|||||||
INSERT INTO t1 VALUES (test_replication_sf());
|
INSERT INTO t1 VALUES (test_replication_sf());
|
||||||
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
|
--sync_slave_with_master
|
||||||
|
|
||||||
# Record the results of the query on the slave
|
# Dump table on slave
|
||||||
--exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
|
select * from t1 into outfile "../tmp/t1_slave.txt";
|
||||||
|
|
||||||
# Compare the results from the master to the slave.
|
# Load data from slave into temp table on master
|
||||||
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
|
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 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
|
# Cleanup
|
||||||
connection master;
|
connection master;
|
||||||
--disable_warnings
|
DROP PROCEDURE test_replication_sp1;
|
||||||
DROP PROCEDURE IF EXISTS test_replication_sp1;
|
DROP PROCEDURE test_replication_sp2;
|
||||||
DROP PROCEDURE IF EXISTS test_replication_sp2;
|
DROP FUNCTION test_replication_sf;
|
||||||
DROP FUNCTION IF EXISTS test_replication_sf;
|
DROP TABLE t1, t1_slave;
|
||||||
DROP TABLE IF EXISTS t1;
|
|
||||||
--enable_warnings
|
|
||||||
--sync_slave_with_master
|
--sync_slave_with_master
|
||||||
|
|
||||||
# If all is good, when can cleanup our dump files.
|
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql
|
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql
|
|
||||||
|
@ -706,9 +706,9 @@ begin
|
|||||||
insert into test.t1 values (concat(x, "2"), y+2);
|
insert into test.t1 values (concat(x, "2"), y+2);
|
||||||
end|
|
end|
|
||||||
|
|
||||||
# Remove spout file if it exists
|
# Check that file does not exists
|
||||||
--error 0,1
|
--error 1
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/spout
|
--file_exists $MYSQLTEST_VARDIR/tmp/spout
|
||||||
call into_outfile("ofile", 1)|
|
call into_outfile("ofile", 1)|
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/spout
|
--remove_file $MYSQLTEST_VARDIR/tmp/spout
|
||||||
delete from t1|
|
delete from t1|
|
||||||
@ -725,9 +725,9 @@ begin
|
|||||||
insert into test.t1 values (concat(x, "2"), y+2);
|
insert into test.t1 values (concat(x, "2"), y+2);
|
||||||
end|
|
end|
|
||||||
|
|
||||||
# Remove spdump file if it exists
|
# Check that file does not exists
|
||||||
--error 0,1
|
--error 1
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/spdump
|
--file_exists $MYSQLTEST_VARDIR/tmp/spdump
|
||||||
call into_dumpfile("dfile", 1)|
|
call into_dumpfile("dfile", 1)|
|
||||||
--remove_file $MYSQLTEST_VARDIR/tmp/spdump
|
--remove_file $MYSQLTEST_VARDIR/tmp/spdump
|
||||||
delete from t1|
|
delete from t1|
|
||||||
|
Reference in New Issue
Block a user