Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
-
None
-
Can result in hang or crash
-
Q2/2026 Server Development
Description
Server Crash seen while testing MDEV-39014
Issue:
---------
mariadbd: /home/ppandith/wl-39014/sql/sql_select.cc:12399: enum_best_search best_extension_by_limited_search(JOIN*, table_map, uint, double, double, uint, uint, table_map*): Assertion `found_tables > 0' failed.
Version:
----------------
Branch : 13.2-mdev-39014-full-join-p2
commit : c6bfb113af1fa1b386949060c374981b05e8a06d
Version : 13.0.1
How to Repro:
---------------
create table t1 (pk int); |
create table t2 (pk int); |
create table t3 (pk int); |
create table t4 (pk int); |
|
|
insert into t1 values (1) ,(2); |
|
|
SELECT MAX( t3.pk ) FROM t1 FULL JOIN t2 FULL JOIN t3 ON t2.`pk` = t3.`pk` FULL JOIN t1 AS alias5 FULL JOIN t4 ON (1) ON t3.pk = alias5.pk ON t1.`pk` = alias5.pk; |
Stack trace:
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
|
#1 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
|
#2 __GI___pthread_kill (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
|
#3 my_write_core (sig=6) at /home/ppandith/wl-39014/mysys/stacktrace.c:424
|
#4 handle_fatal_signal (sig=6) at /home/ppandith/wl-39014/sql/signal_handler.cc:298
|
#5 <signal handler called>
|
#6 __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
|
#7 __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
|
#8 __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
|
#9 __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
|
#10 __GI_abort () at ./stdlib/abort.c:79
|
#11 __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry="found_tables > 0",
|
file=file@entry="/home/ppandith/wl-39014/sql/sql_select.cc", line=line@entry=12399,
|
function=function@entry="enum_best_search best_extension_by_limited_search(JOIN*, table_map, uint, double, double, uint, uint, table_map*)") at ./assert/assert.c:96
|
#12 __assert_fail (assertion="found_tables > 0", file="/home/ppandith/wl-39014/sql/sql_select.cc", line=12399,
|
function="enum_best_search best_extension_by_limited_search(JOIN*, table_map, uint, double, double, uint, uint, table_map*)")
|
at ./assert/assert.c:105
|
#13 best_extension_by_limited_search (join=, remaining_tables=25, idx=2, record_count=1, read_time=0.022035600000000002,
|
search_depth=60, use_cond_selectivity=4, processed_eq_ref_tables=) at /home/ppandith/wl-39014/sql/sql_select.cc:12399
|
#14 best_extension_by_limited_search (join=, remaining_tables=29, idx=1, record_count=1, read_time=0.011017800000000001,
|
search_depth=61, use_cond_selectivity=4, processed_eq_ref_tables=) at /home/ppandith/wl-39014/sql/sql_select.cc:12619
|
#15 best_extension_by_limited_search (join=, remaining_tables=31, idx=0, record_count=1, read_time=0, search_depth=62,
|
use_cond_selectivity=4, processed_eq_ref_tables=) at /home/ppandith/wl-39014/sql/sql_select.cc:12619
|
#16 greedy_search (join=, remaining_tables=31, search_depth=62, use_cond_selectivity=4)
|
at /home/ppandith/wl-39014/sql/sql_select.cc:11041
|
#17 choose_plan (join=, join_tables=31, emb_sjm_nest=) at /home/ppandith/wl-39014/sql/sql_select.cc:10546
|
#18 make_join_statistics (join=, tables_list=..., keyuse_array=) at /home/ppandith/wl-39014/sql/sql_select.cc:6543
|
#19 JOIN::optimize_inner (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:2883
|
#20 JOIN::optimize (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:2133
|
#21 mysql_select (thd=, tables=, fields=..., conds=, og_num=0, order=, group=, having=, proc_param=, select_options=2164525824,
|
result=, unit=, select_lex=) at /home/ppandith/wl-39014/sql/sql_select.cc:5545
|
#22 handle_select (thd=, lex=, result=, setup_tables_done_option=0) at /home/ppandith/wl-39014/sql/sql_select.cc:753
|
#23 execute_sqlcom_select (thd=, all_tables=) at /home/ppandith/wl-39014/sql/sql_parse.cc:6213
|
#24 mysql_execute_command (thd=, is_called_from_prepared_stmt=false) at /home/ppandith/wl-39014/sql/sql_parse.cc:3989
|
#25 mysql_parse (thd=,
|
rawbuf="SELECT MAX( t3.pk ) FROM t1 FULL JOIN t2 FULL JOIN t3 ON t2.`pk` = t3.`pk` FULL JOIN t1 AS alias5 FULL JOIN t4 ON (1) ON t3.pk = alias5.pk ON t1.`pk` = alias5.pk", length=162, parser_state=) at /home/ppandith/wl-39014/sql/sql_parse.cc:7941
|
#26 dispatch_command (command=COM_QUERY, thd=,
|
packet="SELECT MAX( t3.pk ) FROM t1 FULL JOIN t2 FULL JOIN t3 ON t2.`pk` = t3.`pk` FULL JOIN t1 AS alias5 FULL JOIN t4 ON (1) ON t3.pk = alias5.pk ON t1.`pk` = alias5.pk", packet_length=162, blocking=true) at /home/ppandith/wl-39014/sql/sql_parse.cc:1898
|
#27 do_command (thd=, blocking=true) at /home/ppandith/wl-39014/sql/sql_parse.cc:1432
|
#28 do_handle_one_connection (connect=, put_in_cache=true) at /home/ppandith/wl-39014/sql/sql_connect.cc:1503
|
#29 handle_one_connection (arg=) at /home/ppandith/wl-39014/sql/sql_connect.cc:1415
|
#30 pfs_spawn_thread (arg=) at /home/ppandith/wl-39014/storage/perfschema/pfs.cc:2198
|
#31 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
|
#32 clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
|
Attachments
Issue Links
- is caused by
-
MDEV-39014 FULL JOIN Algorithm, Phase 2
-
- In Review
-