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

Assertion failure on hint-forced Split-Materialized plan

    XMLWordPrintable

Details

    Description

      create table t1 (
        groups_20 int not null,
        groups_20_2 int not null,
        b int,
        primary key (groups_20, groups_20_2)
      ) engine=innodb;
      insert into t1 select seq/1000, seq+1, seq from seq_1_to_20000;
       
      create table t2 (a int, b int, index(a));
      insert into t2 select seq, seq from seq_0_to_1000;
      insert into t2 select seq, seq from seq_0_to_1000;
      analyze table t1, t2;
      

      analyze 
      select /*+ SPLIT_MATERIALIZED(DT) */a, sum(b) 
      from    
        (     
          select groups_20 from t1       
          group by groups_20       
          having count(*)  != 1000   
        ) DT    
        join 
        t2 on a = groups_20 
      group by a;
      

      Causes this assert:

      sql/sql_select.cc:8283: double apply_selectivity_for_table(JOIN_TAB*, uint): Assertion `table_records == 0 || sel <=  s->table->opt_range_condition_rows / table_records' failed.
      

      I got this on

      commit ef4be39bfcbae1b0090a3098e511d14457d6139f (HEAD -> main, origin/main)
      Author: Mohammad El-Shennawy <mohamedwork216@gmail.com>
      Date:   Fri Feb 27 10:28:59 2026 +0200
       
          MDEV-21543: Speed up VARCHAR pad space handling in multibyte collations (fix)
          
          Correct compilation on clang-20 by using a bitwise & rather than the
          incorrect &&.
      

      didn't try other versions.

      Attachments

        Issue Links

          Activity

            People

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