Commit 3320a4bf authored by Sergei Golubchik's avatar Sergei Golubchik

per-combination result files

parent 9c8c572f
......@@ -9,8 +9,6 @@ CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
--enable_warnings
select @@global.binlog_format;
#
# BUG#25507 "multi-row insert delayed + auto increment causes
# duplicate key entries on slave";
......@@ -145,7 +143,7 @@ select * from t1;
connection master;
drop table t1;
sync_slave_with_master;
if (`SELECT @@global.binlog_format != 'ROW'`)
if (`SELECT @@global.binlog_format = 'STATEMENT'`)
{
#flush the logs after the test
FLUSH LOGS;
......
......@@ -616,20 +616,6 @@ sub collect_one_test_case {
suite => $suites{$suitename},
);
my $result_file= "$resdir/$tname.result";
if (-f $result_file) {
# Allow nonexistsing result file
# in that case .test must issue "exit" otherwise test
# should fail by default
$tinfo->{result_file}= $result_file;
}
else {
# No .result file exist
# Remember the path where it should be
# saved in case of --record
$tinfo->{record_file}= $result_file;
}
# ----------------------------------------------------------------------
# Skip some tests but include in list, just mark them as skipped
# ----------------------------------------------------------------------
......@@ -871,6 +857,36 @@ sub collect_one_test_case {
{
@cases = map make_combinations($_, @{$comb}), @cases;
}
for $tinfo (@cases) {
if ($tinfo->{combinations}) {
my $re = '(?:' . join('|', @{$tinfo->{combinations}}) . ')';
my $found = 0;
for (<$resdir/$tname,*.result>) {
m|$tname((?:,$re)+)\.result$| or next;
my $combs = $&;
my @commas = ($combs =~ m/,/g);
# prefer the most specific result file
if (@commas > $found) {
$found = @commas;
$tinfo->{result_file} = $_;
}
}
}
unless (defined $tinfo->{result_file}) {
my $result_file= "$resdir/$tname.result";
if (-f $result_file) {
$tinfo->{result_file}= $result_file;
} else {
# No .result file exist
# Remember the path where it should be
# saved in case of --record
$tinfo->{record_file}= $result_file;
}
}
}
return @cases;
}
......
......@@ -2,9 +2,6 @@ include/master-slave.inc
[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@global.binlog_format
STATEMENT
CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
FLUSH TABLE t1;
SELECT COUNT(*) FROM t1;
......
......@@ -2,9 +2,6 @@ include/master-slave.inc
[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@global.binlog_format
ROW
CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
FLUSH TABLE t1;
SELECT COUNT(*) FROM t1;
......
include/master-slave.inc
[connection master]
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
select @@global.binlog_format;
@@global.binlog_format
MIXED
CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
FLUSH TABLE t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
use mysqlslap;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
truncate table t1;
insert delayed into t1 values(10, "my name");
flush table t1;
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
flush table t1;
select * from t1;
id name
10 my name
20 James Bond
select * from t1;
id name
10 my name
20 James Bond
delete from t1 where id!=10;
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
flush table t1;
select * from t1;
id name
10 my name
20 is Bond
select * from t1;
id name
10 my name
20 is Bond
USE test;
DROP SCHEMA mysqlslap;
use test;
CREATE TABLE t1(a int, UNIQUE(a));
INSERT DELAYED IGNORE INTO t1 VALUES(1);
INSERT DELAYED IGNORE INTO t1 VALUES(1);
flush table t1;
select * from t1;
a
1
On slave
select * from t1;
a
1
drop table t1;
FLUSH LOGS;
FLUSH LOGS;
End of 5.0 tests
include/rpl_end.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
--source include/master-slave.inc
--source extra/rpl_tests/rpl_insert_delayed.test
--source include/rpl_end.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
--source extra/rpl_tests/rpl_insert_delayed.test
--source include/rpl_end.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc
--source include/not_embedded.inc
--source include/not_windows.inc
disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
--source extra/rpl_tests/rpl_insert_delayed.test
--source include/rpl_end.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment