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

Assertion `join->best_read < double(1.797...e+308L)' failed in bool greedy_search

    XMLWordPrintable

Details

    Description

      CREATE OR REPLACE TABLE t1 (f1 INT) WITH SYSTEM VERSIONING;
      CREATE OR REPLACE TABLE t2 (f2 INT) WITH SYSTEM VERSIONING;
      CREATE OR REPLACE TABLE t3 (f3 INT);
      CREATE OR REPLACE TABLE t4 (f4 INT);
       
      SELECT * FROM 
        t1 AS t1a 
          LEFT JOIN t2 AS t2a 
            LEFT JOIN (t3 AS t3a INNER JOIN t1 AS t1b) 
            ON t2a.f2 = t3a.f3
          ON t1a.f1 = t2a.f2
          LEFT JOIN 
            (t2 JOIN t3 INNER JOIN t4) 
          ON t2a.f2 = t1a.f1
      ;
       
      # Cleanup
      DROP TABLE t1, t2, t3, t4;
      

      bb-10.3-temporal a3a15126f260e2

      mysqld: /data/src/bb-10.3-temporal/sql/sql_select.cc:7952: bool greedy_search(JOIN*, table_map, uint, uint, uint): Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed.
      171229 20:09:51 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f6090b4dee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055e5f4e87404 in greedy_search (join=0x7f60700919a0, remaining_tables=126, search_depth=62, prune_level=1, use_cond_selectivity=1) at /data/src/bb-10.3-temporal/sql/sql_select.cc:7952
      #9  0x000055e5f4e8686e in choose_plan (join=0x7f60700919a0, join_tables=126) at /data/src/bb-10.3-temporal/sql/sql_select.cc:7522
      #10 0x000055e5f4e7f6d9 in make_join_statistics (join=0x7f60700919a0, tables_list=..., keyuse_array=0x7f6070091c90) at /data/src/bb-10.3-temporal/sql/sql_select.cc:5010
      #11 0x000055e5f4e747ed in JOIN::optimize_inner (this=0x7f60700919a0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1971
      #12 0x000055e5f4e730b8 in JOIN::optimize (this=0x7f60700919a0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1556
      #13 0x000055e5f4e7c814 in mysql_select (thd=0x7f6070000b00, tables=0x7f6070014f98, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f6070091980, unit=0x7f6070004898, select_lex=0x7f6070004ff0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4244
      #14 0x000055e5f4e6e93e in handle_select (thd=0x7f6070000b00, lex=0x7f60700047d0, result=0x7f6070091980, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:382
      #15 0x000055e5f4e39aa1 in execute_sqlcom_select (thd=0x7f6070000b00, all_tables=0x7f6070014f98) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6535
      #16 0x000055e5f4e300e5 in mysql_execute_command (thd=0x7f6070000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
      #17 0x000055e5f4e3d3f6 in mysql_parse (thd=0x7f6070000b00, rawbuf=0x7f6070014c48 "SELECT * FROM \nt1 AS t1a \nLEFT JOIN t2 AS t2a \nLEFT JOIN (t3 AS t3a INNER JOIN t1 AS t1b) \nON t2a.f2 = t3a.f3\nON t1a.f1 = t2a.f2\nLEFT JOIN \n(t2 JOIN t3 INNER JOIN t4) \nON t2a.f2 = t1a.f1", length=186, parser_state=0x7f6086da65f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7991
      #18 0x000055e5f4e2ab97 in dispatch_command (command=COM_QUERY, thd=0x7f6070000b00, packet=0x7f607011ef11 "SELECT * FROM \nt1 AS t1a \nLEFT JOIN t2 AS t2a \nLEFT JOIN (t3 AS t3a INNER JOIN t1 AS t1b) \nON t2a.f2 = t3a.f3\nON t1a.f1 = t2a.f2\nLEFT JOIN \n(t2 JOIN t3 INNER JOIN t4) \nON t2a.f2 = t1a.f1\n", packet_length=187, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1825
      #19 0x000055e5f4e295cb in do_command (thd=0x7f6070000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1370
      #20 0x000055e5f4f91354 in do_handle_one_connection (connect=0x55e5f797f9e0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
      #21 0x000055e5f4f910e1 in handle_one_connection (arg=0x55e5f797f9e0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
      #22 0x000055e5f542bc5a in pfs_spawn_thread (arg=0x55e5f7987a50) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
      #23 0x00007f6092824494 in start_thread (arg=0x7f6086da7700) at pthread_create.c:333
      #24 0x00007f6090c0a93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with (at least) MyISAM and InnoDB.
      Not reproducible without versioning on t1 and t2.
      EXPLAIN also crashes, so can't say if there is a difference in plan with/without versioning.
      Possibly the test case is not minimal, but I couldn't remove anything else from it.

      Attachments

        Issue Links

          Activity

            People

              kevg Eugene Kosov (Inactive)
              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.