Debian Codegraph @

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

raw
1 DROP DATABASE IF EXISTS `drop-temp+table-test`;
2 RESET MASTER;
3 CREATE DATABASE `drop-temp+table-test`;
4 USE `drop-temp+table-test`;
5 CREATE TEMPORARY TABLE shortn1 (a INT);
6 CREATE TEMPORARY TABLE `table:name` (a INT);
7 CREATE TEMPORARY TABLE shortn2 (a INT);
8 CREATE TEMPORARY TABLE tmp(c1 int);
9 CREATE TEMPORARY TABLE tmp1(c1 int);
10 CREATE TEMPORARY TABLE tmp2(c1 int);
11 CREATE TEMPORARY TABLE tmp3(c1 int);
12 CREATE TABLE t(c1 int);
13 DROP TEMPORARY TABLE IF EXISTS tmp;
14 DROP TEMPORARY TABLE IF EXISTS tmp;
15 DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
16 DROP TEMPORARY TABLE tmp3;
17 DROP TABLE IF EXISTS tmp2, t;
18 DROP TABLE IF EXISTS tmp2, t;
19 SELECT GET_LOCK("a",10);
20 GET_LOCK("a",10)
21 1
22 USE test;
23 SELECT GET_LOCK("a",10);
24 GET_LOCK("a",10)
25 1
26 include/show_binlog_events.inc
27 Log_name Pos Event_type Server_id End_log_pos Info
28 binlog.000001 # Query # # CREATE DATABASE `drop-temp+table-test`
29 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn1 (a INT)
30 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE `table:name` (a INT)
31 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn2 (a INT)
32 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp(c1 int)
33 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp1(c1 int)
34 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int)
35 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int)
36 binlog.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
37 binlog.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */
38 binlog.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */
39 binlog.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE `tmp3` /* generated by server */
40 binlog.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
41 binlog.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */
42 binlog.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */
43 binlog.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
44 DROP DATABASE `drop-temp+table-test`;
45 RESET MASTER;
46 #
47 # Bug 83003: Using temporary tables on slaves increases GTID sequence number
48 #
49 CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB;
50 CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB;
51 SET SESSION sql_log_bin= 0;
52 CREATE TEMPORARY TABLE temp_binlog_disabled(a INT) ENGINE=InnoDB;
53 SET SESSION sql_log_bin= 1;
54 include/show_binlog_events.inc
55 Log_name Pos Event_type Server_id End_log_pos Info
56 binlog.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_trx(a INT) ENGINE=InnoDB
57 binlog.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp_needs_logging_in_stmt(a INT) ENGINE=InnoDB
58 binlog.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp_needs_logging_in_stmt`,`temp_trx`
59 #
60 # BUG#21638823: ASSERTION FAILED:
61 # THD->GET_TRANSACTION()->IS_EMPTY(TRANSACTION_CTX::STMT) || THD
62 #
63 # Test case first checks that it is possible to terminate a connection
64 # with a temporary table (which will implicitly remove the temporary
65 # table) while in XA_idle. Then checks that an explicit DROP TEMPORARY
66 # TABLE is rejected with ER_XAER_RMFAIL as required by the XA spec.
67 #
68 # Reset master to avoid clutter when dumping binlog
69 RESET MASTER;
70 # Create separate connection
71 # Create temporary table
72 CREATE TEMPORARY TABLE temp(i int);
73 INSERT INTO temp VALUES (0), (1), (2), (3);
74 # Start XA txn and leave it in XA_idle
75 XA START 'idle_at_disconnect';
76 XA END 'idle_at_disconnect';
77 # Terminate connection to verify that the temporary table can be
78 # removed at disconnect even in XA_idle, and that this does not
79 # cause problems for replication
80 # Dump binlog to show that, either the generated DROP comes after tx
81 # commit (stmt), or there is no trace of the XA txn and
82 # the temp table (row or mixed)
83 include/show_binlog_events.inc
84 Log_name Pos Event_type Server_id End_log_pos Info
85 binlog.000001 # Query # # use `test`; CREATE TEMPORARY TABLE temp(i int)
86 binlog.000001 # Query # # BEGIN
87 binlog.000001 # Query # # use `test`; INSERT INTO temp VALUES (0), (1), (2), (3)
88 binlog.000001 # Query # # COMMIT
89 binlog.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `temp`
90 #
91 # Start XA txn and leave in XA_idle
92 XA START 'idle_when_drop_temp';
93 XA END 'idle_when_drop_temp';
94 # Verify that explicit DROP TEMPORARY TABLE is rejected in XA_idle
95 DROP TEMPORARY TABLE IF EXISTS t;
96 Got one of the listed errors
97 XA ROLLBACK 'idle_when_drop_temp';
98 RESET MASTER;
99 #
100 # BUG#28642318: POINT IN TIME RECOVERY USING MYSQLBINLOG BROKEN
101 # WITH TEMPORARY TABLE -> ERRORS
102 # Test case for DELETE query.
103 RESET MASTER;
104 # Set up.
105 SET @save_binlog_format= @@session.binlog_format;
106 SET @@session.binlog_format=STATEMENT;
107 CREATE TABLE t1 (a INT) ENGINE=INNODB;
108 SET @@session.binlog_format=STATEMENT;
109 CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
110 DELETE d1, d2 FROM t1 AS d1, t1 AS d2 WHERE d1.a<>d2.a;
111 DROP TABLE t1;
112 # DELETE query fails with table re-open error without patch.
113 # Clean up.
114 DROP TABLE IF EXISTS t1;
115 DROP TABLE IF EXISTS t1;
116 RESET MASTER;
117 # Test case for DROP query.
118 CREATE TABLE t1 (a INT) ENGINE=INNODB;
119 CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;
120 DROP TABLE t1;
121 DROP TABLE t1;
122 # DROP table query fails with unknown table error without patch.
123 # Clean up
124 SET @@session.binlog_format= @save_binlog_format;
125 RESET MASTER;