~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/binlog/t/binlog_multi_engine.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
5
 
 
6
source include/have_blackhole.inc;
 
7
source include/have_ndb.inc;
 
8
source include/have_log_bin.inc;
 
9
 
 
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;
 
13
 
 
14
RESET MASTER;
 
15
 
 
16
SET SESSION BINLOG_FORMAT=STATEMENT;
 
17
 
 
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);
 
20
 
 
21
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
 
22
 
 
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;
 
27
 
 
28
echo *** Please look in binlog_multi_engine.test if you have a diff here ****;
 
29
START TRANSACTION;
 
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;
 
33
COMMIT;
 
34
 
 
35
let $wait_binlog_event= COMMIT;
 
36
source include/wait_for_binlog_event.inc;
 
37
 
 
38
TRUNCATE t1m;
 
39
TRUNCATE t1b;
 
40
TRUNCATE t1n;
 
41
 
 
42
let $wait_binlog_event= t1n;
 
43
source include/wait_for_binlog_event.inc;
 
44
 
 
45
source include/show_binlog_events.inc;
 
46
 
 
47
RESET MASTER;
 
48
 
 
49
SET SESSION BINLOG_FORMAT=MIXED;
 
50
 
 
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);
 
53
 
 
54
let $wait_binlog_event= t1m;
 
55
source include/wait_for_binlog_event.inc;
 
56
 
 
57
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
 
58
 
 
59
let $wait_binlog_event= COMMIT;
 
60
source include/wait_for_binlog_event.inc;
 
61
 
 
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;
 
65
 
 
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.
 
69
 
 
70
#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
 
71
 
 
72
error ER_BINLOG_LOGGING_IMPOSSIBLE;
 
73
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
 
74
 
 
75
TRUNCATE t1m;
 
76
TRUNCATE t1b;
 
77
TRUNCATE t1n;
 
78
 
 
79
source include/show_binlog_events.inc;
 
80
 
 
81
RESET MASTER;
 
82
 
 
83
SET SESSION BINLOG_FORMAT=ROW;
 
84
 
 
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);
 
89
 
 
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;
 
94
 
 
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.
 
98
 
 
99
#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
 
100
 
 
101
error ER_BINLOG_LOGGING_IMPOSSIBLE;
 
102
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
 
103
 
 
104
source include/show_binlog_events.inc;
 
105
 
 
106
RESET MASTER;
 
107
 
 
108
DROP TABLE t1m, t1b, t1n;
 
109