Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39605

Assertion `!tbl->nested_join || tbl->sj_on_expr' failed

    XMLWordPrintable

Details

    • Bug
    • Status: In Progress (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • N/A
    • Optimizer
    • 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/opt_table_elimination.cc:858: bool eliminate_tables_for_list(JOIN*, List<TABLE_LIST>, table_map, Item, table_map, Json_writer_array*): Assertion `!tbl->nested_join || tbl->sj_on_expr' failed.
      260514 11:35:46 [ERROR] ./sql/mariadbd got signal 6 ;

      Version:

      ----------------
      Branch : 13.2-mdev-39014-full-join-p2
      commit : 95ab071bead67a564f7a8fbcb0a6fc3b377efbe2
      Version : 13.0.1

      How to Repro:

      ---------------

      create table A(pk int);
      SELECT * FROM ( A , ( SELECT alias1.pk FROM A as alias1 FULL JOIN A on(1) ) as dt);
      

      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="!tbl->nested_join || tbl->sj_on_expr", 
          file=file@entry="/home/ppandith/wl-39014/sql/opt_table_elimination.cc", line=line@entry=858, 
          function=function@entry="bool eliminate_tables_for_list(JOIN*, List<TABLE_LIST>*, table_map, Item*, table_map, Json_writer_array*)") at ./assert/assert.c:96
      #12 __assert_fail (assertion="!tbl->nested_join || tbl->sj_on_expr", file="/home/ppandith/wl-39014/sql/opt_table_elimination.cc", 
          line=858, function="bool eliminate_tables_for_list(JOIN*, List<TABLE_LIST>*, table_map, Item*, table_map, Json_writer_array*)")
          at ./assert/assert.c:105
      #13 eliminate_tables_for_list (join=, join_list=, list_tables=7, on_expr=, tables_used_elsewhere=3, trace_eliminate_tables=)
          at /home/ppandith/wl-39014/sql/opt_table_elimination.cc:858
      #14 eliminate_tables (join=) at /home/ppandith/wl-39014/sql/opt_table_elimination.cc:765
      #15 make_join_statistics (join=, tables_list=..., keyuse_array=) at /home/ppandith/wl-39014/sql/sql_select.cc:6032
      #16 JOIN::optimize_inner (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:2882
      #17 JOIN::optimize (this=) at /home/ppandith/wl-39014/sql/sql_select.cc:2132
      #18 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:5544
      #19 handle_select (thd=, lex=, result=, setup_tables_done_option=0) at /home/ppandith/wl-39014/sql/sql_select.cc:752
      #20 execute_sqlcom_select (thd=, all_tables=) at /home/ppandith/wl-39014/sql/sql_parse.cc:6213
      #21 mysql_execute_command (thd=, is_called_from_prepared_stmt=false) at /home/ppandith/wl-39014/sql/sql_parse.cc:3989
      #22 mysql_parse (thd=, rawbuf="SELECT * FROM ( A , ( SELECT alias1.pk FROM A as alias1 FULL JOIN A on(1) ) as dt)", length=82, 
          parser_state=) at /home/ppandith/wl-39014/sql/sql_parse.cc:7941
      #23 dispatch_command (command=COM_QUERY, thd=, 
          packet="SELECT * FROM ( A , ( SELECT alias1.pk FROM A as alias1 FULL JOIN A on(1) ) as dt)", packet_length=82, blocking=true)
          at /home/ppandith/wl-39014/sql/sql_parse.cc:1898
      #24 do_command (thd=, blocking=true) at /home/ppandith/wl-39014/sql/sql_parse.cc:1432
      #25 do_handle_one_connection (connect=, put_in_cache=true) at /home/ppandith/wl-39014/sql/sql_connect.cc:1503
      #26 handle_one_connection (arg=) at /home/ppandith/wl-39014/sql/sql_connect.cc:1415
      #27 pfs_spawn_thread (arg=) at /home/ppandith/wl-39014/storage/perfschema/pfs.cc:2198
      #28 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #29 clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.