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

Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed in bool greedy_search with optimizer_use_condition_selectivity>1

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 10.0.11
    • None

    Description

      The problem appeared in 10.0 tree with the following revision:

      revno: 4169
      revision-id: psergey@askmonty.org-20140425150454-dsk6kba2vn13gw50
      parent: psergey@askmonty.org-20140428174939-32ycvsxmajmfdjno
      committer: Sergey Petrunya <psergey@askmonty.org>
      branch nick: 10.0-cp
      timestamp: Fri 2014-04-25 19:04:54 +0400
      message:
        MDEV-6003: EITS: ref access, keypart2=const vs keypart2=expr - inconsistent filtered% value
        - Fix table_cond_selectivity() to work correctly for ref access 
          and "keypart2=const" case.

      mysqld: 10.0/sql/sql_select.cc:6895: bool greedy_search(JOIN*, table_map, uint, uint, uint): Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed.
      140505 12:17:27 [ERROR] mysqld got signal 6 ;

      #6  0x00007fbf6ccbe621 in *__GI___assert_fail (assertion=0xf277f8 "join->best_read < double(1.79769313486231570815e+308L)", file=<optimized out>, line=6895, function=0xf2a580 "bool greedy_search(JOIN*, table_map, uint, uint, uint)") at assert.c:81
      #7  0x00000000006ba14e in greedy_search (join=0x7fbf64da2458, remaining_tables=3, search_depth=62, prune_level=1, use_cond_selectivity=2) at 10.0/sql/sql_select.cc:6895
      #8  0x00000000006b96d8 in choose_plan (join=0x7fbf64da2458, join_tables=3) at 10.0/sql/sql_select.cc:6464
      #9  0x00000000006b31a1 in make_join_statistics (join=0x7fbf64da2458, tables_list=..., conds=0x7fbf64fa8088, keyuse_array=0x7fbf64da2760) at 10.0/sql/sql_select.cc:4008
      #10 0x00000000006a9ea2 in JOIN::optimize_inner (this=0x7fbf64da2458) at 10.0/sql/sql_select.cc:1327
      #11 0x00000000006a8e60 in JOIN::optimize (this=0x7fbf64da2458) at 10.0/sql/sql_select.cc:1013
      #12 0x00000000006b09df in mysql_select (thd=0x7fbf66f3d070, rref_pointer_array=0x7fbf66f416e0, tables=0x7fbf64da12d8, wild_num=1, fields=..., conds=0x7fbf64da2228, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fbf64da2438, unit=0x7fbf66f40d80, select_lex=0x7fbf66f41468) at 10.0/sql/sql_select.cc:3279
      #13 0x00000000006a7187 in handle_select (thd=0x7fbf66f3d070, lex=0x7fbf66f40cb8, result=0x7fbf64da2438, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372
      #14 0x000000000067bf40 in execute_sqlcom_select (thd=0x7fbf66f3d070, all_tables=0x7fbf64da12d8) at 10.0/sql/sql_parse.cc:5319
      #15 0x0000000000674297 in mysql_execute_command (thd=0x7fbf66f3d070) at 10.0/sql/sql_parse.cc:2591
      #16 0x000000000067e6cb in mysql_parse (thd=0x7fbf66f3d070, rawbuf=0x7fbf64da1088 "SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE NOT ( t1_1.a <> 'baz')", length=65, parser_state=0x7fbf6ec8a610) at 10.0/sql/sql_parse.cc:6465
      #17 0x0000000000671424 in dispatch_command (command=COM_QUERY, thd=0x7fbf66f3d070, packet=0x7fbf66f33071 "SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE NOT ( t1_1.a <> 'baz')", packet_length=65) at 10.0/sql/sql_parse.cc:1309
      #18 0x00000000006707c6 in do_command (thd=0x7fbf66f3d070) at 10.0/sql/sql_parse.cc:1006
      #19 0x000000000078b836 in do_handle_one_connection (thd_arg=0x7fbf66f3d070) at 10.0/sql/sql_connect.cc:1379
      #20 0x000000000078b589 in handle_one_connection (arg=0x7fbf66f3d070) at 10.0/sql/sql_connect.cc:1293
      #21 0x0000000000cb0d44 in pfs_spawn_thread (arg=0x7fbf6779bb70) at 10.0/storage/perfschema/pfs.cc:1853
      #22 0x00007fbf6e875b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #23 0x00007fbf6cd6da7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
      #24 0x0000000000000000 in ?? ()

      Stack trace from:

      revision-id: igor@askmonty.org-20140502224750-3nlacg1f5n72rubd
      date: 2014-05-02 15:47:50 -0700
      build-date: 2014-05-05 12:21:07 +0400
      revno: 4172
      branch-nick: 10.0

      Test case:

      SET optimizer_use_condition_selectivity = 2;
       
      CREATE TABLE t1 (a CHAR(6), b INT, PRIMARY KEY (a,b)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES ('foo',1),('bar',2);
       
      SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE NOT ( t1_1.a <> 'baz');

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            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.