mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
b14a6af821
into mysql.com:/usr/local/mysql/mysql-5.1-new mysql-test/r/binlog_stm_mix_innodb_myisam.result: Auto merged mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Manual merge.
282 lines
9.6 KiB
Text
282 lines
9.6 KiB
Text
drop table if exists t1, t2;
|
|
create table t1 (a int) engine=innodb;
|
|
create table t2 (a int) engine=myisam;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(1);
|
|
insert into t2 select * from t1;
|
|
commit;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(1)
|
|
master-bin.000001 257 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 351 Xid 1 # COMMIT /* xid= */
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(2);
|
|
insert into t2 select * from t1;
|
|
rollback;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(2)
|
|
master-bin.000001 257 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 351 Query 1 # use `test`; ROLLBACK
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(3);
|
|
savepoint my_savepoint;
|
|
insert into t1 values(4);
|
|
insert into t2 select * from t1;
|
|
rollback to savepoint my_savepoint;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
commit;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(3)
|
|
master-bin.000001 257 Query 1 # use `test`; savepoint my_savepoint
|
|
master-bin.000001 342 Query 1 # use `test`; insert into t1 values(4)
|
|
master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 523 Query 1 # use `test`; rollback to savepoint my_savepoint
|
|
master-bin.000001 620 Xid 1 # COMMIT /* xid= */
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(5);
|
|
savepoint my_savepoint;
|
|
insert into t1 values(6);
|
|
insert into t2 select * from t1;
|
|
rollback to savepoint my_savepoint;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
insert into t1 values(7);
|
|
commit;
|
|
select a from t1 order by a;
|
|
a
|
|
5
|
|
7
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(5)
|
|
master-bin.000001 257 Query 1 # use `test`; savepoint my_savepoint
|
|
master-bin.000001 342 Query 1 # use `test`; insert into t1 values(6)
|
|
master-bin.000001 429 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 523 Query 1 # use `test`; rollback to savepoint my_savepoint
|
|
master-bin.000001 620 Query 1 # use `test`; insert into t1 values(7)
|
|
master-bin.000001 707 Xid 1 # COMMIT /* xid= */
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
select get_lock("a",10);
|
|
get_lock("a",10)
|
|
1
|
|
begin;
|
|
insert into t1 values(8);
|
|
insert into t2 select * from t1;
|
|
select get_lock("a",10);
|
|
get_lock("a",10)
|
|
1
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(8)
|
|
master-bin.000001 257 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 351 Query 1 # use `test`; ROLLBACK
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
insert into t1 values(9);
|
|
insert into t2 select * from t1;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; insert into t1 values(9)
|
|
master-bin.000001 189 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 216 Query 1 # use `test`; insert into t2 select * from t1
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
insert into t1 values(10);
|
|
begin;
|
|
insert into t2 select * from t1;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; insert into t1 values(10)
|
|
master-bin.000001 190 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 217 Query 1 # use `test`; insert into t2 select * from t1
|
|
insert into t1 values(11);
|
|
commit;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; insert into t1 values(10)
|
|
master-bin.000001 190 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 217 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 311 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 379 Query 1 # use `test`; insert into t1 values(11)
|
|
master-bin.000001 467 Xid 1 # COMMIT /* xid= */
|
|
alter table t2 engine=INNODB;
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(12);
|
|
insert into t2 select * from t1;
|
|
commit;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(12)
|
|
master-bin.000001 258 Query 1 # use `test`; insert into t2 select * from t1
|
|
master-bin.000001 352 Xid 1 # COMMIT /* xid= */
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(13);
|
|
insert into t2 select * from t1;
|
|
rollback;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(14);
|
|
savepoint my_savepoint;
|
|
insert into t1 values(15);
|
|
insert into t2 select * from t1;
|
|
rollback to savepoint my_savepoint;
|
|
commit;
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(14)
|
|
master-bin.000001 258 Xid 1 # COMMIT /* xid= */
|
|
delete from t1;
|
|
delete from t2;
|
|
reset master;
|
|
begin;
|
|
insert into t1 values(16);
|
|
savepoint my_savepoint;
|
|
insert into t1 values(17);
|
|
insert into t2 select * from t1;
|
|
rollback to savepoint my_savepoint;
|
|
insert into t1 values(18);
|
|
commit;
|
|
select a from t1 order by a;
|
|
a
|
|
16
|
|
18
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(16)
|
|
master-bin.000001 258 Query 1 # use `test`; insert into t1 values(18)
|
|
master-bin.000001 346 Xid 1 # COMMIT /* xid= */
|
|
delete from t1;
|
|
delete from t2;
|
|
alter table t2 engine=MyISAM;
|
|
insert into t1 values (1);
|
|
begin;
|
|
select * from t1 for update;
|
|
a
|
|
1
|
|
select (@before:=unix_timestamp())*0;
|
|
(@before:=unix_timestamp())*0
|
|
0
|
|
begin;
|
|
select * from t1 for update;
|
|
insert into t2 values (20);
|
|
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
|
select (@after:=unix_timestamp())*0;
|
|
(@after:=unix_timestamp())*0
|
|
0
|
|
select (@after-@before) >= 2;
|
|
(@after-@before) >= 2
|
|
1
|
|
drop table t1,t2;
|
|
commit;
|
|
begin;
|
|
create temporary table ti (a int) engine=innodb;
|
|
rollback;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
insert into ti values(1);
|
|
set autocommit=0;
|
|
create temporary table t1 (a int) engine=myisam;
|
|
commit;
|
|
insert t1 values (1);
|
|
rollback;
|
|
Warnings:
|
|
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
|
create table t0 (n int);
|
|
insert t0 select * from t1;
|
|
set autocommit=1;
|
|
insert into t0 select GET_LOCK("lock1",null);
|
|
set autocommit=0;
|
|
create table t2 (n int) engine=innodb;
|
|
insert into t2 values (3);
|
|
select get_lock("lock1",60);
|
|
get_lock("lock1",60)
|
|
1
|
|
show binlog events from 102;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 102 Query 1 # use `test`; BEGIN
|
|
master-bin.000001 170 Query 1 # use `test`; insert into t1 values(16)
|
|
master-bin.000001 258 Query 1 # use `test`; insert into t1 values(18)
|
|
master-bin.000001 346 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 373 Query 1 # use `test`; delete from t1
|
|
master-bin.000001 450 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 477 Query 1 # use `test`; delete from t2
|
|
master-bin.000001 554 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 581 Query 1 # use `test`; alter table t2 engine=MyISAM
|
|
master-bin.000001 672 Query 1 # use `test`; insert into t1 values (1)
|
|
master-bin.000001 760 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 787 Query 1 # use `test`; insert into t2 values (20)
|
|
master-bin.000001 876 Query 1 # use `test`; drop table t1,t2
|
|
master-bin.000001 955 Query 1 # use `test`; create temporary table ti (a int) engine=innodb
|
|
master-bin.000001 1065 Query 1 # use `test`; insert into ti values(1)
|
|
master-bin.000001 1152 Xid 1 # COMMIT /* xid= */
|
|
master-bin.000001 1179 Query 1 # use `test`; create temporary table t1 (a int) engine=myisam
|
|
master-bin.000001 1289 Query 1 # use `test`; insert t1 values (1)
|
|
master-bin.000001 1372 Query 1 # use `test`; create table t0 (n int)
|
|
master-bin.000001 1458 Query 1 # use `test`; insert t0 select * from t1
|
|
master-bin.000001 1547 Query 1 # use `test`; insert into t0 select GET_LOCK("lock1",null)
|
|
master-bin.000001 1654 Query 1 # use `test`; create table t2 (n int) engine=innodb
|
|
master-bin.000001 1754 Query 1 # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `test`.`t1`,`test`.`ti`
|
|
do release_lock("lock1");
|
|
drop table t0,t2;
|
|
reset master;
|
|
create table t1 (a int) engine=innodb;
|
|
create table t2 (a int) engine=myisam;
|
|
select get_lock("a",10);
|
|
get_lock("a",10)
|
|
1
|
|
begin;
|
|
insert into t1 values(8);
|
|
insert into t2 select * from t1;
|
|
select get_lock("a",10);
|
|
get_lock("a",10)
|
|
1
|
|
select
|
|
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
|
|
is not null;
|
|
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
|
|
is not null
|
|
1
|
|
select
|
|
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
|
|
@a not like "%#%error_code=%error_code=%";
|
|
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
|
|
1 1
|
|
drop table t1, t2;
|