Bug #68695 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' fails
Submitted: 17 Mar 2013 0:15 Modified: 17 Apr 2013 13:50
Reporter: Elena Stepanova Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.6.10-debug OS:Any
Assigned to: CPU Architecture:Any

[17 Mar 2013 0:15] Elena Stepanova
Description:
mysqld: bzr/mysql-5.6/sql/handler.cc:4065: int handler::ha_end_bulk_insert(): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1' failed.
mysqld got signal 6 ;

#5  0x00007f512e588b8b in __GI_abort () at abort.c:91
#6  0x00007f512e57e0ee in __assert_fail_base (fmt=<optimized out>, assertion=0xe50300 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1", file=0xe4ede8 "bzr/mysql-5.6/sql/handler.cc", line=<optimized out>, function=<optimized out>) at assert.c:94
#7  0x00007f512e57e192 in __GI___assert_fail (assertion=0xe50300 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 1", file=0xe4ede8 "bzr/mysql-5.6/sql/handler.cc", line=4065, function=0xe51ca0 "int handler::ha_end_bulk_insert()") at assert.c:103
#8  0x000000000061a4f1 in handler::ha_end_bulk_insert (this=0x7f510c016250) at bzr/mysql-5.6/sql/handler.cc:4064
#9  0x000000000078693a in select_insert::abort_result_set (this=0x7f510c005a68) at bzr/mysql-5.6/sql/sql_insert.cc:3783
#10 0x0000000000787fad in select_create::abort_result_set (this=0x7f510c005a68) at bzr/mysql-5.6/sql/sql_insert.cc:4322
#11 0x00000000007c802d in handle_select (thd=0x2857680, result=0x7f510c005a68, setup_tables_done_option=0) at bzr/mysql-5.6/sql/sql_select.cc:116
#12 0x000000000079e332 in mysql_execute_command (thd=0x2857680) at bzr/mysql-5.6/sql/sql_parse.cc:2979
#13 0x00000000007a6adb in mysql_parse (thd=0x2857680, rawbuf=0x7f510c004fd0 "CREATE TABLE tmp SELECT 1 FROM DUAL WHERE EXP( 2000 )", length=53, parser_state=0x7f512291b110) at bzr/mysql-5.6/sql/sql_parse.cc:6149
#14 0x000000000079a802 in dispatch_command (command=COM_QUERY, thd=0x2857680, packet=0x29287e1 "CREATE TABLE tmp SELECT 1 FROM DUAL WHERE EXP( 2000 )", packet_length=53) at bzr/mysql-5.6/sql/sql_parse.cc:1334
#15 0x0000000000799952 in do_command (thd=0x2857680) at bzr/mysql-5.6/sql/sql_parse.cc:1036
#16 0x0000000000764ad5 in do_handle_one_connection (thd_arg=0x2857680) at bzr/mysql-5.6/sql/sql_connect.cc:969
#17 0x00000000007644fa in handle_one_connection (arg=0x2857680) at bzr/mysql-5.6/sql/sql_connect.cc:885
#18 0x0000000000af686c in pfs_spawn_thread (arg=0x2901950) at bzr/mysql-5.6/storage/perfschema/pfs.cc:1853
#19 0x00007f512f127e9a in start_thread (arg=0x7f512291c700) at pthread_create.c:308
#20 0x00007f512e642cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

How to repeat:
CREATE TABLE tmp SELECT 1 FROM DUAL WHERE EXP( 2000 );
[17 Mar 2013 9:10] MySQL Verification Team
Verified!

Version: '5.7.2-m12-debug'  socket: ''  port: 3306  MySQL Community Server (GPL)
Assertion failed: table_share->tmp_table != NO_TMP_TABLE || m_lock_type == 2, file handler.cc, line 4194
mysqld-debug.exe!my_sigabrt_handler()[my_thr_init.c:516]
mysqld-debug.exe!raise()[winsig.c:593]
mysqld-debug.exe!abort()[abort.c:81]
mysqld-debug.exe!_wassert()[assert.c:153]
mysqld-debug.exe!handler::ha_end_bulk_insert()[handler.cc:4194]
mysqld-debug.exe!select_insert::abort_result_set()[sql_insert.cc:2076]
mysqld-debug.exe!select_create::abort_result_set()[sql_insert.cc:2638]
mysqld-debug.exe!handle_select()[sql_select.cc:119]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:2868]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5957]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1332]
mysqld-debug.exe!do_command()[sql_parse.cc:1026]
mysqld-debug.exe!do_handle_one_connection()[sql_connect.cc:982]
mysqld-debug.exe!handle_one_connection()[sql_connect.cc:899]
mysqld-debug.exe!pfs_spawn_thread()[pfs.cc:1924]
mysqld-debug.exe!pthread_start()[my_winthread.c:62]
mysqld-debug.exe!_callthreadstartex()[threadex.c:314]
mysqld-debug.exe!_threadstartex()[threadex.c:297]
[17 Apr 2013 13:50] Paul DuBois
Noted in 5.6.12, 5.7.2 changelogs.

For debug builds, metadata locking for CREATE TABLE ... SELECT could 
raise an assertion.