|
create table t1 (tm datetime, id int);
|
insert into t1(id) values (1),(2); #not important
|
create procedure sp ()
|
WITH cte1 AS (SELECT COUNT(*), @@max_connections FROM information_schema.processlist),
|
cte AS (
|
WITH
|
tb1 AS (SELECT MAX(id) id FROM t1),
|
tb2 AS (SELECT tm FROM tb1 JOIN t1 USING (id)),
|
tb3 AS (SELECT tb2.* FROM tb2)
|
SELECT 1 value, 2 message FROM tb3)
|
SELECT value FROM cte UNION ALL SELECT message FROM cte;
|
|
call sp();
|
call sp();
|
10.4/10.5 crashes (debug/non-debug), 10.3 returns result as expected, but 10.2 returns the error:
'call sp()' failed: 1457: Failed to load routine test.sp. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
|
repeatable with Myisam/Innodb/Memory
|
10.4
|
210310 13:05:48 [ERROR] mysqld got signal 11 ;
|
|
Server version: 10.4.19-MariaDB-debug-log
|
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7f8926a51730]
|
sql/sql_select.cc:4082(JOIN::reinit())[0x55a9ccea757c]
|
sql/sql_union.cc:1449(st_select_lex_unit::optimize())[0x55a9cd089edf]
|
sql/sql_union.cc:1507(st_select_lex_unit::exec())[0x55a9cd08aa64]
|
sql/sql_union.cc:41(mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long))[0x55a9cd07b8f4]
|
sql/sql_select.cc:400(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55a9cce7f289]
|
sql/sql_parse.cc:6444(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55a9ccdf29e4]
|
sql/sql_parse.cc:3963(mysql_execute_command(THD*))[0x55a9ccde06e2]
|
sql/sp_head.cc:3687(sp_instr_stmt::exec_core(THD*, unsigned int*))[0x55a9ccbac150]
|
sql/sp_head.cc:3419(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x55a9ccbaa970]
|
sql/sp_head.cc:3593(sp_instr_stmt::execute(THD*, unsigned int*))[0x55a9ccbab8ff]
|
sql/sp_head.cc:1364(sp_head::execute(THD*, bool))[0x55a9ccb9d481]
|
sql/sp_head.cc:2370(sp_head::execute_procedure(THD*, List<Item>*))[0x55a9ccba3418]
|
sql/sql_parse.cc:3052(do_execute_sp(THD*, sp_head*))[0x55a9ccdd9e5f]
|
sql/sql_parse.cc:3294(Sql_cmd_call::execute(THD*))[0x55a9ccddb96b]
|
sql/sql_parse.cc:6187(mysql_execute_command(THD*))[0x55a9ccdf03df]
|
sql/sql_parse.cc:7985(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55a9ccdfbaf7]
|
sql/sql_parse.cc:1858(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55a9ccdd2d43]
|
sql/sql_parse.cc:1373(do_command(THD*))[0x55a9ccdcf7c2]
|
sql/sql_connect.cc:1412(do_handle_one_connection(CONNECT*))[0x55a9cd1b0181]
|
sql/sql_connect.cc:1317(handle_one_connection)[0x55a9cd1afa23]
|
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x55a9ce7f4c45]
|
nptl/pthread_create.c:487(start_thread)[0x7f8926a46fa3]
|
x86_64/clone.S:97(clone)[0x7f892604d4cf]
|
|
Query (0x625000122190): WITH cte1 AS (SELECT COUNT(*), @@max_connections FROM information_schema.processlist),
|
cte AS (
|
WITH
|
tb1 AS (SELECT MAX(id) id FROM t1),
|
tb2 AS (SELECT tm FROM tb1 JOIN t1 USING (id)),
|
tb3 AS (SELECT tb2.* FROM tb2)
|
SELECT 1 value, 2 message FROM tb3)
|
SELECT value FROM cte UNION ALL SELECT message FROM cte
|
|
also with ps:
sql/sql_select.cc:4082(JOIN::reinit())[0x5617672bee84]
|
sql/sql_union.cc:1449(st_select_lex_unit::optimize())[0x5617674a9cef]
|
sql/sql_union.cc:1507(st_select_lex_unit::exec())[0x5617674aa8a8]
|
sql/sql_union.cc:41(mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long))[0x56176749b42a]
|
sql/sql_select.cc:400(handle_select(THD*, LEX*, select_result*, unsigned long))[0x56176729668d]
|
sql/sql_parse.cc:6444(execute_sqlcom_select(THD*, TABLE_LIST*))[0x561767206597]
|
sql/sql_parse.cc:3963(mysql_execute_command(THD*))[0x5617671f429b]
|
sql/sql_prepare.cc:4996(Prepared_statement::execute(String*, bool))[0x561767262d3b]
|
sql/sql_prepare.cc:4465(Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*))[0x56176725e1fb]
|
sql/sql_prepare.cc:3567(mysql_sql_stmt_execute(THD*))[0x56176725810a]
|
sql/sql_parse.cc:3980(mysql_execute_command(THD*))[0x5617671f42e0]
|
sql/sql_parse.cc:7985(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x56176720fa2f]
|
sql/sql_parse.cc:1858(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5617671e660a]
|
sql/sql_parse.cc:1373(do_command(THD*))[0x5617671e30b9]
|
sql/sql_connect.cc:1412(do_handle_one_connection(CONNECT*))[0x5617675d5f88]
|
sql/sql_connect.cc:1317(handle_one_connection)[0x5617675d582c]
|
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x561768c96bfb]
|
nptl/pthread_create.c:478(start_thread)[0x7f9d20f84609]
|
x86_64/clone.S:97(__GI___clone)[0x7f9d20740293]
|
|