Bug #96682 Assertion "m_where_cond->is_bool_func"
Submitted: 28 Aug 2019 14:52 Modified: 30 Aug 2019 11:09
Reporter: Hrvoje Matijakovic Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S6 (Debug Builds)
Version:8.0.17 OS:Linux
Assigned to: CPU Architecture:x86

[28 Aug 2019 14:52] Hrvoje Matijakovic
Description:
Can't repeat on release build.

gdb:
Core was generated by `/sdc/MS230819-mysql-8.0.17-linux-x86_64-debug/bin/mysqld --no-defaults --basedi'.
Program terminated with signal 6, Aborted.
#0  0x00007feeee8c79d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
59        val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
(gdb) bt
+bt
#0  0x00007feeee8c79d1 in __pthread_kill (threadid=<optimized out>, signo=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:59
#1  0x0000000004580cc8 in my_write_core (sig=6) at /sdc/MS-8.0.17_dbg/mysys/stacktrace.cc:305
#2  0x00000000032f4d64 in handle_fatal_signal (sig=6) at /sdc/MS-8.0.17_dbg/sql/signal_handler.cc:168
#3  <signal handler called>
#4  0x00007feeec9ca2c7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
#5  0x00007feeec9cb9b8 in __GI_abort () at abort.c:90
#6  0x00007feeec9c30e6 in __assert_fail_base (fmt=0x7feeecb1e020 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x57790c8 "m_where_cond->is_bool_func()", file=file@entry=0x5778b28 "/sdc/MS-8.0.17_dbg/sql/sql_resolver.cc", line=line@entry=1344, function=function@entry=0x577a360 <SELECT_LEX::setup_conds(THD*)::__PRETTY_FUNCTION__> "bool SELECT_LEX::setup_conds(THD*)") at assert.c:92
#7  0x00007feeec9c3192 in __GI___assert_fail (assertion=0x57790c8 "m_where_cond->is_bool_func()", file=0x5778b28 "/sdc/MS-8.0.17_dbg/sql/sql_resolver.cc", line=1344, function=0x577a360 <SELECT_LEX::setup_conds(THD*)::__PRETTY_FUNCTION__> "bool SELECT_LEX::setup_conds(THD*)") at assert.c:101
#8  0x000000000317f91e in SELECT_LEX::setup_conds (this=0x7fee92c6c098, thd=0x7fee92c21000) at /sdc/MS-8.0.17_dbg/sql/sql_resolver.cc:1344                                                                                                    #9  0x000000000317c4ce in SELECT_LEX::prepare (this=0x7fee92c6c098, thd=0x7fee92c21000) at /sdc/MS-8.0.17_dbg/sql/sql_resolver.cc:254                                                                                                         #10 0x0000000003190255 in handle_query (thd=0x7fee92c21000, lex=0x7fee92c24800, result=0x7fee92df0530, added_options=0, removed_options=0) at /sdc/MS-8.0.17_dbg/sql/sql_select.cc:171
#11 0x000000000312f754 in execute_show (thd=0x7fee92c21000, all_tables=0x7fee92c6f778) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:4906
#12 0x000000000373483d in Sql_cmd_show::execute (this=0x7fee92c6d258, thd=0x7fee92c21000) at /sdc/MS-8.0.17_dbg/sql/sql_admin.cc:2084
#13 0x000000000312dc73 in mysql_execute_command (thd=0x7fee92c21000, first_level=true) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:4420
#14 0x00000000031304fe in mysql_parse (thd=0x7fee92c21000, parser_state=0x7feeeb36baf0) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:5221
#15 0x0000000003125aa9 in dispatch_command (thd=0x7fee92c21000, com_data=0x7feeeb36cb90, command=COM_QUERY) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:1755
#16 0x000000000312400c in do_command (thd=0x7fee92c21000) at /sdc/MS-8.0.17_dbg/sql/sql_parse.cc:1270
#17 0x00000000032dffcd in handle_connection (arg=0x7fee9b85c5c0) at /sdc/MS-8.0.17_dbg/sql/conn_handler/connection_handler_per_thread.cc:302
#18 0x0000000004d28926 in pfs_spawn_thread (arg=0x7feeea869fe0) at /sdc/MS-8.0.17_dbg/storage/perfschema/pfs.cc:2854
#19 0x00007feeee8c2dd5 in start_thread (arg=0x7feeeb36d700) at pthread_create.c:307
#20 0x00007feeeca9202d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) quit

How to repeat:
CREATE DATABASE test;
USE test;
create TABLE t0(id int);
CREATE TEMPORARY TABLE t0(a int,b int,primary key (a));
show columns from t0 where(select i from t0 where i=0);
[29 Aug 2019 5:53] Umesh Shastry
Hello Hrvoje Matijakovic,

Thank you for the report and test case.
Observed that 8.0.17 debug build is affected.

regards,
Umesh
[30 Aug 2019 11:09] Erlend Dahl
Already fixed in 8.0.18 under the heading of

Bug#29664758 REGRESSION: ASSERTION FAILED: M_WHERE_COND->IS_BOOL_FUNC()