Debian Codegraph @

mysql-test/suite/binlog/r/binlog_truncate_myisam.result

raw
1 SET @old_binlog_format=@@binlog_format;
2 Warnings:
3 Warning 1287 '@@binlog_format' is deprecated and will be removed in a future release.
4 SET BINLOG_FORMAT='ROW';
5 Warnings:
6 Warning 1287 '@@binlog_format' is deprecated and will be removed in a future release.
7 RESET MASTER;
8 CREATE TABLE t1 (a INT) ENGINE=MyISAM;
9 CREATE TABLE t2 (a INT) ENGINE=MyISAM;
10 INSERT INTO t2 VALUES (1),(2),(3);
11 **** Truncate of empty table shall be logged
12 TRUNCATE TABLE t1;
13 TRUNCATE TABLE t2;
14 include/show_binlog_events.inc
15 Log_name Pos Event_type Server_id End_log_pos Info
16 binlog.000001 # Query # # use `test`; TRUNCATE TABLE t1
17 binlog.000001 # Query # # use `test`; TRUNCATE TABLE t2
18 DROP TABLE t1,t2;
19 #
20 # Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
21 #
22 CREATE TABLE t1 (a INT) ENGINE=MyISAM;
23 CREATE TABLE t2 (a INT) ENGINE=MyISAM;
24 INSERT INTO t1 VALUES (1),(2);
25 # Connection: default
26 BEGIN;
27 INSERT INTO t2 SELECT * FROM t1;
28 # Connection: truncate
29 TRUNCATE TABLE t1;
30 # Connection: default
31 INSERT INTO t2 SELECT * FROM t1;
32 SELECT COUNT(*) FROM t2;
33 COUNT(*)
34 4
35 COMMIT;
36 # Connection: truncate
37 # Reaping TRUNCATE TABLE
38 SELECT COUNT(*) FROM t1;
39 COUNT(*)
40 0
41 SELECT COUNT(*) FROM t2;
42 COUNT(*)
43 4
44 # Connection: default
45 include/show_binlog_events.inc
46 Log_name Pos Event_type Server_id End_log_pos Info
47 binlog.000001 # Query # # BEGIN
48 binlog.000001 # Table_map # # table_id: # (test.t2)
49 binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
50 binlog.000001 # Query # # COMMIT
51 binlog.000001 # Query # # BEGIN
52 binlog.000001 # Table_map # # table_id: # (test.t2)
53 binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
54 binlog.000001 # Query # # COMMIT
55 binlog.000001 # Query # # use `test`; TRUNCATE TABLE t1
56 DROP TABLE t1,t2;
57 SET BINLOG_FORMAT='STATEMENT';
58 Warnings:
59 Warning 1287 '@@binlog_format' is deprecated and will be removed in a future release.
60 RESET MASTER;
61 CREATE TABLE t1 (a INT) ENGINE=MyISAM;
62 CREATE TABLE t2 (a INT) ENGINE=MyISAM;
63 INSERT INTO t2 VALUES (1),(2),(3);
64 **** Truncate of empty table shall be logged
65 TRUNCATE TABLE t1;
66 TRUNCATE TABLE t2;
67 include/show_binlog_events.inc
68 Log_name Pos Event_type Server_id End_log_pos Info
69 binlog.000001 # Query # # use `test`; TRUNCATE TABLE t1
70 binlog.000001 # Query # # use `test`; TRUNCATE TABLE t2
71 DROP TABLE t1,t2;
72 #
73 # Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
74 #
75 CREATE TABLE t1 (a INT) ENGINE=MyISAM;
76 CREATE TABLE t2 (a INT) ENGINE=MyISAM;
77 INSERT INTO t1 VALUES (1),(2);
78 # Connection: default
79 BEGIN;
80 INSERT INTO t2 SELECT * FROM t1;
81 # Connection: truncate
82 TRUNCATE TABLE t1;
83 # Connection: default
84 INSERT INTO t2 SELECT * FROM t1;
85 SELECT COUNT(*) FROM t2;
86 COUNT(*)
87 4
88 COMMIT;
89 # Connection: truncate
90 # Reaping TRUNCATE TABLE
91 SELECT COUNT(*) FROM t1;
92 COUNT(*)
93 0
94 SELECT COUNT(*) FROM t2;
95 COUNT(*)
96 4
97 # Connection: default
98 include/show_binlog_events.inc
99 Log_name Pos Event_type Server_id End_log_pos Info
100 binlog.000001 # Query # # BEGIN
101 binlog.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
102 binlog.000001 # Query # # COMMIT
103 binlog.000001 # Query # # BEGIN
104 binlog.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
105 binlog.000001 # Query # # COMMIT
106 binlog.000001 # Query # # use `test`; TRUNCATE TABLE t1
107 DROP TABLE t1,t2;
108 SET BINLOG_FORMAT=@old_binlog_format;
109 Warnings:
110 Warning 1287 '@@binlog_format' is deprecated and will be removed in a future release.