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

Assertion `join->best_read < double(...)' failed after adding a key to a TokuDB table, use_stat_tables, optimizer_use_condition_selectivity>1

    XMLWordPrintable

Details

    Description

      Might be related to MDEV-6442

      SET use_stat_tables = PREFERABLY;
      SET optimizer_use_condition_selectivity = 2;
       
      INSTALL SONAME 'ha_tokudb';
       
      CREATE TABLE state (
        code CHAR(2),
        name VARCHAR(32),
        population INT,
        house_seats TINYINT,
        PRIMARY KEY(code),
        KEY (house_seats)
      ) ENGINE=TokuDB;
       
      INSERT INTO state VALUES ('AL','Alabama',4833722,7),('AK','Alaska',735132,1);
      ANALYZE TABLE state; 
      ALTER TABLE state ADD KEY (name(4),house_seats);
       
      SELECT * FROM state WHERE 
      population BETWEEN 1000000 AND 2000000 
      AND name LIKE 'New %'
      AND house_seats IN (1, 2, 3)
      AND code IN ('NJ', 'NM');

      mysqld: 10.0/sql/sql_select.cc:6905: bool greedy_search(JOIN*, table_map, uint, uint, uint): Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed.
      140801 19:58:48 [ERROR] mysqld got signal 6 ;

      #6  0x00007f6b3ee596f1 in *__GI___assert_fail (assertion=0xf39e68 "join->best_read < double(1.79769313486231570815e+308L)", file=<optimized out>, line=6905, function=0xf3cc00 "bool greedy_search(JOIN*, table_map, uint, uint, uint)") at assert.c:81
      #7  0x00000000006be6d6 in greedy_search (join=0x7f6b37373b08, remaining_tables=1, search_depth=62, prune_level=1, use_cond_selectivity=2) at 10.0/sql/sql_select.cc:6905
      #8  0x00000000006bdc60 in choose_plan (join=0x7f6b37373b08, join_tables=1) at 10.0/sql/sql_select.cc:6474
      #9  0x00000000006b7729 in make_join_statistics (join=0x7f6b37373b08, tables_list=..., conds=0x7f6b373730d0, keyuse_array=0x7f6b37373e10) at 10.0/sql/sql_select.cc:4018
      #10 0x00000000006ae441 in JOIN::optimize_inner (this=0x7f6b37373b08) at 10.0/sql/sql_select.cc:1338
      #11 0x00000000006ad3d8 in JOIN::optimize (this=0x7f6b37373b08) at 10.0/sql/sql_select.cc:1023
      #12 0x00000000006b4f67 in mysql_select (thd=0x7f6b39b2f070, rref_pointer_array=0x7f6b39b336e0, tables=0x7f6b37372360, wild_num=1, fields=..., conds=0x7f6b373730d0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f6b37373ae8, unit=0x7f6b39b32d80, select_lex=0x7f6b39b33468) at 10.0/sql/sql_select.cc:3289
      #13 0x00000000006ab5e7 in handle_select (thd=0x7f6b39b2f070, lex=0x7f6b39b32cb8, result=0x7f6b37373ae8, setup_tables_done_option=0) at 10.0/sql/sql_select.cc:372
      #14 0x0000000000680390 in execute_sqlcom_select (thd=0x7f6b39b2f070, all_tables=0x7f6b37372360) at 10.0/sql/sql_parse.cc:5265
      #15 0x000000000067872f in mysql_execute_command (thd=0x7f6b39b2f070) at 10.0/sql/sql_parse.cc:2552
      #16 0x0000000000682b1b in mysql_parse (thd=0x7f6b39b2f070, rawbuf=0x7f6b37372088 "SELECT * FROM state WHERE \npopulation BETWEEN 1000000 AND 2000000 \nAND name LIKE 'New %'\nAND house_seats IN (1, 2, 3)\nAND code IN ('NJ', 'NM')", length=142, parser_state=0x7f6b40dde610) at 10.0/sql/sql_parse.cc:6411
      #17 0x00000000006759d0 in dispatch_command (command=COM_QUERY, thd=0x7f6b39b2f070, packet=0x7f6b3abf6071 "SELECT * FROM state WHERE \npopulation BETWEEN 1000000 AND 2000000 \nAND name LIKE 'New %'\nAND house_seats IN (1, 2, 3)\nAND code IN ('NJ', 'NM')", packet_length=142) at 10.0/sql/sql_parse.cc:1307
      #18 0x0000000000674d75 in do_command (thd=0x7f6b39b2f070) at 10.0/sql/sql_parse.cc:1004
      #19 0x0000000000790d96 in do_handle_one_connection (thd_arg=0x7f6b39b2f070) at 10.0/sql/sql_connect.cc:1379
      #20 0x0000000000790ae9 in handle_one_connection (arg=0x7f6b39b2f070) at 10.0/sql/sql_connect.cc:1293
      #21 0x0000000000cc2c7a in pfs_spawn_thread (arg=0x7f6b38f1fbf0) at 10.0/storage/perfschema/pfs.cc:1860
      #22 0x00007f6b40a12b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #23 0x00007f6b3ef0a20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      Stack trace from:

      revision-id: sergii@pisem.net-20140731161437-oxyzqaskmptm5ssv
      revno: 4318
      branch-nick: 10.0

      Attachments

        Issue Links

          Activity

            People

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