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

Server crashes in st_join_table::choose_best_splitting (still)

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES
        (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15);
       
      CREATE TABLE t2 (b INT) ENGINE=InnoDB;
      INSERT INTO t2 VALUES (100),(200);
       
      CREATE TABLE t3 (c INT, d INT, KEY(c)) ENGINE=InnoDB;
      INSERT INTO t3 VALUES (1,1),(2,2);
       
      CREATE VIEW v AS SELECT c, d FROM t3 GROUP BY c, d;
       
      SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v);
       
      # Cleanup
      DROP VIEW v;
      DROP TABLE t1, t2, t3;
      

      bb-10.6-release fbe68a6a745

      #3  <signal handler called>
      #4  st_join_table::choose_best_splitting (this=0x7f3c2407c160, idx=2, remaining_tables=4, spl_pd_boundary=0x7f3c7c2f5d40) at /data/src/bb-10.6-release/sql/opt_split.cc:1048
      #5  0x000055b653619ba2 in best_access_path (join=0x7f3c24075e88, s=0x7f3c2407c160, remaining_tables=4, join_positions=0x7f3c2407cca8, idx=2, disable_jbuf=true, record_count=30, pos=0x7f3c2407cf38, loose_scan_pos=0x7f3c7c2f6180) at /data/src/bb-10.6-release/sql/sql_select.cc:7898
      #6  0x000055b6537f56f8 in fix_semijoin_strategies_for_picked_join_order (join=0x7f3c24075e88) at /data/src/bb-10.6-release/sql/opt_subselect.cc:3994
      #7  0x000055b653622f3d in JOIN::get_best_combination (this=0x7f3c24075e88) at /data/src/bb-10.6-release/sql/sql_select.cc:11183
      #8  0x000055b653607cc8 in JOIN::optimize_stage2 (this=0x7f3c24075e88) at /data/src/bb-10.6-release/sql/sql_select.cc:2556
      #9  0x000055b653607b24 in JOIN::optimize_inner (this=0x7f3c24075e88) at /data/src/bb-10.6-release/sql/sql_select.cc:2535
      #10 0x000055b653605244 in JOIN::optimize (this=0x7f3c24075e88) at /data/src/bb-10.6-release/sql/sql_select.cc:1848
      #11 0x000055b653611145 in mysql_select (thd=0x7f3c24000dc8, tables=0x7f3c24015d58, fields=..., conds=0x7f3c24018c10, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3c24075e60, unit=0x7f3c24005138, select_lex=0x7f3c24015740) at /data/src/bb-10.6-release/sql/sql_select.cc:5055
      #12 0x000055b6535ff9fd in handle_select (thd=0x7f3c24000dc8, lex=0x7f3c24005070, result=0x7f3c24075e60, setup_tables_done_option=0) at /data/src/bb-10.6-release/sql/sql_select.cc:559
      #13 0x000055b6535bdab1 in execute_sqlcom_select (thd=0x7f3c24000dc8, all_tables=0x7f3c24015d58) at /data/src/bb-10.6-release/sql/sql_parse.cc:6273
      #14 0x000055b6535b49e5 in mysql_execute_command (thd=0x7f3c24000dc8, is_called_from_prepared_stmt=false) at /data/src/bb-10.6-release/sql/sql_parse.cc:3949
      #15 0x000055b6535c2a8a in mysql_parse (thd=0x7f3c24000dc8, rawbuf=0x7f3c24015660 "SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v)", length=64, parser_state=0x7f3c7c2f7380) at /data/src/bb-10.6-release/sql/sql_parse.cc:8036
      #16 0x000055b6535ae56b in dispatch_command (command=COM_QUERY, thd=0x7f3c24000dc8, packet=0x7f3c2400b8f9 "SELECT * FROM t1 JOIN t2 WHERE (t1.a, t2.b) IN (SELECT * FROM v)", packet_length=64, blocking=true) at /data/src/bb-10.6-release/sql/sql_parse.cc:1896
      #17 0x000055b6535acec4 in do_command (thd=0x7f3c24000dc8, blocking=true) at /data/src/bb-10.6-release/sql/sql_parse.cc:1409
      #18 0x000055b65377eeba in do_handle_one_connection (connect=0x55b6567779d8, put_in_cache=true) at /data/src/bb-10.6-release/sql/sql_connect.cc:1416
      #19 0x000055b65377ec2f in handle_one_connection (arg=0x55b656777618) at /data/src/bb-10.6-release/sql/sql_connect.cc:1318
      #20 0x000055b653cd7572 in pfs_spawn_thread (arg=0x55b6566c7d58) at /data/src/bb-10.6-release/storage/perfschema/pfs.cc:2201
      #21 0x00007f3c82ea7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #22 0x00007f3c82f285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      The fix for MDEV-31240 is in the branches.

      The failure started happening after this commit in 10.4.29:

      commit ce7ffe61d836fe9f0cfc1087f058bc40d66e5cfb
      Author: Igor Babaev
      Date:   Tue May 2 23:17:07 2023 -0700
       
          MDEV-26301 Split optimization refills temporary table too many times
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.