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

Crash when using derived table over union with order by clause

    XMLWordPrintable

Details

    Description

      poc:

      CREATE TABLE v1239 ( v1240 BOOLEAN NOT NULL , v1241 INT ) ;
       CREATE TABLE v1242 ( v1243 BOOLEAN NOT NULL , v1244 INT ) ;
       ( ( SELECT v1243 FROM ( SELECT v1243 FROM v1242 UNION SELECT v1243 NOT IN ( v1243 ) AND v1244 NOT IN ( NOT v1243 > v1243 % v1244 % CASE ( 83654606.000000 ^ 50823089.000000 AND 'x' = ( 71 * 41 = 36 AND ( v1243 = 81 OR v1243 = 11 ) NOT LIKE ( ( NOT ( 63411216.000000 AND v1244 = 0 ) ) = -2147483648 AND v1243 = 73 ) ) ) * 85 = 98 WHEN 127 THEN v1244 = 74314347.000000 OR - ( 21636966.000000 AND v1243 = 61 ) + ( NOT -128 ) WHEN 8 THEN 'x' ELSE -128 END != -1 ) AS v1245 FROM v1242 WHERE 28178329.000000 = -1 ORDER BY v1243 + v1243 , ( v1243 = -128 OR v1243 = 0 ) NOT LIKE ( SELECT v1244 FROM v1242 WHERE ( FALSE <= 'x' * 7 BETWEEN 97 AND 15 , v1244 ) NOT IN ( SELECT ( v1240 NOT IN ( v1240 ) AND v1241 NOT IN ( 0 ^ v1241 ) ) , v1241 + v1241 FROM v1239 GROUP BY v1240 HAVING ( v1240 IN ( CASE v1240 WHEN v1240 THEN 'x' ELSE TRUE END != ( ( ( v1241 OR NOT v1240 ) BETWEEN 50 AND -128 ) ) ) ) ) ) * ( 'x' = 'x' AND ( -1 ) IS NULL ) ) AS v1246 WHERE v1243 IN ( 'x' = v1243 ) ORDER BY v1243 + v1243 , v1243 + v1243 ) ) ;
       UPDATE v1242 SET v1244 = 52 WHERE ( v1244 > ( v1244 = 81 AND v1243 = 0 ) ) = 37 ;
       INSERT INTO v1242 ( v1244 ) VALUES ( 56 ) , ( -128 ) ;
       SELECT COUNT ( v1241 ) OVER v1247 , MAX ( v1240 ) OVER v1247 FROM v1239 WINDOW v1247 AS ( PARTITION BY v1241 ORDER BY v1241 DESC ) ;
      

      output:
      SUMMARY: AddressSanitizer: SEGV /sql/item.cc:8083 in Item_ref::fix_fields(THD*, Item**)

      The full error log is in the attachment.

      Attachments

        Activity

          People

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