[MDEV-17314] Assertion `thd->transaction.stmt.is_empty()' failed in Locked_tables_list::unlock_locked_tables upon CREATE OR REPLACE TEMPORARY TABLE Created: 2018-09-27  Updated: 2018-10-16  Resolved: 2018-10-16

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table, Data Definition - Temporary, Locking
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.0.37, 10.1.37

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-11071 Assertion `thd->transaction.stmt.is_e... Closed
Relates
relates to MDEV-16794 Assertion `thd->transaction.stmt.is_e... Closed

 Description   

Note: might be related to, or be a duplicate of, MDEV-16794, but these assertion failures tend to be mixed up or partially fixed, so I'm filing it separately just in case.

--source include/have_innodb.inc
 
CREATE TEMPORARY TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (b INT);
LOCK TABLE t2 READ;
--error ER_INVALID_DEFAULT
CREATE OR REPLACE TEMPORARY TABLE t1 (c INT DEFAULT '');

10.0 1144acbcb

mysqld: /data/src/10.0/sql/sql_base.cc:2793: void Locked_tables_list::unlock_locked_tables(THD*): Assertion `thd->transaction.stmt.is_empty()' failed.
180927 20:56:43 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f233d38dee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x00000000005ec820 in Locked_tables_list::unlock_locked_tables (this=0x7f2331f40878, thd=0x7f2331f3d070) at /data/src/10.0/sql/sql_base.cc:2793
#9  0x00000000005ec8a5 in Locked_tables_list::unlock_locked_table (this=0x7f2331f40878, thd=0x7f2331f3d070, mdl_ticket=0x0) at /data/src/10.0/sql/sql_base.cc:2836
#10 0x00000000006fd492 in mysql_create_table (thd=0x7f2331f3d070, create_table=0x7f23290fa1a0, create_info=0x7f233f452d20, alter_info=0x7f233f452c90) at /data/src/10.0/sql/sql_table.cc:5096
#11 0x000000000064e49b in mysql_execute_command (thd=0x7f2331f3d070) at /data/src/10.0/sql/sql_parse.cc:3035
#12 0x0000000000657c14 in mysql_parse (thd=0x7f2331f3d070, rawbuf=0x7f23290fa088 "CREATE OR REPLACE TEMPORARY TABLE t1 (c INT DEFAULT '')", length=55, parser_state=0x7f233f453640) at /data/src/10.0/sql/sql_parse.cc:6637
#13 0x000000000064a534 in dispatch_command (command=COM_QUERY, thd=0x7f2331f3d070, packet=0x7f2332260071 "CREATE OR REPLACE TEMPORARY TABLE t1 (c INT DEFAULT '')", packet_length=55) at /data/src/10.0/sql/sql_parse.cc:1300
#14 0x0000000000649834 in do_command (thd=0x7f2331f3d070) at /data/src/10.0/sql/sql_parse.cc:1003
#15 0x000000000076af50 in do_handle_one_connection (thd_arg=0x7f2331f3d070) at /data/src/10.0/sql/sql_connect.cc:1377
#16 0x000000000076acc2 in handle_one_connection (arg=0x7f2331f3d070) at /data/src/10.0/sql/sql_connect.cc:1292
#17 0x0000000000acc98e in pfs_spawn_thread (arg=0x7f2331e801f0) at /data/src/10.0/storage/perfschema/pfs.cc:1861
#18 0x00007f233f091494 in start_thread (arg=0x7f233f454700) at pthread_create.c:333
#19 0x00007f233d44a93f in clone () from /lib/x86_64-linux-gnu/libc.so.6

Reproducible on 10.0, 10.1.
Couldn't reproduce on 10.2, 10.3.
No visible problems on a non-debug build.



 Comments   
Comment by Sergey Vojtovich [ 2018-10-15 ]

This is another duplicate of MDEV-11071, specifically first issue described in that task. It was originally targeted for 10.2, thus there's no fix in 10.0.

Comment by Sergey Vojtovich [ 2018-10-16 ]

Fix backported to 10.0

Generated at Thu Feb 08 08:35:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.