mirror of
https://github.com/MariaDB/server.git
synced 2025-11-13 21:42:58 +03:00
Manual merge fixes/tests for bugs_28960,27417,23333.
This commit is contained in:
@@ -380,7 +380,7 @@ select
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
|
||||
1 1
|
||||
drop table t1, t2;
|
||||
create table tt (a int unique);
|
||||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
@@ -399,18 +399,18 @@ count(*)
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 515
|
||||
show binlog events from 106;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (2)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti
|
||||
master-bin.000001 # Query 1 # use `test`; ROLLBACK
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values (2)
|
||||
master-bin.000001 # Query # # use `test`; insert into tt select * from ti
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
select count(*) from ti /* zero */;
|
||||
count(*)
|
||||
0
|
||||
insert into ti select * from tt;
|
||||
select * from ti /* that is what slave would miss - a bug */;
|
||||
select * from ti /* that is what slave would miss - bug#28960 */;
|
||||
a
|
||||
1
|
||||
2
|
||||
@@ -426,18 +426,11 @@ insert into ti values (2) /* to make the dup error in the following */;
|
||||
insert into tt select * from ti /* one affected and error */;
|
||||
ERROR 23000: Duplicate entry '2' for key 'a'
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 589
|
||||
show binlog events from 106;
|
||||
master-bin.000001 106
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query 1 # use `test`; BEGIN
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (1)
|
||||
master-bin.000001 # Query 1 # use `test`; insert into ti values (2) /* to make the dup error in the following */
|
||||
master-bin.000001 # Query 1 # use `test`; insert into tt select * from ti /* one affected and error */
|
||||
master-bin.000001 # Query 1 # use `test`; ROLLBACK
|
||||
select count(*) from ti /* zero */;
|
||||
count(*)
|
||||
0
|
||||
@@ -446,7 +439,7 @@ select * from tt /* that is what otherwise slave missed - the bug */;
|
||||
a
|
||||
1
|
||||
2
|
||||
drop table ti,tt;
|
||||
drop table ti;
|
||||
drop function if exists bug27417;
|
||||
drop table if exists t1,t2;
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
|
||||
@@ -463,6 +456,10 @@ insert into t2 select bug27417(2);
|
||||
reset master;
|
||||
insert into t2 values (bug27417(2));
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 222
|
||||
/* only (!) with fixes for #23333 will show there is the query */;
|
||||
select count(*) from t1 /* must be 3 */;
|
||||
count(*)
|
||||
3
|
||||
@@ -474,6 +471,10 @@ delete from t2 where a=bug27417(3);
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
count(*)
|
||||
2
|
||||
show master status;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 227
|
||||
/* the query must be in regardless of #23333 */;
|
||||
select count(*) from t1 /* must be 5 */;
|
||||
count(*)
|
||||
5
|
||||
@@ -482,6 +483,75 @@ affected rows: 0
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
count(*)
|
||||
7
|
||||
drop function bug27417;
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
||||
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
|
||||
insert into t2 values (1);
|
||||
reset master;
|
||||
insert into t2 values (bug27417(1));
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 293
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
insert into t2 values (2);
|
||||
reset master;
|
||||
insert into t2 select bug27417(1) union select bug27417(2);
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 332
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
delete from t1;
|
||||
insert into t3 values (1,1),(2,3),(3,4);
|
||||
reset master;
|
||||
update t3 set b=b+bug27417(1);
|
||||
ERROR 23000: Duplicate entry '4' for key 'b'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 305
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
delete from t3;
|
||||
insert into t2 values (1);
|
||||
insert into t3 values (1,1);
|
||||
create trigger trg_del before delete on t2 for each row
|
||||
insert into t3 values (bug27417(1), 2);
|
||||
reset master;
|
||||
delete from t2;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 335
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
count(*)
|
||||
1
|
||||
delete from t1;
|
||||
create table t4 (a int default 0, b int primary key) engine=innodb;
|
||||
insert into t4 values (0, 17);
|
||||
reset master;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
ERROR 23000: Duplicate entry '17' for key 'PRIMARY'
|
||||
select * from t4;
|
||||
a b
|
||||
0 17
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
count(*)
|
||||
2
|
||||
show master status /* the offset must denote there is the query */;
|
||||
File Position Binlog_Do_DB Binlog_Ignore_DB
|
||||
master-bin.000001 362
|
||||
drop trigger trg_del;
|
||||
drop table t1,t2,t3,t4;
|
||||
drop function bug27417;
|
||||
end of tests
|
||||
|
||||
@@ -36,7 +36,7 @@ drop table t1, t2;
|
||||
|
||||
# prepare
|
||||
|
||||
create table tt (a int unique);
|
||||
create temporary table tt (a int unique);
|
||||
create table ti (a int) engine=innodb;
|
||||
reset master;
|
||||
show master status;
|
||||
@@ -53,11 +53,10 @@ rollback;
|
||||
|
||||
select count(*) from tt /* 2 */;
|
||||
show master status;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
select * from ti /* that is what slave would miss - a bug */;
|
||||
select * from ti /* that is what slave would miss - bug#28960 */;
|
||||
|
||||
|
||||
## send_error() branch
|
||||
@@ -78,13 +77,12 @@ rollback;
|
||||
# check
|
||||
|
||||
show master status;
|
||||
--replace_column 2 # 5 #
|
||||
show binlog events from 106;
|
||||
source include/show_binlog_events.inc;
|
||||
select count(*) from ti /* zero */;
|
||||
insert into ti select * from tt;
|
||||
select * from tt /* that is what otherwise slave missed - the bug */;
|
||||
|
||||
drop table ti,tt;
|
||||
drop table ti;
|
||||
|
||||
|
||||
#
|
||||
@@ -123,16 +121,14 @@ reset master;
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug27417(2));
|
||||
#TODO: Andrei: enable this test after 23333 is pushed
|
||||
#show master status; /* only (!) with fixes for #23333 will show there is the query */;
|
||||
show master status; /* only (!) with fixes for #23333 will show there is the query */;
|
||||
select count(*) from t1 /* must be 3 */;
|
||||
|
||||
reset master;
|
||||
select count(*) from t2;
|
||||
delete from t2 where a=bug27417(3);
|
||||
select count(*) from t2 /* nothing got deleted */;
|
||||
#TODO: Andrei: enable this test after 23333 is pushed
|
||||
#show master status; /* the query must be in regardless of #23333 */;
|
||||
show master status; /* the query must be in regardless of #23333 */;
|
||||
select count(*) from t1 /* must be 5 */;
|
||||
|
||||
--enable_info
|
||||
@@ -140,7 +136,125 @@ delete t2 from t2 where t2.a=bug27417(100) /* must not affect t2 */;
|
||||
--disable_info
|
||||
select count(*) from t1 /* must be 7 */;
|
||||
|
||||
drop function bug27417;
|
||||
# function bug27417 remains for the following testing of bug#23333
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug#23333 using the patch (and the test) for bug#27471
|
||||
# throughout the bug tests
|
||||
# t1 - non-trans side effects gatherer;
|
||||
# t2 - transactional table;
|
||||
#
|
||||
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
|
||||
CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
|
||||
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
|
||||
|
||||
|
||||
#
|
||||
# INSERT
|
||||
#
|
||||
|
||||
# prepare
|
||||
|
||||
insert into t2 values (1);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 values (bug27417(1));
|
||||
|
||||
# check
|
||||
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
||||
#
|
||||
# INSERT SELECT
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
insert into t2 values (2);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
|
||||
--error ER_DUP_ENTRY
|
||||
insert into t2 select bug27417(1) union select bug27417(2);
|
||||
|
||||
# check
|
||||
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
|
||||
#
|
||||
# UPDATE (multi-update see bug#27716)
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
insert into t3 values (1,1),(2,3),(3,4);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
update t3 set b=b+bug27417(1);
|
||||
|
||||
# check
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
|
||||
|
||||
#
|
||||
# DELETE (for multi-delete see Bug #29136)
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
delete from t3;
|
||||
insert into t2 values (1);
|
||||
insert into t3 values (1,1);
|
||||
create trigger trg_del before delete on t2 for each row
|
||||
insert into t3 values (bug27417(1), 2);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
delete from t2;
|
||||
# check
|
||||
show master status /* the offset must denote there is the query */;
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
|
||||
|
||||
#
|
||||
# LOAD DATA
|
||||
#
|
||||
|
||||
# prepare
|
||||
delete from t1;
|
||||
create table t4 (a int default 0, b int primary key) engine=innodb;
|
||||
insert into t4 values (0, 17);
|
||||
reset master;
|
||||
|
||||
# execute
|
||||
--error ER_DUP_ENTRY
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2);
|
||||
# check
|
||||
select * from t4;
|
||||
select count(*) from t1 /* must be 2 */;
|
||||
show master status /* the offset must denote there is the query */;
|
||||
|
||||
#
|
||||
# bug#23333 cleanup
|
||||
#
|
||||
|
||||
|
||||
drop trigger trg_del;
|
||||
drop table t1,t2,t3,t4;
|
||||
drop function bug27417;
|
||||
|
||||
|
||||
--echo end of tests
|
||||
|
||||
Reference in New Issue
Block a user