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

Server crashes when using OUTER JOIN with a system-versioned table in Oracle SQL mode

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      SET sql_mode=ORACLE;
      CREATE TABLE t2 (a INT) WITH SYSTEM VERSIONING;
      CREATE TEMPORARY TABLE t1 (a INT);
      SELECT * FROM t1,t2 WHERE t1.a=t2.a(+);
      

      Leads to:

      CS 13.0.0 ef4be39bfcbae1b0090a3098e511d14457d6139f (Debug, Clang 18.1.3-11) Build 06/03/2026

      mariadbd: /test/13.0_dbg/sql/sql_oracle_outer_join.cc:963: bool setup_oracle_join(THD *, Item **, TABLE_LIST *, SQL_I_List<TABLE_LIST> &, List<TABLE_LIST> *, List<Item> *): Assertion `curr->table->on_expr == 0' failed.
      

      CS 13.0.0 ef4be39bfcbae1b0090a3098e511d14457d6139f (Debug, Clang 18.1.3-11) Build 06/03/2026

      Core was generated by `/test/MD060326-mariadb-13.0.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 289015)]
      (gdb) bt
      #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=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x000077553744527e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x00007755374288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000077553742881b in __assert_fail_base (fmt=0x7755375d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5a41ab0574fe "curr->table->on_expr == 0", file=file@entry=0x5a41ab0573d5 "/test/13.0_dbg/sql/sql_oracle_outer_join.cc", line=line@entry=963, function=function@entry=0x5a41ab057441 "bool setup_oracle_join(THD *, Item **, TABLE_LIST *, SQL_I_List<TABLE_LIST> &, List<TABLE_LIST> *, List<Item> *)") at ./assert/assert.c:96
      #6  0x000077553743b517 in __assert_fail (assertion=0x5a41ab0574fe "curr->table->on_expr == 0", file=0x5a41ab0573d5 "/test/13.0_dbg/sql/sql_oracle_outer_join.cc", line=963, function=0x5a41ab057441 "bool setup_oracle_join(THD *, Item **, TABLE_LIST *, SQL_I_List<TABLE_LIST> &, List<TABLE_LIST> *, List<Item> *)") at ./assert/assert.c:105
      #7  0x00005a41a9f2d62e in setup_oracle_join (thd=0x775500000d58, conds=0x7755000197d0, tables=0x7755000174c8, select_table_list=..., select_join_list=0x775500017030, all_fields=0x7755000196e8) at /test/13.0_dbg/sql/sql_oracle_outer_join.cc:963
      #8  0x00005a41a9e7c66e in setup_conds (thd=0x775500000d58, tables=0x7755000174c8, leaves=..., conds=0x7755000197d0, all_fields=0x7755000196e8) at /test/13.0_dbg/sql/sql_base.cc:9046
      #9  0x00005a41a9fabe6a in setup_without_group (thd=0x775500000d58, ref_pointer_array=..., tables=0x7755000174c8, leaves=..., fields=..., all_fields=..., conds=0x7755000197d0, order=0x0, group=0x0, win_specs=..., win_funcs=..., hidden_group_fields=0x775500019697) at /test/13.0_dbg/sql/sql_select.cc:954
      #10 0x00005a41a9faa626 in JOIN::prepare (this=0x775500019340, tables_init=0x7755000174c8, conds_init=0x7755000186f0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x775500016e78, unit_arg=0x775500005278) at /test/13.0_dbg/sql/sql_select.cc:1603
      #11 0x00005a41a9fa5cd9 in mysql_select (thd=0x775500000d58, tables=0x7755000174c8, fields=..., conds=0x7755000186f0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2164525824, result=0x775500019318, unit=0x775500005278, select_lex=0x775500016e78) at /test/13.0_dbg/sql/sql_select.cc:5410
      #12 0x00005a41a9fa58d5 in handle_select (thd=0x775500000d58, lex=0x775500005198, result=0x775500019318, setup_tables_done_option=0) at /test/13.0_dbg/sql/sql_select.cc:636
      #13 0x00005a41a9f486b1 in execute_sqlcom_select (thd=0x775500000d58, all_tables=0x7755000174c8) at /test/13.0_dbg/sql/sql_parse.cc:6209
      #14 0x00005a41a9f3d42c in mysql_execute_command (thd=0x775500000d58, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:3987
      #15 0x00005a41a9f35624 in mysql_parse (thd=0x775500000d58, rawbuf=0x775500016dd0 "SELECT * FROM t1,t2 WHERE t1.a=t2.a (+)", length=39, parser_state=0x775535fdfab0) at /test/13.0_dbg/sql/sql_parse.cc:7937
      #16 0x00005a41a9f329cd in dispatch_command (command=COM_QUERY, thd=0x775500000d58, packet=0x7755001cab19 "SELECT * FROM t1,t2 WHERE t1.a=t2.a (+)", packet_length=39, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1896
      #17 0x00005a41a9f361d3 in do_command (thd=0x775500000d58, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1432
      #18 0x00005a41aa130919 in do_handle_one_connection (connect=0x5a41d5b35798, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1503
      #19 0x00005a41aa1306be in handle_one_connection (arg=0x5a41d5b1d958) at /test/13.0_dbg/sql/sql_connect.cc:1415
      #20 0x000077553749caa4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #21 0x0000775537529c6c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed             
      CS  10.6   dbg  180326  ef62df967183c5f9d634ebee38922cc27b10046d  No bug found                  
      CS  10.6   opt  180326  ef62df967183c5f9d634ebee38922cc27b10046d  No bug found                  
      CS  10.11  dbg  250326  e06f5b2579b17be6637be6aee4fc712550682023  No bug found                  
      CS  10.11  opt  250326  e06f5b2579b17be6637be6aee4fc712550682023  No bug found                  
      CS  11.4   dbg  250326  606ef8f73981e8de7be059a2ded927e9c5ad00bf  No bug found                  
      CS  11.4   opt  250326  606ef8f73981e8de7be059a2ded927e9c5ad00bf  No bug found                  
      CS  11.8   dbg  250326  b22473cf78eccacc7d7bdad483b670b522d6c08d  No bug found                  
      CS  11.8   opt  250326  b22473cf78eccacc7d7bdad483b670b522d6c08d  No bug found                  
      CS  12.2   dbg  250326  d26a6f44c1f2119377e79a9540886c6d8c01472f  curr->table->on_expr == 0|SIGABRT|setup_oracle_join|setup_conds|setup_without_group|JOIN::prepare
      CS  12.2   opt  250326  d26a6f44c1f2119377e79a9540886c6d8c01472f  No bug found   
      CS  12.3   dbg  020426  669e7aa798f984c0c4178c20f6926b956c8f095e  curr->table->on_expr == 0|SIGABRT|setup_oracle_join|setup_conds|setup_without_group|JOIN::prepare
      CS  12.3   opt  020426  669e7aa798f984c0c4178c20f6926b956c8f095e  No bug found                  
      CS  13.0   dbg  060326  ef4be39bfcbae1b0090a3098e511d14457d6139f  curr->table->on_expr == 0|SIGABRT|setup_oracle_join|setup_conds|setup_without_group|JOIN::prepare
      CS  13.0   opt  060326  ef4be39bfcbae1b0090a3098e511d14457d6139f  No bug found                  
      CS  13.0   opt  270226  d755574c47f101917aee29ea847e214c24c92c0b  No bug found                  
      ES  10.6   dbg  151225  bc33b05c6a65de27dbe811a30bc37c207d60ee8e  No bug found                  
      ES  10.6   opt  151225  bc33b05c6a65de27dbe811a30bc37c207d60ee8e  No bug found                  
      ES  11.4   dbg  151225  714f2134597e00f4ff107886cf3a55eff48e4510  No bug found                  
      ES  11.4   opt  151225  714f2134597e00f4ff107886cf3a55eff48e4510  No bug found                  
      ES  11.8   dbg  151225  4008de1a5b06105a64821db7b851328f1b27d99e  No bug found                  
      ES  11.8   opt  151225  4008de1a5b06105a64821db7b851328f1b27d99e  No bug found                  
      

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.