1
# Test to test how logging is done depending on the capabilities of
2
# the engines. Unfortunately, we don't have a good row-only logging
3
# engine, and NDB does not really cut is since it is also
4
# self-logging. I'm using it nevertheless.
6
source include/have_blackhole.inc;
7
source include/have_ndb.inc;
8
source include/have_log_bin.inc;
10
CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
11
CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
12
CREATE TABLE t1n (e INT, f INT) ENGINE=NDB;
16
SET SESSION BINLOG_FORMAT=STATEMENT;
18
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
19
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
21
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
23
# Here and below we need to wait when some event appears in binlog
24
# to avoid unsrted mixing local events and from NDB
25
let $wait_binlog_event= t1m, t1b;
26
source include/wait_for_binlog_event.inc;
28
echo *** Please look in binlog_multi_engine.test if you have a diff here ****;
30
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
31
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
32
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
35
let $wait_binlog_event= COMMIT;
36
source include/wait_for_binlog_event.inc;
42
let $wait_binlog_event= t1n;
43
source include/wait_for_binlog_event.inc;
45
source include/show_binlog_events.inc;
49
SET SESSION BINLOG_FORMAT=MIXED;
51
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
52
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
54
let $wait_binlog_event= t1m;
55
source include/wait_for_binlog_event.inc;
57
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
59
let $wait_binlog_event= COMMIT;
60
source include/wait_for_binlog_event.inc;
62
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
63
error ER_BINLOG_LOGGING_IMPOSSIBLE;
64
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
66
# Not possible to test this since NDB writes its own binlog, which
67
# might cause it to be out of sync with the results from MyISAM.
68
# This will generate an error once BUG#28722 is fixed.
70
#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
72
error ER_BINLOG_LOGGING_IMPOSSIBLE;
73
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
79
source include/show_binlog_events.inc;
83
SET SESSION BINLOG_FORMAT=ROW;
85
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
86
error ER_BINLOG_LOGGING_IMPOSSIBLE;
87
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
88
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
90
error ER_BINLOG_LOGGING_IMPOSSIBLE;
91
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
92
error ER_BINLOG_LOGGING_IMPOSSIBLE;
93
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
95
# Not possible to test this since NDB writes its own binlog, which
96
# might cause it to be out of sync with the results from MyISAM.
97
# This will generate an error once BUG#28722 is fixed.
99
#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
101
error ER_BINLOG_LOGGING_IMPOSSIBLE;
102
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
104
source include/show_binlog_events.inc;
108
DROP TABLE t1m, t1b, t1n;