Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
8f7550ec
Commit
8f7550ec
authored
Oct 13, 2007
by
aelkin/elkin@koti.dsl.inet.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manual merge for bug_29136, bug#29309.
parent
a7b1a823
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
278 additions
and
76 deletions
+278
-76
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
...st/extra/binlog_tests/mix_innodb_myisam_side_effects.test
+69
-5
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+15
-2
mysql-test/r/multi_update.result
mysql-test/r/multi_update.result
+21
-2
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
...l-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+53
-6
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
...l-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+53
-6
mysql-test/suite/manual/r/rpl_replication_delay.result
mysql-test/suite/manual/r/rpl_replication_delay.result
+23
-8
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+0
-39
mysql-test/t/multi_update.test
mysql-test/t/multi_update.test
+6
-2
sql/log_event.cc
sql/log_event.cc
+26
-2
sql/rpl_rli.cc
sql/rpl_rli.cc
+9
-1
sql/sql_delete.cc
sql/sql_delete.cc
+3
-3
No files found.
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test
View file @
8f7550ec
...
@@ -126,7 +126,9 @@ drop table t1,t2;
...
@@ -126,7 +126,9 @@ drop table t1,t2;
#
#
CREATE
TABLE
t1
(
a
int
NOT
NULL
auto_increment
primary
key
)
ENGINE
=
MyISAM
;
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
t2
(
a
int
,
PRIMARY
KEY
(
a
))
ENGINE
=
InnoDB
;
CREATE
TABLE
t3
(
a
int
,
PRIMARY
KEY
(
a
),
b
int
unique
);
CREATE
TABLE
t3
(
a
int
,
PRIMARY
KEY
(
a
),
b
int
unique
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t4
(
a
int
,
PRIMARY
KEY
(
a
),
b
int
unique
)
ENGINE
=
Innodb
;
CREATE
TABLE
t5
(
a
int
,
PRIMARY
KEY
(
a
))
ENGINE
=
InnoDB
;
#
#
...
@@ -169,7 +171,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
...
@@ -169,7 +171,7 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
select
count
(
*
)
from
t1
/* must be 2 */
;
select
count
(
*
)
from
t1
/* must be 2 */
;
#
#
# UPDATE
(multi-update see bug#27716)
# UPDATE
inc multi-update
#
#
# prepare
# prepare
...
@@ -185,9 +187,48 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
...
@@ -185,9 +187,48 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
source
include
/
show_binlog_events
.
inc
;
# must be events of the query
source
include
/
show_binlog_events
.
inc
;
# must be events of the query
select
count
(
*
)
from
t1
/* must be 2 */
;
select
count
(
*
)
from
t1
/* must be 2 */
;
## multi_update::send_eof() branch
# prepare
delete
from
t3
;
delete
from
t4
;
insert
into
t3
values
(
1
,
1
);
insert
into
t4
values
(
1
,
1
),(
2
,
2
);
reset
master
;
# execute
--
error
ER_DUP_ENTRY
UPDATE
t4
,
t3
SET
t4
.
a
=
t3
.
a
+
bug27417
(
1
)
/* top level non-ta table */
;
# check
source
include
/
show_binlog_events
.
inc
;
# the offset must denote there is the query
select
count
(
*
)
from
t1
/* must be 4 */
;
## send_error() branch of multi_update
# prepare
delete
from
t1
;
delete
from
t3
;
delete
from
t4
;
insert
into
t3
values
(
1
,
1
),(
2
,
2
);
insert
into
t4
values
(
1
,
1
),(
2
,
2
);
reset
master
;
# execute
--
error
ER_DUP_ENTRY
UPDATE
t3
,
t4
SET
t3
.
a
=
t4
.
a
+
bug27417
(
1
);
# check
select
count
(
*
)
from
t1
/* must be 1 */
;
# cleanup
drop
table
t4
;
#
#
# DELETE
(for multi-delete see Bug #29136)
# DELETE
incl multi-delete
#
#
# prepare
# prepare
...
@@ -203,6 +244,27 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
...
@@ -203,6 +244,27 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
# execute
# execute
--
error
ER_DUP_ENTRY
--
error
ER_DUP_ENTRY
delete
from
t2
;
delete
from
t2
;
# check
source
include
/
show_binlog_events
.
inc
;
# the offset must denote there is the query
select
count
(
*
)
from
t1
/* must be 1 */
;
# cleanup
drop
trigger
trg_del
;
# prepare
delete
from
t1
;
delete
from
t2
;
delete
from
t5
;
create
trigger
trg_del_t2
after
delete
on
t2
for
each
row
insert
into
t1
values
(
1
);
insert
into
t2
values
(
2
),(
3
);
insert
into
t5
values
(
1
),(
2
);
reset
master
;
# execute
--
error
ER_DUP_ENTRY
delete
t2
.*
from
t2
,
t5
where
t2
.
a
=
t5
.
a
+
1
;
# check
# check
source
include
/
show_binlog_events
.
inc
;
# must be events of the query
source
include
/
show_binlog_events
.
inc
;
# must be events of the query
select
count
(
*
)
from
t1
/* must be 1 */
;
select
count
(
*
)
from
t1
/* must be 1 */
;
...
@@ -229,6 +291,8 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
...
@@ -229,6 +291,8 @@ CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
#
#
# bug#23333 cleanup
# bug#23333 cleanup
#
#
drop
trigger
trg_del
;
drop
table
t1
,
t2
,
t3
,
t4
;
drop
trigger
trg_del_t2
;
drop
table
t1
,
t2
,
t3
,
t4
,
t5
;
drop
function
bug27417
;
drop
function
bug27417
;
mysql-test/r/innodb.result
View file @
8f7550ec
...
@@ -1086,6 +1086,19 @@ n d
...
@@ -1086,6 +1086,19 @@ n d
1 30
1 30
2 20
2 20
drop table t1,t2;
drop table t1,t2;
drop table if exists t1, t2;
CREATE TABLE t1 (a int, PRIMARY KEY (a));
CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
create trigger trg_del_t2 after delete on t2 for each row
insert into t1 values (1);
insert into t1 values (1);
insert into t2 values (1),(2);
delete t2 from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
count(*)
2
drop table t1, t2;
create table t1 (a int, b int) engine=innodb;
create table t1 (a int, b int) engine=innodb;
insert into t1 values(20,null);
insert into t1 values(20,null);
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
...
@@ -1751,10 +1764,10 @@ Variable_name Value
...
@@ -1751,10 +1764,10 @@ Variable_name Value
Innodb_page_size 16384
Innodb_page_size 16384
show status like "Innodb_rows_deleted";
show status like "Innodb_rows_deleted";
Variable_name Value
Variable_name Value
Innodb_rows_deleted 7
0
Innodb_rows_deleted 7
1
show status like "Innodb_rows_inserted";
show status like "Innodb_rows_inserted";
Variable_name Value
Variable_name Value
Innodb_rows_inserted 108
3
Innodb_rows_inserted 108
5
show status like "Innodb_rows_updated";
show status like "Innodb_rows_updated";
Variable_name Value
Variable_name Value
Innodb_rows_updated 886
Innodb_rows_updated 886
...
...
mysql-test/r/multi_update.result
View file @
8f7550ec
...
@@ -614,6 +614,7 @@ CREATE TABLE `t2` (
...
@@ -614,6 +614,7 @@ CREATE TABLE `t2` (
`b` int(11) default NULL,
`b` int(11) default NULL,
PRIMARY KEY (`a`)
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
set @sav_binlog_format= @@session.binlog_format;
set @@session.binlog_format= mixed;
set @@session.binlog_format= mixed;
insert into t1 values (1,1),(2,2);
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
insert into t2 values (1,1),(4,4);
...
@@ -626,7 +627,7 @@ a b
...
@@ -626,7 +627,7 @@ a b
4 4
4 4
show master status /* there must be the UPDATE query event */;
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001
197
master-bin.000001
268
delete from t1;
delete from t1;
delete from t2;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
insert into t1 values (1,2),(3,4),(4,4);
...
@@ -636,6 +637,24 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
...
@@ -636,6 +637,24 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */;
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 2
12
master-bin.000001 2
83
drop table t1, t2;
drop table t1, t2;
set @@session.binlog_format= @sav_binlog_format;
drop table if exists t1, t2, t3;
CREATE TABLE t1 (a int, PRIMARY KEY (a));
CREATE TABLE t2 (a int, PRIMARY KEY (a));
CREATE TABLE t3 (a int, PRIMARY KEY (a)) ENGINE=MyISAM;
create trigger trg_del_t3 before delete on t3 for each row insert into t1 values (1);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
reset master;
delete t3.* from t2,t3 where t2.a=t3.a;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
1
select count(*) from t3 /* must be 1 */;
count(*)
1
drop table t1, t2, t3;
end of tests
end of tests
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
View file @
8f7550ec
...
@@ -520,7 +520,9 @@ count(*)
...
@@ -520,7 +520,9 @@ count(*)
drop table t1,t2;
drop table t1,t2;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
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 t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
insert into t2 values (1);
insert into t2 values (1);
reset master;
reset master;
insert into t2 values (bug27417(1));
insert into t2 values (bug27417(1));
...
@@ -559,6 +561,33 @@ master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
...
@@ -559,6 +561,33 @@ master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
select count(*) from t1 /* must be 2 */;
select count(*) from t1 /* must be 2 */;
count(*)
count(*)
2
2
delete from t3;
delete from t4;
insert into t3 values (1,1);
insert into t4 values (1,1),(2,2);
reset master;
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=6
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 4 */;
count(*)
4
delete from t1;
delete from t3;
delete from t4;
insert into t3 values (1,1),(2,2);
insert into t4 values (1,1),(2,2);
reset master;
UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
1
drop table t4;
delete from t1;
delete from t1;
delete from t2;
delete from t2;
delete from t3;
delete from t3;
...
@@ -571,12 +600,30 @@ delete from t2;
...
@@ -571,12 +600,30 @@ delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=
6
master-bin.000001 # Intvar # # INSERT_ID=
9
master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */;
select count(*) from t1 /* must be 1 */;
count(*)
count(*)
1
1
drop trigger trg_del;
delete from t1;
delete from t2;
delete from t5;
create trigger trg_del_t2 after delete on t2 for each row
insert into t1 values (1);
insert into t2 values (2),(3);
insert into t5 values (1),(2);
reset master;
delete t2.* from t2,t5 where t2.a=t5.a + 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */;
count(*)
1
delete from t1;
delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
insert into t4 values (0, 17);
...
@@ -591,11 +638,11 @@ count(*)
...
@@ -591,11 +638,11 @@ count(*)
2
2
show binlog events from <binlog_start>;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=
7
master-bin.000001 # Intvar # # INSERT_ID=
10
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
master-bin.000001 # Intvar # # INSERT_ID=
7
master-bin.000001 # Intvar # # INSERT_ID=
10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del;
drop trigger trg_del
_t2
;
drop table t1,t2,t3,t4;
drop table t1,t2,t3,t4
,t5
;
drop function bug27417;
drop function bug27417;
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
View file @
8f7550ec
...
@@ -494,7 +494,9 @@ count(*)
...
@@ -494,7 +494,9 @@ count(*)
drop table t1,t2;
drop table t1,t2;
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM;
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 t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique);
CREATE TABLE t3 (a int, PRIMARY KEY (a), b int unique) ENGINE=MyISAM;
CREATE TABLE t4 (a int, PRIMARY KEY (a), b int unique) ENGINE=Innodb;
CREATE TABLE t5 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
insert into t2 values (1);
insert into t2 values (1);
reset master;
reset master;
insert into t2 values (bug27417(1));
insert into t2 values (bug27417(1));
...
@@ -533,6 +535,33 @@ master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
...
@@ -533,6 +535,33 @@ master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1)
select count(*) from t1 /* must be 2 */;
select count(*) from t1 /* must be 2 */;
count(*)
count(*)
2
2
delete from t3;
delete from t4;
insert into t3 values (1,1);
insert into t4 values (1,1),(2,2);
reset master;
UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=6
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 4 */;
count(*)
4
delete from t1;
delete from t3;
delete from t4;
insert into t3 values (1,1),(2,2);
insert into t4 values (1,1),(2,2);
reset master;
UPDATE t3,t4 SET t3.a=t4.a + bug27417(1);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select count(*) from t1 /* must be 1 */;
count(*)
1
drop table t4;
delete from t1;
delete from t1;
delete from t2;
delete from t2;
delete from t3;
delete from t3;
...
@@ -545,12 +574,30 @@ delete from t2;
...
@@ -545,12 +574,30 @@ delete from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=
6
master-bin.000001 # Intvar # # INSERT_ID=
9
master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; delete from t2
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */;
select count(*) from t1 /* must be 1 */;
count(*)
count(*)
1
1
drop trigger trg_del;
delete from t1;
delete from t2;
delete from t5;
create trigger trg_del_t2 after delete on t2 for each row
insert into t1 values (1);
insert into t2 values (2),(3);
insert into t5 values (1),(2);
reset master;
delete t2.* from t2,t5 where t2.a=t5.a + 1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1
master-bin.000001 # Query # # use `test`; ROLLBACK
select count(*) from t1 /* must be 1 */;
count(*)
1
delete from t1;
delete from t1;
create table t4 (a int default 0, b int primary key) engine=innodb;
create table t4 (a int default 0, b int primary key) engine=innodb;
insert into t4 values (0, 17);
insert into t4 values (0, 17);
...
@@ -565,13 +612,13 @@ count(*)
...
@@ -565,13 +612,13 @@ count(*)
2
2
show binlog events from <binlog_start>;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Intvar # # INSERT_ID=
7
master-bin.000001 # Intvar # # INSERT_ID=
10
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
master-bin.000001 # Intvar # # INSERT_ID=
7
master-bin.000001 # Intvar # # INSERT_ID=
10
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=1
master-bin.000001 # Query # # use `test`; ROLLBACK
master-bin.000001 # Query # # use `test`; ROLLBACK
drop trigger trg_del;
drop trigger trg_del
_t2
;
drop table t1,t2,t3,t4;
drop table t1,t2,t3,t4
,t5
;
drop function bug27417;
drop function bug27417;
set @@session.binlog_format=@@global.binlog_format;
set @@session.binlog_format=@@global.binlog_format;
end of tests
end of tests
mysql-test/suite/manual/r/rpl_replication_delay.result
View file @
8f7550ec
...
@@ -11,7 +11,7 @@ Master_User root
...
@@ -11,7 +11,7 @@ Master_User root
Master_Port 9306
Master_Port 9306
Connect_Retry 1
Connect_Retry 1
Master_Log_File master-bin.000001
Master_Log_File master-bin.000001
Read_Master_Log_Pos
98
Read_Master_Log_Pos
106
Relay_Log_File #
Relay_Log_File #
Relay_Log_Pos #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Relay_Master_Log_File master-bin.000001
...
@@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table
...
@@ -26,7 +26,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Errno 0
Last_Error
Last_Error
Skip_Counter 0
Skip_Counter 0
Exec_Master_Log_Pos
98
Exec_Master_Log_Pos
106
Relay_Log_Space #
Relay_Log_Space #
Until_Condition None
Until_Condition None
Until_Log_File
Until_Log_File
...
@@ -38,6 +38,11 @@ Master_SSL_Cert
...
@@ -38,6 +38,11 @@ Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Cipher
Master_SSL_Key
Master_SSL_Key
Seconds_Behind_Master 0
Seconds_Behind_Master 0
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
drop table if exists t1;
drop table if exists t1;
Warnings:
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't1'
...
@@ -52,7 +57,7 @@ Master_User root
...
@@ -52,7 +57,7 @@ Master_User root
Master_Port 9306
Master_Port 9306
Connect_Retry 1
Connect_Retry 1
Master_Log_File master-bin.000001
Master_Log_File master-bin.000001
Read_Master_Log_Pos 3
59
Read_Master_Log_Pos 3
67
Relay_Log_File #
Relay_Log_File #
Relay_Log_Pos #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Relay_Master_Log_File master-bin.000001
...
@@ -67,7 +72,7 @@ Replicate_Wild_Ignore_Table
...
@@ -67,7 +72,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Errno 0
Last_Error
Last_Error
Skip_Counter 0
Skip_Counter 0
Exec_Master_Log_Pos 27
1
Exec_Master_Log_Pos 27
9
Relay_Log_Space #
Relay_Log_Space #
Until_Condition None
Until_Condition None
Until_Log_File
Until_Log_File
...
@@ -78,7 +83,12 @@ Master_SSL_CA_Path
...
@@ -78,7 +83,12 @@ Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Cipher
Master_SSL_Key
Master_SSL_Key
Seconds_Behind_Master 10
Seconds_Behind_Master 9
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
unlock tables;
unlock tables;
flush logs /* this time rli->last_master_timestamp is not affected */;
flush logs /* this time rli->last_master_timestamp is not affected */;
lock table t1 write;
lock table t1 write;
...
@@ -90,7 +100,7 @@ Master_User root
...
@@ -90,7 +100,7 @@ Master_User root
Master_Port 9306
Master_Port 9306
Connect_Retry 1
Connect_Retry 1
Master_Log_File master-bin.000001
Master_Log_File master-bin.000001
Read_Master_Log_Pos 4
47
Read_Master_Log_Pos 4
55
Relay_Log_File #
Relay_Log_File #
Relay_Log_Pos #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Relay_Master_Log_File master-bin.000001
...
@@ -105,7 +115,7 @@ Replicate_Wild_Ignore_Table
...
@@ -105,7 +115,7 @@ Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Errno 0
Last_Error
Last_Error
Skip_Counter 0
Skip_Counter 0
Exec_Master_Log_Pos 3
59
Exec_Master_Log_Pos 3
67
Relay_Log_Space #
Relay_Log_Space #
Until_Condition None
Until_Condition None
Until_Log_File
Until_Log_File
...
@@ -116,6 +126,11 @@ Master_SSL_CA_Path
...
@@ -116,6 +126,11 @@ Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Cipher
Master_SSL_Key
Master_SSL_Key
Seconds_Behind_Master 6
Seconds_Behind_Master 7
Master_SSL_Verify_Server_Cert No
Last_IO_Errno 0
Last_IO_Error
Last_SQL_Errno 0
Last_SQL_Error
unlock tables;
unlock tables;
drop table t1;
drop table t1;
mysql-test/t/innodb.test
View file @
8f7550ec
...
@@ -753,45 +753,6 @@ select * from t1;
...
@@ -753,45 +753,6 @@ select * from t1;
select
*
from
t2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug#27716 multi-update did partially and has not binlogged
#
CREATE
TABLE
`t1`
(
`a`
int
(
11
)
NOT
NULL
auto_increment
,
`b`
int
(
11
)
default
NULL
,
PRIMARY
KEY
(
`a`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
CREATE
TABLE
`t2`
(
`a`
int
(
11
)
NOT
NULL
auto_increment
,
`b`
int
(
11
)
default
NULL
,
PRIMARY
KEY
(
`a`
)
)
ENGINE
=
INNODB
DEFAULT
CHARSET
=
latin1
;
# A. testing multi_update::send_eof() execution branch
insert
into
t1
values
(
1
,
1
),(
2
,
2
);
insert
into
t2
values
(
1
,
1
),(
4
,
4
);
reset
master
;
--
error
ER_DUP_ENTRY
UPDATE
t2
,
t1
SET
t2
.
a
=
t1
.
a
+
2
;
# check
select
*
from
t2
/* must be (3,1), (4,4) */
;
show
master
status
/* there must no UPDATE in binlog */
;
# B. testing multi_update::send_error() execution branch
delete
from
t1
;
delete
from
t2
;
insert
into
t1
values
(
1
,
2
),(
3
,
4
),(
4
,
4
);
insert
into
t2
values
(
1
,
2
),(
3
,
4
),(
4
,
4
);
reset
master
;
--
error
ER_DUP_ENTRY
UPDATE
t2
,
t1
SET
t2
.
a
=
t2
.
b
where
t2
.
a
=
t1
.
a
;
show
master
status
/* there must be no UPDATE query event */
;
# cleanup bug#27716
drop
table
t1
,
t2
;
#
#
# Bug #29136 erred multi-delete on trans table does not rollback
# Bug #29136 erred multi-delete on trans table does not rollback
#
#
...
...
mysql-test/t/multi_update.test
View file @
8f7550ec
...
@@ -588,6 +588,7 @@ CREATE TABLE `t2` (
...
@@ -588,6 +588,7 @@ CREATE TABLE `t2` (
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
# as the test is about to see erroed queries in binlog
# as the test is about to see erroed queries in binlog
set
@
sav_binlog_format
=
@@
session
.
binlog_format
;
set
@@
session
.
binlog_format
=
mixed
;
set
@@
session
.
binlog_format
=
mixed
;
...
@@ -614,6 +615,7 @@ show master status /* there must be the UPDATE query event */;
...
@@ -614,6 +615,7 @@ show master status /* there must be the UPDATE query event */;
# cleanup bug#27716
# cleanup bug#27716
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
set
@@
session
.
binlog_format
=
@
sav_binlog_format
;
#
#
# Bug #29136 erred multi-delete on trans table does not rollback
# Bug #29136 erred multi-delete on trans table does not rollback
...
@@ -642,11 +644,13 @@ delete t3.* from t2,t3 where t2.a=t3.a;
...
@@ -642,11 +644,13 @@ delete t3.* from t2,t3 where t2.a=t3.a;
# check
# check
select
count
(
*
)
from
t1
/* must be 1 */
;
select
count
(
*
)
from
t1
/* must be 1 */
;
select
count
(
*
)
from
t3
/* must be 1 */
;
select
count
(
*
)
from
t3
/* must be 1 */
;
# the query must be in binlog (no surprise though)
source
include
/
show_binlog_events
.
inc
;
# cleanup bug#29136
# cleanup bug#29136
drop
table
t1
,
t2
,
t3
;
drop
table
t1
,
t2
,
t3
;
#
# Add further tests from here
#
--
echo
end
of
tests
--
echo
end
of
tests
sql/log_event.cc
View file @
8f7550ec
...
@@ -558,8 +558,32 @@ int Log_event::do_update_pos(Relay_log_info *rli)
...
@@ -558,8 +558,32 @@ int Log_event::do_update_pos(Relay_log_info *rli)
Matz: I don't think we will need this check with this refactoring.
Matz: I don't think we will need this check with this refactoring.
*/
*/
if
(
rli
)
if
(
rli
)
rli
->
stmt_done
(
log_pos
,
when
);
{
/*
bug#29309 simulation: resetting the flag to force
wrong behaviour of artificial event to update
rli->last_master_timestamp for only one time -
the first FLUSH LOGS in the test.
*/
DBUG_EXECUTE_IF
(
"let_first_flush_log_change_timestamp"
,
if
(
debug_not_change_ts_if_art_event
==
1
&&
is_artificial_event
())
{
debug_not_change_ts_if_art_event
=
0
;
});
#ifndef DBUG_OFF
rli
->
stmt_done
(
log_pos
,
is_artificial_event
()
&&
debug_not_change_ts_if_art_event
>
0
?
0
:
when
);
#else
rli
->
stmt_done
(
log_pos
,
is_artificial_event
()
?
0
:
when
);
#endif
DBUG_EXECUTE_IF
(
"let_first_flush_log_change_timestamp"
,
if
(
debug_not_change_ts_if_art_event
==
0
)
{
debug_not_change_ts_if_art_event
=
2
;
});
}
return
0
;
// Cannot fail currently
return
0
;
// Cannot fail currently
}
}
...
...
sql/rpl_rli.cc
View file @
8f7550ec
...
@@ -1082,6 +1082,9 @@ bool Relay_log_info::cached_charset_compare(char *charset) const
...
@@ -1082,6 +1082,9 @@ bool Relay_log_info::cached_charset_compare(char *charset) const
void
Relay_log_info
::
stmt_done
(
my_off_t
event_master_log_pos
,
void
Relay_log_info
::
stmt_done
(
my_off_t
event_master_log_pos
,
time_t
event_creation_time
)
time_t
event_creation_time
)
{
{
#ifndef DBUG_OFF
extern
uint
debug_not_change_ts_if_art_event
;
#endif
clear_flag
(
IN_STMT
);
clear_flag
(
IN_STMT
);
/*
/*
...
@@ -1121,7 +1124,12 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos,
...
@@ -1121,7 +1124,12 @@ void Relay_log_info::stmt_done(my_off_t event_master_log_pos,
is that value may take some time to display in
is that value may take some time to display in
Seconds_Behind_Master - not critical).
Seconds_Behind_Master - not critical).
*/
*/
last_master_timestamp
=
event_creation_time
;
#ifndef DBUG_OFF
if
(
!
(
event_creation_time
==
0
&&
debug_not_change_ts_if_art_event
>
0
))
#else
if
(
event_creation_time
!=
0
)
#endif
last_master_timestamp
=
event_creation_time
;
}
}
}
}
...
...
sql/sql_delete.cc
View file @
8f7550ec
...
@@ -758,9 +758,9 @@ void multi_delete::send_error(uint errcode,const char *err)
...
@@ -758,9 +758,9 @@ void multi_delete::send_error(uint errcode,const char *err)
*/
*/
if
(
mysql_bin_log
.
is_open
())
if
(
mysql_bin_log
.
is_open
())
{
{
Query_log_event
qinfo
(
thd
,
thd
->
query
,
thd
->
query_length
,
thd
->
binlog_query
(
THD
::
ROW_QUERY_TYPE
,
transactional_tables
,
FALSE
);
thd
->
query
,
thd
->
query_length
,
mysql_bin_log
.
write
(
&
qinfo
);
transactional_tables
,
FALSE
);
}
}
thd
->
transaction
.
all
.
modified_non_trans_table
=
true
;
thd
->
transaction
.
all
.
modified_non_trans_table
=
true
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment