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

Assertion `join->best_read < double(...)' in bool greedy_search or crash in optimize_semijoin_nests

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (f1 INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1),(2);
       
      CREATE TABLE t2 (f2 INT) ENGINE=InnoDB;
      INSERT INTO t2 VALUES (3),(4);
       
      CREATE TABLE t3 (f3 INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (5),(6);
       
      CREATE TABLE t4 (f4 INT) ENGINE=InnoDB;
      INSERT INTO t4 VALUES (7),(8);
       
      SELECT * FROM t1 INNER JOIN ( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq ON ( 1 IN ( SELECT f4 FROM t4 ) ) ) ON ( f1 >= f2 );
      

      10.1 f42e08f9 non-debug

      #2  <signal handler called>
      #3  optimize_semijoin_nests (join=0x7f38cc5dc120, all_table_map=15) at /data/src/10.1/sql/opt_subselect.cc:2345
      #4  0x00007f38e4306322 in make_join_statistics (join=0x0, tables_list=..., keyuse_array=0x108) at /data/src/10.1/sql/sql_select.cc:4183
      #5  0x00007f38e430d2b6 in JOIN::optimize_inner (this=0x7f38cc5dc120) at /data/src/10.1/sql/sql_select.cc:1366
      #6  0x00007f38e430f978 in JOIN::optimize (this=0x7f38cc5dc120) at /data/src/10.1/sql/sql_select.cc:1045
      #7  0x00007f38e4310372 in mysql_select (thd=thd@entry=0x7f38d8287008, rref_pointer_array=rref_pointer_array@entry=0x7f38d828b2a0, tables=0x7f38cc5832c8, wild_num=<optimized out>, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f38cc588fd0, unit=0x7f38d828a910, select_lex=0x7f38d828b010) at /data/src/10.1/sql/sql_select.cc:3431
      #8  0x00007f38e4310540 in handle_select (thd=thd@entry=0x7f38d8287008, lex=lex@entry=0x7f38d828a848, result=result@entry=0x7f38cc588fd0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/src/10.1/sql/sql_select.cc:384
      #9  0x00007f38e42b8f58 in execute_sqlcom_select (thd=0x7f38d8287008, all_tables=0x7f38cc5832c8) at /data/src/10.1/sql/sql_parse.cc:5922
      #10 0x00007f38e42c4a11 in mysql_execute_command (thd=0x7f38d8287008) at /data/src/10.1/sql/sql_parse.cc:2979
      #11 0x00007f38e42c7a77 in mysql_parse (thd=0x7f38d8287008, rawbuf=<optimized out>, length=<optimized out>, parser_state=0x7f38e4e5a620) at /data/src/10.1/sql/sql_parse.cc:7339
      #12 0x00007f38e42ca733 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f38d8287008, packet=packet@entry=0x7f38d82dd009 "SELECT * FROM t1 INNER JOIN ( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq ON ( 1 IN ( SELECT f4 FROM t4 ) ) ) ON ( f1 >= f2 )", packet_length=packet_length@entry=125) at /data/src/10.1/sql/sql_parse.cc:1490
      #13 0x00007f38e42caf33 in do_command (thd=0x7f38d8287008) at /data/src/10.1/sql/sql_parse.cc:1109
      #14 0x00007f38e43843dc in do_handle_one_connection (thd_arg=thd_arg@entry=0x7f38d8287008) at /data/src/10.1/sql/sql_connect.cc:1349
      #15 0x00007f38e4384597 in handle_one_connection (arg=arg@entry=0x7f38d8287008) at /data/src/10.1/sql/sql_connect.cc:1261
      #16 0x00007f38e45f7e04 in pfs_spawn_thread (arg=0x7f38e103f808) at /data/src/10.1/storage/perfschema/pfs.cc:1860
      #17 0x00007f38e3a7b494 in start_thread (arg=0x7f38e4e5bb00) at pthread_create.c:333
      #18 0x00007f38e1bc693f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.1 f42e08f9 debug

      mysqld: /data/src/10.1/sql/sql_select.cc:7113: bool greedy_search(JOIN*, table_map, uint, uint, uint): Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed.
      170527  0:35:33 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f82131c0ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00007f8215a8c2a1 in greedy_search (join=0x7f81fd26d188, remaining_tables=15, search_depth=62, prune_level=1, use_cond_selectivity=1) at /data/src/10.1/sql/sql_select.cc:7113
      #9  0x00007f8215a8b787 in choose_plan (join=0x7f81fd26d188, join_tables=15) at /data/src/10.1/sql/sql_select.cc:6682
      #10 0x00007f8215bc1eb9 in optimize_semijoin_nests (join=0x7f81fd26d188, all_table_map=15) at /data/src/10.1/sql/opt_subselect.cc:2289
      #11 0x00007f8215a84b10 in make_join_statistics (join=0x7f81fd26d188, tables_list=..., keyuse_array=0x7f81fd26d4c0) at /data/src/10.1/sql/sql_select.cc:4183
      #12 0x00007f8215a7a969 in JOIN::optimize_inner (this=0x7f81fd26d188) at /data/src/10.1/sql/sql_select.cc:1366
      #13 0x00007f8215a79854 in JOIN::optimize (this=0x7f81fd26d188) at /data/src/10.1/sql/sql_select.cc:1045
      #14 0x00007f8215a81eb8 in mysql_select (thd=0x7f8209bc7070, rref_pointer_array=0x7f8209bcb448, tables=0x7f81fd0fa330, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f81fd100038, unit=0x7f8209bcaab8, select_lex=0x7f8209bcb1b8) at /data/src/10.1/sql/sql_select.cc:3431
      #15 0x00007f8215a779a4 in handle_select (thd=0x7f8209bc7070, lex=0x7f8209bca9f0, result=0x7f81fd100038, setup_tables_done_option=0) at /data/src/10.1/sql/sql_select.cc:384
      #16 0x00007f8215a4789d in execute_sqlcom_select (thd=0x7f8209bc7070, all_tables=0x7f81fd0fa330) at /data/src/10.1/sql/sql_parse.cc:5922
      #17 0x00007f8215a3dd99 in mysql_execute_command (thd=0x7f8209bc7070) at /data/src/10.1/sql/sql_parse.cc:2979
      #18 0x00007f8215a4afbb in mysql_parse (thd=0x7f8209bc7070, rawbuf=0x7f81fd0fa088 "SELECT * FROM t1 INNER JOIN ( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq ON ( 1 IN ( SELECT f4 FROM t4 ) ) ) ON ( f1 >= f2 )", length=125, parser_state=0x7f821694a5e0) at /data/src/10.1/sql/sql_parse.cc:7339
      #19 0x00007f8215a39fa8 in dispatch_command (command=COM_QUERY, thd=0x7f8209bc7070, packet=0x7f820bb23071 "SELECT * FROM t1 INNER JOIN ( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq ON ( 1 IN ( SELECT f4 FROM t4 ) ) ) ON ( f1 >= f2 )", packet_length=125) at /data/src/10.1/sql/sql_parse.cc:1490
      #20 0x00007f8215a38d07 in do_command (thd=0x7f8209bc7070) at /data/src/10.1/sql/sql_parse.cc:1109
      #21 0x00007f8215b6ff87 in do_handle_one_connection (thd_arg=0x7f8209bc7070) at /data/src/10.1/sql/sql_connect.cc:1349
      #22 0x00007f8215b6fceb in handle_one_connection (arg=0x7f8209bc7070) at /data/src/10.1/sql/sql_connect.cc:1261
      #23 0x00007f8215f26900 in pfs_spawn_thread (arg=0x7f820baea970) at /data/src/10.1/storage/perfschema/pfs.cc:1860
      #24 0x00007f8215132494 in start_thread (arg=0x7f821694bb00) at pthread_create.c:333
      #25 0x00007f821327d93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        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.