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

Crash with INSERT...SELECT using a derived table in GROUP BY clause

    XMLWordPrintable

Details

    Description

      poc:

      CREATE TABLE v859 ( v860 BOOLEAN NOT NULL , v861 INT , v862 INT ) ;
       CREATE TABLE v863 ( v864 INT NOT NULL , v865 INT , v866 INT ) ;
       INSERT INTO v863 ( v866 ) VALUES ( ( ( TRUE , v864 ) NOT IN ( SELECT ( - 49 ) AS v867 , -128 FROM v859 GROUP BY ( TRUE , v862 ) NOT IN ( SELECT v864 , ( SELECT v861 FROM ( WITH v869 AS ( SELECT v866 FROM ( SELECT NOT v864 <= 'x' , v866 FROM v863 GROUP BY v866 ) AS v868 ) SELECT v866 , ( v866 = 67 OR v866 > 'x' ) FROM v863 ) AS v870 NATURAL JOIN v859 WHERE v866 = v862 ) AS v871 FROM v863 ) , v861 ) OR v864 > 'x' ) ) ;
       UPDATE v863 SET v864 = 0 WHERE v864 = 127 ;
       INSERT INTO v859 ( v860 ) VALUES ( ( ( SELECT ARRAY [ 0 , 58 , 91 ] ) ) [ 30 ] ) , ( 78 ) ;
       SELECT ROW_NUMBER ( v861 ) OVER v872 , RANK ( v861 ) OVER v872 FROM v859 WINDOW v872 AS ( PARTITION BY v861 ORDER BY v861 DESC ) ;
      

      output:
      SUMMARY: AddressSanitizer: SEGV /sql/table.cc:5997 in TABLE_LIST::set_check_materialized()

      The full error log is in the attachment.

      Attachments

        Activity

          People

            igor Igor Babaev
            nobody Shihao Wen
            Votes:
            0 Vote for this issue
            Watchers:
            8 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.