2 SET BINLOG_FORMAT=MIXED;
6 CREATE
TABLE t1 (a INT PRIMARY
KEY, b INT) ENGINE=INNODB;
7 INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
9 SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
11 # Should be logged as statement
12 UPDATE t1 SET b = 2*a WHERE a > 1;
15 SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
17 # Should be logged as rows
18 UPDATE t1 SET b = a * a WHERE a > 3;
21 # Check that errors are generated when trying to use READ COMMITTED
22 # transaction isolation level in STATEMENT binlog mode.
24 SET BINLOG_FORMAT=STATEMENT;
26 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
28 error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE;
29 UPDATE t1 SET b = 1*a WHERE a > 1;
32 SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
34 error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE;
35 UPDATE t1 SET b = 2*a WHERE a > 2;
38 SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
40 UPDATE t1 SET b = 3*a WHERE a > 3;
43 SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
45 UPDATE t1 SET b = 4*a WHERE a > 4;
48 SET BINLOG_FORMAT=MIXED;
50 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
52 UPDATE t1 SET b = 1*a WHERE a > 1;
55 SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
57 UPDATE t1 SET b = 2*a WHERE a > 2;
60 SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
62 UPDATE t1 SET b = 3*a WHERE a > 3;
65 SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
67 UPDATE t1 SET b = 4*a WHERE a > 4;
70 SET BINLOG_FORMAT=ROW;
72 SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
74 UPDATE t1 SET b = 1*a WHERE a > 1;
77 SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
79 UPDATE t1 SET b = 2*a WHERE a > 2;
82 SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
84 UPDATE t1 SET b = 3*a WHERE a > 3;
87 SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
89 UPDATE t1 SET b = 4*a WHERE a > 4;
92 source include/show_binlog_events.inc;
98 # Let us test binlog_cache_use and binlog_cache_disk_use status vars.
99 # Actually this test has nothing to do with innodb per se, it just requires
100 # transactional table.
103 show status like
"binlog_cache_use";
104 show status like
"binlog_cache_disk_use";
106 create
table t1 (a
int) engine=innodb;
108 # Now we are going to create transaction which is long enough so its
109 # transaction binlog will be flushed to disk...
115 eval insert into t1 values( $1 );
120 show status like
"binlog_cache_use";
121 show status like
"binlog_cache_disk_use";
123 # Transaction which should not be flushed to disk and so should not
124 # increase binlog_cache_disk_use.
128 show status like
"binlog_cache_use";
129 show status like
"binlog_cache_disk_use";
133 # Bug#27716 multi-update did partially and has not binlogged
137 `a` int(11) NOT NULL auto_increment,
138 `b`
int(11) default NULL,
140 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
143 `a`
int(11) NOT NULL auto_increment,
144 `b`
int(11) default NULL,
146 ) ENGINE=INNODB DEFAULT CHARSET=latin1 ;
148 # A. testing multi_update::send_eof() execution branch
149 insert into t1 values (1,1),(2,2);
150 insert into t2 values (1,1),(4,4);
153 UPDATE t2,t1 SET t2.a=t1.a+2;
156 --echo # There must no UPDATE in binlog;
157 source include/show_binlog_events.inc;
159 # B. testing multi_update::send_error() execution branch
162 insert into t1 values (1,2),(3,4),(4,4);
163 insert into t2 values (1,2),(3,4),(4,4);
166 UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
168 source include/show_binlog_events.inc;