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

Crash when using ANY predicand with redundant subquery in GROUP BY clause

Details

    Description

      The following test case causes an assertion failure in Debug build of the current 10.3 and most probably of all other versions:

      create table t1 (a int);
      insert into t1 values (3), (2);
      create table t2 (b int);
      insert into t2 values (4), (2);
      create table t3 (c int);
      insert into t3 values (7), (1);
       
      select a from t1
        where a >= any (select b from t2 group by (select c from t3 where c = 1));
       
      drop table t1,t2,t3;
      

      The failure happens in item_subselect.cc():

      4  0x00007fde8f9b1187 in raise () from /lib64/libc.so.6
      #5  0x00007fde8f9b2538 in abort () from /lib64/libc.so.6
      #6  0x00007fde8f9aa126 in __assert_fail_base () from /lib64/libc.so.6
      #7  0x00007fde8f9aa1d2 in __assert_fail () from /lib64/libc.so.6
      #8  0x00005618d77c3f94 in Item_subselect::exec (this=0x7fde78017750) at /home/igor/maria-git/10.3/sql/item_subselect.cc:766
      #9  0x00005618d77c6307 in Item_singlerow_subselect::val_str (this=0x7fde78017750, str=0x7fde78113020) at /home/igor/maria-git/10.3/sql/item_subselect.cc:1437
      #10 0x00005618d7710bbe in Item_copy_string::copy (this=0x7fde78112ff0) at /home/igor/maria-git/10.3/sql/item.cc:5281
      #11 0x00005618d7440132 in copy_fields (param=0x7fde7810e008) at /home/igor/maria-git/10.3/sql/sql_select.cc:24580
      #12 0x00005618d743796f in end_send_group (join=0x7fde7810de18, join_tab=0x7fde78112be0, end_of_records=false) at /home/igor/maria-git/10.3/sql/sql_select.cc:21282
      #13 0x00005618d7434687 in evaluate_join_record (join=0x7fde7810de18, join_tab=0x7fde78112850, error=0) at /home/igor/maria-git/10.3/sql/sql_select.cc:20119
      #14 0x00005618d7433ed9 in sub_select (join=0x7fde7810de18, join_tab=0x7fde78112850, end_of_records=false) at /home/igor/maria-git/10.3/sql/sql_select.cc:19892
      #15 0x00005618d7433356 in do_select (join=0x7fde7810de18, procedure=0x0) at /home/igor/maria-git/10.3/sql/sql_sel
      ...
      

      Attachments

        Activity

          Transition Time In Source Status Execution Times
          Igor Babaev (Inactive) made transition -
          Open In Progress
          31m 3s 1
          Igor Babaev (Inactive) made transition -
          In Progress In Review
          1d 2h 15m 1
          Igor Babaev (Inactive) made transition -
          Stalled In Review
          20h 32m 1
          Oleksandr Byelkin made transition -
          In Review Stalled
          10h 27m 2
          Igor Babaev (Inactive) made transition -
          Stalled Closed
          5d 10h 33m 1

          People

            igor Igor Babaev (Inactive)
            igor Igor Babaev (Inactive)
            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.