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

Assertion `cur_sj_inner_tables == 0' failed in JOIN::dbug_verify_sj_inner_tables

    XMLWordPrintable

Details

    Description

      Often seen. The testcase reproduces in debug builds only.

      SET optimizer_search_depth=1;
      SELECT * FROM INFORMATION_SCHEMA.FILES WHERE LOGFILE_GROUP_NAME IN (SELECT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE  TABLESPACE_NAME IN (SELECT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN (NULL)));
      

      Leads to:

      10.10.0 2db18fdb3d68d906fbd188ec570a64502ba55849 (Debug)

      mysqld: /test/bb-10.10-MDEV-28883_dbg/sql/opt_subselect.cc:3612: void JOIN::dbug_verify_sj_inner_tables(uint) const: Assertion `cur_sj_inner_tables == 0' failed.
      

      10.10.0 2db18fdb3d68d906fbd188ec570a64502ba55849 (Debug)

      Core was generated by `/test/MDEV-28883_MD280622-mariadb-10.10.0-linux-x86_64-dbg/bin/mysqld --no-defa'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14e6ee20b700 (LWP 2492986))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014e70ad75859 in __GI_abort () at abort.c:79
      #2  0x000014e70ad75729 in __assert_fail_base (fmt=0x14e70af0b588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5619fc3953f5 "cur_sj_inner_tables == 0", file=0x5619fc395550 "/test/bb-10.10-MDEV-28883_dbg/sql/opt_subselect.cc", line=3612, function=<optimized out>) at assert.c:92
      #3  0x000014e70ad86fd6 in __GI___assert_fail (assertion=assertion@entry=0x5619fc3953f5 "cur_sj_inner_tables == 0", file=file@entry=0x5619fc395550 "/test/bb-10.10-MDEV-28883_dbg/sql/opt_subselect.cc", line=line@entry=3612, function=function@entry=0x5619fc395d48 "void JOIN::dbug_verify_sj_inner_tables(uint) const") at assert.c:101
      #4  0x00005619fb929b27 in JOIN::dbug_verify_sj_inner_tables (this=0x14e6b8036ce0, prefix_size=prefix_size@entry=1) at /test/bb-10.10-MDEV-28883_dbg/sql/opt_subselect.cc:3612
      #5  0x00005619fb929c6d in update_sj_state (join=join@entry=0x14e6b8036ce0, new_tab=new_tab@entry=0x14e6b8042518, idx=idx@entry=0, remaining_tables=remaining_tables@entry=7) at /test/bb-10.10-MDEV-28883_dbg/sql/opt_subselect.cc:3048
      #6  0x00005619fb7c9166 in greedy_search (use_cond_selectivity=<optimized out>, prune_level=<optimized out>, search_depth=1, remaining_tables=7, join=0x14e6b8036ce0) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:9241
      #7  choose_plan (join=join@entry=0x14e6b8036ce0, join_tables=<optimized out>) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:8752
      #8  0x00005619fb928dd9 in optimize_semijoin_nests (join=join@entry=0x14e6b8036ce0, all_table_map=all_table_map@entry=7) at /test/bb-10.10-MDEV-28883_dbg/sql/opt_subselect.cc:2481
      #9  0x00005619fb7f438c in make_join_statistics (join=join@entry=0x14e6b8036ce0, tables_list=@0x14e6b8014098: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14e6b8017b80, last = 0x14e6b803bc40, elements = 3}, <No data fields>}, keyuse_array=keyuse_array@entry=0x14e6b8037000) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:5931
      #10 0x00005619fb7fb432 in JOIN::optimize_inner (this=this@entry=0x14e6b8036ce0) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:2506
      #11 0x00005619fb7fb872 in JOIN::optimize (this=this@entry=0x14e6b8036ce0) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:1848
      #12 0x00005619fb7fb965 in mysql_select (thd=thd@entry=0x14e6b8000db8, tables=0x14e6b8014470, fields=@0x14e6b8014120: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14e6b8014410, last = 0x14e6b803a4c0, elements = 38}, <No data fields>}, conds=0x14e6b8017640, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x14e6b8017b58, unit=0x14e6b8004fe0, select_lex=0x14e6b8013e78) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:5033
      #13 0x00005619fb7fc1ae in handle_select (thd=thd@entry=0x14e6b8000db8, lex=lex@entry=0x14e6b8004f00, result=result@entry=0x14e6b8017b58, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_select.cc:579
      #14 0x00005619fb768b30 in execute_sqlcom_select (thd=thd@entry=0x14e6b8000db8, all_tables=0x14e6b8014470) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_parse.cc:6017
      #15 0x00005619fb774ea4 in mysql_execute_command (thd=thd@entry=0x14e6b8000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_parse.cc:3939
      #16 0x00005619fb762ec5 in mysql_parse (thd=thd@entry=0x14e6b8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e6ee20a460) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_parse.cc:7797
      #17 0x00005619fb77041a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e6b8000db8, packet=packet@entry=0x14e6b800b6e9 "SELECT * FROM INFORMATION_SCHEMA.FILES WHERE LOGFILE_GROUP_NAME IN (SELECT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE  TABLESPACE_NAME IN (SELECT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PA"..., packet_length=packet_length@entry=239, blocking=blocking@entry=true) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_class.h:1364
      #18 0x00005619fb772b27 in do_command (thd=0x14e6b8000db8, blocking=blocking@entry=true) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_parse.cc:1405
      #19 0x00005619fb8d1948 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5619ff8dc018, put_in_cache=put_in_cache@entry=true) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_connect.cc:1418
      #20 0x00005619fb8d1e51 in handle_one_connection (arg=0x5619ff8dc018) at /test/bb-10.10-MDEV-28883_dbg/sql/sql_connect.cc:1312
      #21 0x000014e70b286609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #22 0x000014e70ae72133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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