Debian Codegraph @

mysql-test/suite/rpl/t/rpl_trans_no_trans.test

raw
1 #
2 # Test mixing transactional and non transactional tables
3 #
4
5 --source include/master-slave.inc
6 --source include/have_innodb.inc
7 --source include/have_binlog_format_row.inc
8
9 #
10 # Test updating conditionally a non transactinal table in a function
11 # This verifies that we don't write only a table map for a non transactional,
12 # without any row events
13 # The original bug caused a crash on the slave when doing a sync_slave
14 #
15
16 create or replace table t1(id int)engine=innodb;
17 create or replace table t3(id int)engine=myisam;
18
19 delimiter //;
20 create or replace function t99 (a int)
21 returns int(10)
22 MODIFIES SQL DATA
23 begin
24 if (a > 100)
25 then
26 insert into t3 values (a);
27 end if;
28 return a;
29 end//
30 delimiter ;//
31 begin;
32 insert into t1 values(t99(1));
33 insert into t1 values(t99(101));
34 commit;
35 select * from t1;
36 select * from t3;
37 insert into t1 values(t99(1));
38
39 drop function t99;
40 drop table t1,t3;
41
42 sync_slave_with_master;
43 connection master;
44
45 #
46 # MDEV-8203
47 # Assertion `!current_stmt_is_commit || !rgi->tables_to_lock' failed in
48 # Query_log_event::do_apply_event(rpl_group_info*, const char*, uint32)
49 #
50
51 CREATE TABLE t1 (i INT) ENGINE=InnoDB;
52 CREATE TABLE t2 (j INT) ENGINE=MyISAM;
53
54 --delimiter ||
55 CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW
56 BEGIN
57 SET @a = unknown_column_just_to_raise_an_error;
58 INSERT INTO t2 VALUES (NULL) ;
59 END||
60 --delimiter ;
61
62 --error ER_BAD_FIELD_ERROR
63 INSERT INTO t1 VALUES (1);
64 --sync_slave_with_master
65
66 connection master;
67
68 drop trigger tr;
69 drop table t1,t2;
70
71 # End of 4.1 tests
72 --source include/rpl_end.inc