mirror of
https://github.com/MariaDB/server.git
synced 2025-08-20 05:03:09 +03:00
temp table This patch introduces two key changes in the replication's behavior. Firstly, it reverts part of BUG#51894 which puts any update to temporary tables into the trx-cache. Now, updates to temporary tables are handled according to the type of their engines as a regular table. Secondly, an unsafe mixed statement, (i.e. a statement that access transactional table as well non-transactional or temporary table, and writes to any of them), are written into the trx-cache in order to minimize errors in the execution when the statement logging format is in use. Such changes has a direct impact on which statements are classified as unsafe statements and thus part of BUG#53259 is reverted.
66 lines
3.4 KiB
Plaintext
66 lines
3.4 KiB
Plaintext
DROP DATABASE IF EXISTS `drop-temp+table-test`;
|
|
RESET MASTER;
|
|
CREATE DATABASE `drop-temp+table-test`;
|
|
USE `drop-temp+table-test`;
|
|
CREATE TEMPORARY TABLE shortn1 (a INT);
|
|
CREATE TEMPORARY TABLE `table:name` (a INT);
|
|
CREATE TEMPORARY TABLE shortn2 (a INT);
|
|
CREATE TEMPORARY TABLE tmp(c1 int);
|
|
CREATE TEMPORARY TABLE tmp1(c1 int);
|
|
CREATE TEMPORARY TABLE tmp2(c1 int);
|
|
CREATE TEMPORARY TABLE tmp3(c1 int);
|
|
CREATE TABLE t(c1 int);
|
|
DROP TEMPORARY TABLE IF EXISTS tmp;
|
|
DROP TEMPORARY TABLE IF EXISTS tmp;
|
|
DROP TEMPORARY TABLE IF EXISTS tmp, tmp1;
|
|
DROP TEMPORARY TABLE tmp3;
|
|
DROP TABLE IF EXISTS tmp2, t;
|
|
DROP TABLE IF EXISTS tmp2, t;
|
|
SELECT GET_LOCK("a",10);
|
|
GET_LOCK("a",10)
|
|
1
|
|
USE test;
|
|
SELECT GET_LOCK("a",10);
|
|
GET_LOCK("a",10)
|
|
1
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test`
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn1 (a INT)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE `table:name` (a INT)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE shortn2 (a INT)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp(c1 int)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp1(c1 int)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int)
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE `tmp3` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */
|
|
master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1`
|
|
DROP DATABASE `drop-temp+table-test`;
|
|
RESET MASTER;
|
|
CREATE TABLE t1 ( i text );
|
|
CREATE TEMPORARY TABLE ttmp1 ( i text );
|
|
SET @@session.binlog_format=ROW;
|
|
INSERT INTO t1 VALUES ('1');
|
|
SELECT @@session.binlog_format;
|
|
@@session.binlog_format
|
|
ROW
|
|
show binlog events from <binlog_start>;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i text )
|
|
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE ttmp1 ( i text )
|
|
master-bin.000001 # Query # # BEGIN
|
|
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
|
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
|
master-bin.000001 # Query # # COMMIT
|
|
master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1`
|
|
RESET MASTER;
|
|
DROP TABLE t1;
|