Bug #81454 st_select_lex_unit::exec(): Assertion `0' failed. in st_select_lex_unit::exec

Submitted: 17 May 2016 7:19 Modified: 16 Dec 2019 22:37
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.5.49 OS:Any
Assigned to: CPU Architecture:Any

[17 May 2016 7:19] Roel Van de Paar
Description:
mysqld: /git/mysql-server/sql/sql_union.cc:481: bool st_select_lex_unit::exec(): Assertion `0' failed.
07:05:02 UTC - mysqld got signal 6 ;

+bt
#0  0x00007f7f95807741 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x00000000007de0c8 in my_write_core (sig=6) at /git/mysql-server/mysys/stacktrace.c:433
#2  0x00000000006a1088 in handle_fatal_signal (sig=6) at /git/mysql-server/sql/signal_handler.cc:247
#3  <signal handler called>
#4  0x00007f7f948285f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5  0x00007f7f94829ce8 in __GI_abort () at abort.c:90
#6  0x00007f7f94821566 in __assert_fail_base (fmt=0x7f7f94971228 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0xb0df21 "0", file=file@entry=0xa950f0 "/git/mysql-server/sql/sql_union.cc", line=line@entry=481, function=function@entry=0xa952a0 <st_select_lex_unit::exec()::__PRETTY_FUNCTION__> "bool st_select_lex_unit::exec()") at assert.c:92
#7  0x00007f7f94821612 in __GI___assert_fail (assertion=0xb0df21 "0", file=0xa950f0 "/git/mysql-server/sql/sql_union.cc", line=481, function=0xa952a0 <st_select_lex_unit::exec()::__PRETTY_FUNCTION__> "bool st_select_lex_unit::exec()") at assert.c:101
#8  0x00000000006032e3 in st_select_lex_unit::exec (this=this@entry=0x7f7efba18be8) at /git/mysql-server/sql/sql_union.cc:481
#9  0x00000000005ccbe0 in mysql_explain_union (thd=thd@entry=0x7f7f007a8000, unit=unit@entry=0x7f7efba18be8, result=result@entry=0x7f7efba7a9b0) at /git/mysql-server/sql/sql_select.cc:17384
#10 0x00000000005d00a9 in select_describe (join=join@entry=0x7f7efba5e010, need_tmp_table=<optimized out>, need_tmp_table@entry=false, need_order=<optimized out>, need_order@entry=false, distinct=distinct@entry=false, message=<optimized out>, message@entry=0xa8da58 "Impossible WHERE noticed after reading const tables") at /git/mysql-server/sql/sql_select.cc:17343
#11 0x00000000005d07ff in return_zero_rows (having=0x0, info=0xa8da58 "Impossible WHERE noticed after reading const tables", select_options=268435460, send_row=false, fields=..., tables=0x7f7efba182e8, result=0x7f7efba7a9b0, join=0x7f7efba5e010) at /git/mysql-server/sql/sql_select.cc:7599
#12 JOIN::exec (this=0x7f7efba5e010) at /git/mysql-server/sql/sql_select.cc:1929
#13 0x000000000060347f in st_select_lex_unit::exec (this=this@entry=0x7f7f007a9a58) at /git/mysql-server/sql/sql_union.cc:547
#14 0x00000000005ccbe0 in mysql_explain_union (thd=thd@entry=0x7f7f007a8000, unit=0x7f7f007a9a58, result=result@entry=0x7f7efba7a9b0) at /git/mysql-server/sql/sql_select.cc:17384
#15 0x000000000058396f in execute_sqlcom_select (thd=thd@entry=0x7f7f007a8000, all_tables=0x7f7efba182e8) at /git/mysql-server/sql/sql_parse.cc:4595
#16 0x00000000005899c6 in mysql_execute_command (thd=thd@entry=0x7f7f007a8000) at /git/mysql-server/sql/sql_parse.cc:2176
#17 0x0000000000590ff6 in mysql_parse (thd=thd@entry=0x7f7f007a8000, rawbuf=<optimized out>, length=148, parser_state=parser_state@entry=0x7f7f95e18680) at /git/mysql-server/sql/sql_parse.cc:5780
#18 0x0000000000592843 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f7f007a8000, packet=packet@entry=0x7f7f0079a041 "", packet_length=packet_length@entry=148) at /git/mysql-server/sql/sql_parse.cc:1038
#19 0x00000000005946cc in do_command (thd=0x7f7f007a8000) at /git/mysql-server/sql/sql_parse.cc:773
#20 0x000000000063c978 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f7f007a8000) at /git/mysql-server/sql/sql_connect.cc:862
#21 0x000000000063ca35 in handle_one_connection (arg=0x7f7f007a8000) at /git/mysql-server/sql/sql_connect.cc:781
#22 0x00007f7f95802dc5 in start_thread (arg=0x7f7f95e19700) at pthread_create.c:308
#23 0x00007f7f948e921d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
set storage_engine=MyISAM;
set local max_join_size=1;
CREATE TABLE t1(a int,b int,c int,KEY(a),KEY(b));
INSERT INTO t1 VALUES(0,0,0);
explain extended select * FROM t1 where a in(select a FROM t1 union select a FROM t1 order by (select a)) union select * FROM t1 order by (select a);
[17 May 2016 8:03] MySQL Verification Team
Hello Roel,

Thank you for the report and test case.
Observed that 5.5.49(also, 5.5.51 daily build) debug build is
affected.

Thanks,
Umesh
[17 May 2016 8:04] MySQL Verification Team
I'm not able to repeat this issue on 5.6.30/5.7.12 release/debug builds
with the provided test case.
[16 Dec 2019 22:37] Roy Lyseng
Posted by developer:
 
Fixed in 5.6.30

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.