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

Assertion `0 < sel && sel <= 2.0' failed in table_cond_selectivity

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.4(EOL)
    • Optimizer
    • None

    Description

      I see 10.1 crashing after MDEV-20576 is pused to 10.1

      Here is the stack trace

      #5  0x00007ffff5284412 in __GI___assert_fail (assertion=0x555557773960 "0 < sel && sel <= 2.0", 
          file=0x555557772de0 "/home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc", line=7764, 
          function=0x55555777be40 <table_cond_selectivity(JOIN*, unsigned int, st_join_table*, unsigned long long)::__PRETTY_FUNCTION__> "double table_cond_selectivity(JOIN*, uint, JOIN_TAB*, table_map)") at assert.c:101
      #6  0x00005555560069bc in table_cond_selectivity (join=<optimized out>, idx=<optimized out>, s=<optimized out>, rem_tables=0)
          at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:7764
      #7  0x000055555602bc3a in best_extension_by_limited_search (join=0x62b000010230, remaining_tables=2, idx=<optimized out>, 
          record_count=<optimized out>, read_time=<optimized out>, search_depth=<optimized out>, prune_level=<optimized out>, 
          use_cond_selectivity=<optimized out>) at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:8022
      #8  0x000055555602d7c1 in greedy_search (use_cond_selectivity=2, prune_level=1, search_depth=62, remaining_tables=2, 
          join=0x62b000010230) at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:7169
      #9  choose_plan (join=0x62b000010230, join_tables=<optimized out>) at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:6745
      #10 0x0000555556090973 in make_join_statistics (join=<optimized out>, tables_list=..., keyuse_array=<optimized out>)
          at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:4249
      #11 0x00005555560ab39c in JOIN::optimize_inner (this=0x62b000010230) at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:1405
      #12 0x00005555560b61e4 in JOIN::optimize (this=0x62b000010230) at /home/varunraiko/MariaDB/10.1-dev/sql/sql_select.cc:1059
      

      This crash is reproducible with the below mtr test :

      --source include/have_sequence.inc
       
      create table t1 (id int, a int, PRIMARY KEY(id), key(a));
      insert into t1 select seq,seq from seq_1_to_100;
      create table t2 (id int, a int, b int, PRIMARY KEY(id), key(a), key(b));
      insert into t2 select seq,seq,seq from seq_1_to_100;
       
      set optimizer_use_condition_selectivity=2;
      EXPLAIN  SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65;
      

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              varun Varun Gupta (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.