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

Server crashes in table_multi_eq_cond_selectivity with optimizer_use_condition_selectivity > 1, IN subquery, LEFT JOIN

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 10.0.7
    • None
    • None

    Description

      #3  <signal handler called>
      #4  0x000000000066938d in table_multi_eq_cond_selectivity (join=0x7f4deb95e108, idx=2, s=0x7f4deb961700, rem_tables=0, keyparts=1, ref_keyuse_steps=0x7f4df30c89c0) at 10.0-base/sql/sql_select.cc:7093
      #5  0x0000000000669c73 in table_cond_selectivity (join=0x7f4deb95e108, idx=2, s=0x7f4deb961700, rem_tables=0) at 10.0-base/sql/sql_select.cc:7282
      #6  0x000000000066a2e1 in best_extension_by_limited_search (join=0x7f4deb95e108, remaining_tables=4, idx=2, record_count=2, read_time=2.4034179687499999, search_depth=61, prune_level=1, use_cond_selectivity=2) at 10.0-base/sql/sql_select.cc:7522
      #7  0x000000000066a3e9 in best_extension_by_limited_search (join=0x7f4deb95e108, remaining_tables=5, idx=1, record_count=1, read_time=0, search_depth=62, prune_level=1, use_cond_selectivity=2) at 10.0-base/sql/sql_select.cc:7529
      #8  0x00000000006689c4 in greedy_search (join=0x7f4deb95e108, remaining_tables=5, search_depth=62, prune_level=1, use_cond_selectivity=2) at 10.0-base/sql/sql_select.cc:6813
      #9  0x0000000000667fe4 in choose_plan (join=0x7f4deb95e108, join_tables=5) at 10.0-base/sql/sql_select.cc:6390
      #10 0x0000000000661ac5 in make_join_statistics (join=0x7f4deb95e108, tables_list=..., conds=0x7f4deb961f60, keyuse_array=0x7f4deb95e410) at 10.0-base/sql/sql_select.cc:3970
      #11 0x000000000065875a in JOIN::optimize_inner (this=0x7f4deb95e108) at 10.0-base/sql/sql_select.cc:1321
      #12 0x000000000065764c in JOIN::optimize (this=0x7f4deb95e108) at 10.0-base/sql/sql_select.cc:1008
      #13 0x000000000065f489 in mysql_select (thd=0x7f4decc06070, rref_pointer_array=0x7f4decc09f20, tables=0x7f4deb8b2300, wild_num=1, fields=..., conds=0x7f4deb95de70, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f4deb95e0e8, unit=0x7f4decc095e0, select_lex=0x7f4decc09cb0) at 10.0-base/sql/sql_select.cc:3271
      #14 0x0000000000655ab2 in handle_select (thd=0x7f4decc06070, lex=0x7f4decc09528, result=0x7f4deb95e0e8, setup_tables_done_option=0) at 10.0-base/sql/sql_select.cc:376
      #15 0x000000000062978a in execute_sqlcom_select (thd=0x7f4decc06070, all_tables=0x7f4deb8b2300) at 10.0-base/sql/sql_parse.cc:4894
      #16 0x0000000000621bc9 in mysql_execute_command (thd=0x7f4decc06070) at 10.0-base/sql/sql_parse.cc:2293
      #17 0x000000000062bff7 in mysql_parse (thd=0x7f4decc06070, rawbuf=0x7f4deb8b2088 "SELECT * FROM t1 WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 )", length=90, parser_state=0x7f4df30ca4e0) at 10.0-base/sql/sql_parse.cc:6018
      #18 0x000000000061ee26 in dispatch_command (command=COM_QUERY, thd=0x7f4decc06070, packet=0x7f4dece49071 "SELECT * FROM t1 WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 )", packet_length=90) at 10.0-base/sql/sql_parse.cc:1097
      #19 0x000000000061e2ef in do_command (thd=0x7f4decc06070) at 10.0-base/sql/sql_parse.cc:812
      #20 0x000000000073ac75 in do_handle_one_connection (thd_arg=0x7f4decc06070) at 10.0-base/sql/sql_connect.cc:1266
      #21 0x000000000073a9e3 in handle_one_connection (arg=0x7f4decc06070) at 10.0-base/sql/sql_connect.cc:1181
      #22 0x00000000009a1abe in pfs_spawn_thread (arg=0x7f4dece7a850) at 10.0-base/storage/perfschema/pfs.cc:1015
      #23 0x00007f4df229ae9a in start_thread (arg=0x7f4df30cb700) at pthread_create.c:308
      #24 0x00007f4df19cbcbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: timour@askmonty.org-20131018090935-4f7ehehboto05i4p
      revno: 3736
      branch-nick: 10.0-base
      BUILD/compile-pentium-debug-max-no-ndb

      Test case:

      SET use_stat_tables = 'PREFERABLY';
      SET optimizer_use_condition_selectivity = 2;
       
      CREATE TABLE t1 (i1 INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (0),(1);
       
      CREATE TABLE t2 (pk2 INT, i2 INT, c2 CHAR(1), PRIMARY KEY(pk2)) ENGINE=MyISAM;
      INSERT INTO t2 VALUES (1,8,'m'),(2,9,'b');
       
      CREATE TABLE t3 (c3 CHAR(1), INDEX(c3)) ENGINE=MyISAM;
      INSERT INTO t3 VALUES ('v'),('c');
       
      ANALYZE TABLE t1, t2, t3;
       
      SELECT * FROM t1 WHERE 2 IN ( SELECT pk2 FROM t2 LEFT JOIN t3 ON (c3 = c2 ) WHERE i2 = 3 );

      EXPLAIN also crashes.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              elenst Elena Stepanova
              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.