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

MWL#253: Server crashes in calculate_cond_selectivity_for_table with EXISTS subquery, use_condition_selectivity=3, stat tables

    XMLWordPrintable

Details

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

    Description

      SET optimizer_use_condition_selectivity=3;
      SET use_stat_tables = PREFERABLY;
       
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES 
        (1),(7),(4),(7),(0),(2),(9),(4),(0),(9),(1),(3),(8),(8);
       
      CREATE TABLE t2 (b INT);
      INSERT INTO t2 VALUES (4),(5),(2),(5),(1),(1),(2);
       
      ANALYZE TABLE t1, t2;
      FLUSH TABLES;
       
      SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4;

      #3  <signal handler called>
      #4  0x00000000008e5762 in calculate_cond_selectivity_for_table (thd=0x3a70800, table=0x7fcedc02dc70, cond=0x7fcedc12e518) at /data/bzr/maria-10.0-mwl253/sql/opt_range.cc:3377
      #5  0x000000000064d8ae in make_join_statistics (join=0x7fcedc12e710, tables_list=..., conds=0x7fcedc12e518, keyuse_array=0x7fcedc12ea18) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:3839
      #6  0x0000000000644c03 in JOIN::optimize_inner (this=0x7fcedc12e710) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:1306
      #7  0x0000000000643bd2 in JOIN::optimize (this=0x7fcedc12e710) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:1008
      #8  0x000000000064b6df in mysql_select (thd=0x3a70800, rref_pointer_array=0x3a73738, tables=0x7fcedc0e93c0, wild_num=1, fields=..., conds=0x7fcedc12e518, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fcedc12e6f0, unit=0x3a72e00, select_lex=0x3a734d8) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:3220
      #9  0x0000000000642041 in handle_select (thd=0x3a70800, lex=0x3a72d48, result=0x7fcedc12e6f0, setup_tables_done_option=0) at /data/bzr/maria-10.0-mwl253/sql/sql_select.cc:376
      #10 0x000000000061a185 in execute_sqlcom_select (thd=0x3a70800, all_tables=0x7fcedc0e93c0) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:4797
      #11 0x000000000061278e in mysql_execute_command (thd=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:2266
      #12 0x000000000061ca26 in mysql_parse (thd=0x3a70800, rawbuf=0x7fcedc0e9168 "SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4", length=79, parser_state=0x7fcee739d500) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:5920
      #13 0x000000000060fab2 in dispatch_command (command=COM_QUERY, thd=0x3a70800, packet=0x3a75d01 "SELECT * FROM t1, t2 WHERE EXISTS ( SELECT 1 FROM t1, t2 ) AND a != b OR a <= 4", packet_length=79) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:1091
      #14 0x000000000060ece0 in do_command (thd=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_parse.cc:810
      #15 0x00000000007222fe in do_handle_one_connection (thd_arg=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_connect.cc:1266
      #16 0x0000000000721ce9 in handle_one_connection (arg=0x3a70800) at /data/bzr/maria-10.0-mwl253/sql/sql_connect.cc:1181
      #17 0x0000000000c9d5d4 in pfs_spawn_thread (arg=0x3a1d230) at /data/bzr/maria-10.0-mwl253/storage/perfschema/pfs.cc:1015
      #18 0x00007fcef2a8ae9a in start_thread (arg=0x7fcee739e700) at pthread_create.c:308
      #19 0x00007fcef1d7ecbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

      revision-id: igor@askmonty.org-20130404211131-w3aybgqc80g7aiaq
      revno: 3516
      branch-nick: maria-10.0-mwl253

      Reproducible with MyISAM, InnoDB, Aria.
      EXPLAIN also crashes.

      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.