mariadb/mysql-test/suite/binlog/r/create_like.result
Monty 0bd711d35b MDEV-36980 Assertion `thd->mdl_context.is_lock_owner()...fails in close_thread_table
The problem is that a few constructs are missing from atomic create table
patch that is not yet committed:

- table_creation_was_logged is now set to 1 when logging create temporary.
- Testing for BINLOG_FORMAT_STMT changed to binlog_create_tmp_table() to
  take create_tmp_table_binlog_formats value into account.
- When logging the table creation of temporary tables to the binlog, the
  source table was used instead of the newly temporary table.
2025-07-14 09:10:21 +03:00

106 lines
4 KiB
Text

select @@create_tmp_table_binlog_formats;
@@create_tmp_table_binlog_formats
STATEMENT
RESET MASTER;
#
# MDEV-36980 Assertion `thd->mdl_context.is_lock_owner()...fails in
# close_thread_table
#
CREATE TABLE t1 (c INT);
CREATE TEMPORARY TABLE t2 (d int);
set @@binlog_format="row";
CREATE TEMPORARY TABLE t3_hidden (e int);
set @@binlog_format="statement";
CREATE TEMPORARY TABLE t1 LIKE information_schema.processlist;
CREATE TEMPORARY TABLE t2_tmp like t2;
CREATE TEMPORARY TABLE t3 like t3_hidden;
drop temporary table t1,t2_tmp,t3;
set @@binlog_format="mixed";
set @@create_tmp_table_binlog_formats="statement,mixed";
CREATE TEMPORARY TABLE t1 LIKE information_schema.processlist;
select benchmark(1,1);
benchmark(1,1)
0
CREATE TEMPORARY TABLE t2_tmp like t2;
CREATE TEMPORARY TABLE t3 like t3_hidden;
drop temporary table t1,t2_tmp,t3;
set @@binlog_format="mixed";
set @@create_tmp_table_binlog_formats="statement";
CREATE TEMPORARY TABLE t1 LIKE information_schema.processlist;
CREATE TEMPORARY TABLE t2_tmp like t2;
CREATE TEMPORARY TABLE t3 like t3_hidden;
drop temporary table t1,t2_tmp,t3;
drop temporary table t2,t3_hidden;
drop table t1;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (c INT)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (d int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE `t1` (
`ID` bigint(4) NOT NULL,
`USER` varchar(128) NOT NULL,
`HOST` varchar(64) NOT NULL,
`DB` varchar(64),
`COMMAND` varchar(16) NOT NULL,
`TIME` int(7) NOT NULL,
`STATE` varchar(64),
`INFO` longtext,
`TIME_MS` decimal(22,3) NOT NULL,
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
`MEMORY_USED` bigint(10) NOT NULL,
`MAX_MEMORY_USED` bigint(10) NOT NULL,
`EXAMINED_ROWS` bigint(10) NOT NULL,
`SENT_ROWS` bigint(10) NOT NULL,
`QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
`TID` bigint(10) NOT NULL,
`TMP_SPACE_USED` bigint(10) NOT NULL
) ENGINE=Aria PAGE_CHECKSUM=0
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2_tmp like t2
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE `t3` (
`e` int(11) DEFAULT NULL
) ENGINE=MyISAM
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1`,`test`.`t2_tmp`,`test`.`t3` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE `t1` (
`ID` bigint(4) NOT NULL,
`USER` varchar(128) NOT NULL,
`HOST` varchar(64) NOT NULL,
`DB` varchar(64),
`COMMAND` varchar(16) NOT NULL,
`TIME` int(7) NOT NULL,
`STATE` varchar(64),
`INFO` longtext,
`TIME_MS` decimal(22,3) NOT NULL,
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
`MEMORY_USED` bigint(10) NOT NULL,
`MAX_MEMORY_USED` bigint(10) NOT NULL,
`EXAMINED_ROWS` bigint(10) NOT NULL,
`SENT_ROWS` bigint(10) NOT NULL,
`QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
`TID` bigint(10) NOT NULL,
`TMP_SPACE_USED` bigint(10) NOT NULL
) ENGINE=Aria PAGE_CHECKSUM=0
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2_tmp like t2
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE `t3` (
`e` int(11) DEFAULT NULL
) ENGINE=MyISAM
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1`,`test`.`t2_tmp`,`test`.`t3` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */