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

MWL#253: Assertion `join->best_read < double(...) fails with optimizer_use_condition_selectivity=3, table statistics

    XMLWordPrintable

Details

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

    Description

      SET optimizer_use_condition_selectivity=3;
      SET use_stat_tables=PREFERABLY;
       
      CREATE TABLE language (lang_group INT, lang VARCHAR(16) PRIMARY KEY);
      INSERT INTO language VALUES (1,'Chinese'),(6,'English'),(1,'French'),(1,'German'),(1,'Italian'),(0,'Japanese');
       
      CREATE TABLE country (code varchar(3) PRIMARY KEY, country_group INT DEFAULT NULL);
      INSERT INTO country VALUES ('USA',3),('FRA',5);
       
      CREATE TABLE continent (cont_group INT, cont VARCHAR(16) PRIMARY KEY);
      INSERT INTO continent VALUES (1,'N.America'),(1,'S.America'),(3,'Australia'),(4,'Africa'),(5,'Antarctica'),(6,'Eurasia');
       
      ANALYZE TABLE country, language, continent;
      FLUSH TABLES;
       
      SELECT * FROM language, country, continent WHERE country_group = lang_group AND lang_group IS NULL;

      130424  1:41:48 [Note] /data/repo/bzr/10.0/sql/mysqld: ready for connections.
      Version: '10.0.2-MariaDB-debug-log'  socket: '/data/repo/bzr/10.0/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
      mysqld: /home/elenst/bzr/10.0/sql/sql_select.cc:6671: bool greedy_search(JOIN*, table_map, uint, uint, uint): Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed.
      130424  1:41:48 [ERROR] mysqld got signal 6 ;

      #7  0x00007f3fe7909192 in __GI___assert_fail (assertion=0xdc6480 "join->best_read < double(1.79769313486231570815e+308L)", file=0xdc5ba8 "/home/elenst/bzr/10.0/sql/sql_select.cc", line=6671, function=0xdc8c00 "bool greedy_search(JOIN*, table_map, uint, uint, uint)") at assert.c:103
      #8  0x00000000006615bb in greedy_search (join=0x7f3fd013ae68, remaining_tables=7, search_depth=62, prune_level=1, use_cond_selectivity=3) at /home/elenst/bzr/10.0/sql/sql_select.cc:6671
      #9  0x0000000000660b7a in choose_plan (join=0x7f3fd013ae68, join_tables=7) at /home/elenst/bzr/10.0/sql/sql_select.cc:6240
      #10 0x000000000065aaad in make_join_statistics (join=0x7f3fd013ae68, tables_list=..., conds=0x7f3fd0023190, keyuse_array=0x7f3fd013b170) at /home/elenst/bzr/10.0/sql/sql_select.cc:3895
      #11 0x0000000000651ae6 in JOIN::optimize_inner (this=0x7f3fd013ae68) at /home/elenst/bzr/10.0/sql/sql_select.cc:1301
      #12 0x0000000000650ab0 in JOIN::optimize (this=0x7f3fd013ae68) at /home/elenst/bzr/10.0/sql/sql_select.cc:1003
      #13 0x00000000006585be in mysql_select (thd=0x234e570, rref_pointer_array=0x23519d0, tables=0x7f3fd0021a00, wild_num=1, fields=..., conds=0x7f3fd0023190, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3fd0023388, unit=0x2351098, select_lex=0x2351770) at /home/elenst/bzr/10.0/sql/sql_select.cc:3215
      #14 0x000000000064ef25 in handle_select (thd=0x234e570, lex=0x2350fe0, result=0x7f3fd0023388, setup_tables_done_option=0) at /home/elenst/bzr/10.0/sql/sql_select.cc:371
      #15 0x0000000000624d88 in execute_sqlcom_select (thd=0x234e570, all_tables=0x7f3fd0021a00) at /home/elenst/bzr/10.0/sql/sql_parse.cc:5021
      #16 0x000000000061d3b3 in mysql_execute_command (thd=0x234e570) at /home/elenst/bzr/10.0/sql/sql_parse.cc:2482
      #17 0x0000000000627646 in mysql_parse (thd=0x234e570, rawbuf=0x7f3fd0021768 "SELECT * FROM language, country, continent WHERE country_group = lang_group AND lang_group IS NULL", length=98, parser_state=0x7f3fdadb7510) at /home/elenst/bzr/10.0/sql/sql_parse.cc:6154
      #18 0x000000000061a598 in dispatch_command (command=COM_QUERY, thd=0x234e570, packet=0x23527c1 "SELECT * FROM language, country, continent WHERE country_group = lang_group AND lang_group IS NULL", packet_length=98) at /home/elenst/bzr/10.0/sql/sql_parse.cc:1274
      #19 0x0000000000619a0e in do_command (thd=0x234e570) at /home/elenst/bzr/10.0/sql/sql_parse.cc:983
      #20 0x000000000072ea37 in do_handle_one_connection (thd_arg=0x234e570) at /home/elenst/bzr/10.0/sql/sql_connect.cc:1267
      #21 0x000000000072e78a in handle_one_connection (arg=0x234e570) at /home/elenst/bzr/10.0/sql/sql_connect.cc:1181
      #22 0x00000000009a952d in pfs_spawn_thread (arg=0x21c7f40) at /home/elenst/bzr/10.0/storage/perfschema/pfs.cc:1800
      #23 0x00007f3fe86d9e9a in start_thread (arg=0x7f3fdadb8700) at pthread_create.c:308
      #24 0x00007f3fe79cdcbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: igor@askmonty.org-20130423035522-w8b8rz72zdav0p7r
      revno: 3744
      branch-nick: 10.0

      EXPLAIN also fails.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.