File: rpl_trigger_myisam.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (69 lines) | stat: -rw-r--r-- 2,069 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#
# Test of triggers with replication
# Adding statement include due to Bug 12574
# TODO: Remove statement include once 12574 is patched
--source include/have_binlog_format_mixed_or_statement.inc 
--source include/master-slave.inc
--source include/force_myisam_default.inc
--source include/have_myisam.inc

disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--connection slave
call mtr.add_suppression("Either event.*is from an old source");
call mtr.add_suppression("No definer attribute for trigger*");
#
# Since WL#7896 gets rid of SUID triggers it is necessary to suppress the following warning.
# This warning is issued by slave from the function sql_slave_killed() when
# an error happen during applying statement and there are slave parallel workers.
# For case when the statement CREATE TRIGGER without specified DEFINER clause is applied
# on the slave the error ER_TRG_NO_DEFINER is issued that causes the following warning
# be emitted.
#
call mtr.add_suppression("The replica coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
--connection master
enable_query_log;

--disable_warnings
DROP TABLE IF EXISTS t1;

--enable_warnings

#
# Bug#40116: Uncommited changes are replicated and stay on slave after
# rollback on master
#

connection master;
--source include/rpl_reset.inc

connection slave;

connection master;
create table t1 ( f int ) engine = innodb;
create table log ( r int ) engine = myisam; 
create trigger tr
  after insert on t1
  for each row insert into log values ( new.f );

set autocommit = 0;
--disable_warnings
insert into t1 values ( 1 );
--enable_warnings
rollback;
--source include/sync_slave_sql_with_master.inc

let $diff_tables= master:t1, slave:t1;
--source include/diff_tables.inc

let $diff_tables= master:log, slave:log;
--source include/diff_tables.inc

connection master;
drop table t1, log;
--source include/sync_slave_sql_with_master.inc

#
# End of tests
#
--source include/rpl_end.inc