We're updating the issue view to help you get more done. 

int JOIN::optimize(): Assertion `!tables || thd->lex->is_query_tables_locked()' failed.

Description

1 2 3 4 2016-11-14 10:41:18 25817 [Note] /sda/PS071116-percona-server-5.6.34-79.1-linux-x86_64-debug/bin/mysqld: ready for connections. Version: '5.6.34-79.1-debug' socket: '/sda/PS071116-percona-server-5.6.34-79.1-linux-x86_64-debug/socket.sock' port: 12406 MySQL Community Server (GPL) mysqld: /git/PS-5.6.34_dbg/sql/sql_optimizer.cc:123: int JOIN::optimize(): Assertion `!tables || thd->lex->is_query_tables_locked()' failed. 23:41:25 UTC - mysqld got signal 6 ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 Core was generated by `/sda/PS071116-percona-server-5.6.34-79.1-linux-x86_64-debug/bin/mysqld --no-def'. Program terminated with signal 6, Aborted. #0 0x00007f81931df741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61 61 val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid), (gdb) bt #0 0x00007f81931df741 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61 #1 0x0000000000ac335e in my_write_core (sig=6) at /git/PS-5.6.34_dbg/mysys/stacktrace.c:422 #2 0x00000000007374d7 in handle_fatal_signal (sig=6) at /git/PS-5.6.34_dbg/sql/signal_handler.cc:236 #3 <signal handler called> #4 0x00007f81915765f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #5 0x00007f8191577ce8 in __GI_abort () at abort.c:90 #6 0x00007f819156f566 in __assert_fail_base (fmt=0x7f81916bfce8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xf77aa0 "!tables || thd->lex->is_query_tables_locked()", file=file@entry=0xf77a68 "/git/PS-5.6.34_dbg/sql/sql_optimizer.cc", line=line@entry=123, function=function@entry=0xf78ea0 <JOIN::optimize()::__PRETTY_FUNCTION__> "int JOIN::optimize()") at assert.c:92 #7 0x00007f819156f612 in __GI___assert_fail (assertion=0xf77aa0 "!tables || thd->lex->is_query_tables_locked()", file=0xf77a68 "/git/PS-5.6.34_dbg/sql/sql_optimizer.cc", line=123, function=0xf78ea0 <JOIN::optimize()::__PRETTY_FUNCTION__> "int JOIN::optimize()") at assert.c:101 #8 0x00000000009cb340 in JOIN::optimize (this=0x7f8144079370) at /git/PS-5.6.34_dbg/sql/sql_optimizer.cc:123 #9 0x000000000095cd3b in subselect_single_select_engine::exec (this=0x7f8144020e60) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:2772 #10 0x000000000095614d in Item_subselect::exec (this=0x7f8144020d40) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:643 #11 0x0000000000957645 in Item_singlerow_subselect::val_str (this=0x7f8144020d40, str=0x7f81937ca030) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:1096 #12 0x00000000006e6a7e in Item_func_make_set::val_str (this=0x7f8144020ec0, str=0x7f81937ca030) at /git/PS-5.6.34_dbg/sql/item_strfunc.cc:2985 #13 0x00000000006dce2b in Item_str_func::val_int (this=0x7f8144020ec0) at /git/PS-5.6.34_dbg/sql/item_strfunc.cc:143 #14 0x00000000006579b9 in Item::update_null_value (this=0x7f8144020ec0) at /git/PS-5.6.34_dbg/sql/item.h:1315 #15 0x000000000069706b in Item_func::is_null (this=0x7f8144020ec0) at /git/PS-5.6.34_dbg/sql/item_func.h:168 #16 0x0000000000692475 in Item_is_not_null_test::update_used_tables (this=0x7f8144079d00) at /git/PS-5.6.34_dbg/sql/item_cmpfunc.cc:5260 #17 0x0000000000699d74 in Item_func_isnull::fix_length_and_dec (this=0x7f8144079d00) at /git/PS-5.6.34_dbg/sql/item_cmpfunc.h:1487 #18 0x00000000006b547c in Item_func::fix_fields (this=0x7f8144079d00, thd=0x7f8168f4a000, ref=0x0) at /git/PS-5.6.34_dbg/sql/item_func.cc:231 #19 0x000000000095980d in Item_in_subselect::single_value_in_to_exists_transformer (this=0x7f81440785b8, join=0x7f8144078e18, func=0x1795e78 <eq_creator>) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:1837 #20 0x00000000009590b6 in Item_in_subselect::single_value_transformer (this=0x7f81440785b8, join=0x7f8144078e18, func=0x1795e78 <eq_creator>) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:1690 #21 0x000000000095bb10 in Item_in_subselect::select_in_like_transformer (this=0x7f81440785b8, join=0x7f8144078e18, func=0x1795e78 <eq_creator>) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:2373 #22 0x000000000095b788 in Item_in_subselect::select_transformer (this=0x7f81440785b8, join=0x7f8144078e18) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:2273 #23 0x0000000000816bc7 in resolve_subquery (thd=0x7f8168f4a000, join=0x7f8144078e18) at /git/PS-5.6.34_dbg/sql/sql_resolver.cc:658 #24 0x0000000000815652 in JOIN::prepare (this=0x7f8144078e18, tables_init=0x7f8144078040, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, group_init=0x0, having_init=0x0, select_lex_arg=0x7f814401f1b0, unit_arg=0x7f814401f4c0) at /git/PS-5.6.34_dbg/sql/sql_resolver.cc:244 #25 0x000000000095c736 in subselect_single_select_engine::prepare (this=0x7f8144078728) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:2665 #26 0x0000000000955572 in Item_subselect::fix_fields (this=0x7f81440785b8, thd=0x7f8168f4a000, ref=0x7f8144078768) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:382 #27 0x000000000095bdc6 in Item_in_subselect::fix_fields (this=0x7f81440785b8, thd_arg=0x7f8168f4a000, ref=0x7f8144078768) at /git/PS-5.6.34_dbg/sql/item_subselect.cc:2416 #28 0x00000000007835af in setup_fields (thd=0x7f8168f4a000, ref_pointer_array=..., fields=..., mark_used_columns=MARK_COLUMNS_READ, sum_func_list=0x7f8144078ab8, allow_sum_func=true) at /git/PS-5.6.34_dbg/sql/sql_base.cc:8513 #29 0x0000000000815118 in JOIN::prepare (this=0x7f8144078870, tables_init=0x0, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, group_init=0x0, having_init=0x0, select_lex_arg=0x7f8168f4c8d8, unit_arg=0x7f8168f4c290) at /git/PS-5.6.34_dbg/sql/sql_resolver.cc:168 #30 0x000000000081cb69 in mysql_prepare_select (thd=0x7f8168f4a000, tables=0x0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, select_options=2147748608, result=0x7f8144078848, unit=0x7f8168f4c290, select_lex=0x7f8168f4c8d8, free_join=0x7f81937cb187) at /git/PS-5.6.34_dbg/sql/sql_select.cc:1055 #31 0x000000000081ce37 in mysql_select (thd=0x7f8168f4a000, tables=0x0, wild_num=0, fields=..., conds=0x0, order=0x7f8168f4caa0, group=0x7f8168f4c9d8, having=0x0, select_options=2147748608, result=0x7f8144078848, unit=0x7f8168f4c290, select_lex=0x7f8168f4c8d8) at /git/PS-5.6.34_dbg/sql/sql_select.cc:1178 #32 0x000000000081b082 in handle_select (thd=0x7f8168f4a000, result=0x7f8144078848, setup_tables_done_option=0) at /git/PS-5.6.34_dbg/sql/sql_select.cc:110 #33 0x00000000007f32b8 in execute_sqlcom_select (thd=0x7f8168f4a000, all_tables=0x7f81440207c8) at /git/PS-5.6.34_dbg/sql/sql_parse.cc:5726 #34 0x00000000007eb5c9 in mysql_execute_command (thd=0x7f8168f4a000) at /git/PS-5.6.34_dbg/sql/sql_parse.cc:3023 #35 0x00000000007f5f7f in mysql_parse (thd=0x7f8168f4a000, rawbuf=0x7f814401f010 "SELECT 1 IN(SELECT MAKE_SET(-1,1,(SELECT 1 FROM t1)) FROM t1)", length=61, parser_state=0x7f81937cc500) at /git/PS-5.6.34_dbg/sql/sql_parse.cc:7011 #36 0x00000000007e7c20 in dispatch_command (command=COM_QUERY, thd=0x7f8168f4a000, packet=0x7f81633d8001 "SELECT 1 IN(SELECT MAKE_SET(-1,1,(SELECT 1 FROM t1)) FROM t1)", packet_length=61) at /git/PS-5.6.34_dbg/sql/sql_parse.cc:1455 #37 0x00000000007e6ac1 in do_command (thd=0x7f8168f4a000) at /git/PS-5.6.34_dbg/sql/sql_parse.cc:1062 #38 0x00000000007ae041 in do_handle_one_connection (thd_arg=0x7f8168f4a000) at /git/PS-5.6.34_dbg/sql/sql_connect.cc:1541 #39 0x00000000007adac1 in handle_one_connection (arg=0x7f8168f4a000) at /git/PS-5.6.34_dbg/sql/sql_connect.cc:1444 #40 0x0000000000b11ef1 in pfs_spawn_thread (arg=0x7f8178fff6a0) at /git/PS-5.6.34_dbg/storage/perfschema/pfs.cc:1860 #41 0x00007f81931dadc5 in start_thread (arg=0x7f81937cd700) at pthread_create.c:308 #42 0x00007f8191637ced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
1 2 3 4 # mysqld options required for replay: --plugin-load-add=tokudb=ha_tokudb.so DROP DATABASE test;CREATE DATABASE test;USE test; CREATE TABLE t1(a INT,b INT,c CHAR(1),d BINARY (1),e VARBINARY(1),f VARBINARY(1),g BLOB,h BLOB,id INT,KEY(b),CLUSTERING KEY(e)) ENGINE=tokudb; SELECT 1 IN(SELECT MAKE_SET(-1,1,(SELECT 1 FROM t1)) FROM t1);

Environment

None

Status

Assignee

Vladislav Lesin

Reporter

roel.vandepaar

Labels

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

External issue ID

None

Freshdesk Tickets

None

Affects versions

Percona-Server-5.6.34-79.1

Priority

Major