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

Crash server using ROW_NUMBER() OVER (PARTITION ..) with an EXISTS()

    XMLWordPrintable

Details

    Description

      The following script crashes the server. We encountered this on 10.2.16 and I have also tested this on 10.2.17 and its the the same. We think the problem is the EXISTS() element.

      DROP TABLE IF EXISTS TEST_TABLE_1;
      CREATE TABLE TEST_TABLE_1 (
      UID BIGINT
      );

      DROP TABLE IF EXISTS TEST_TABLE_2;
      CREATE TABLE TEST_TABLE_2 (
      UID BIGINT
      );

      DROP TABLE IF EXISTS TEST_TABLE_3;
      CREATE TABLE TEST_TABLE_3 (
      UID BIGINT
      );

      SELECT
      ROW_NUMBER() OVER (PARTITION BY GROUP_CONCAT(TT1.UID))
      FROM TEST_TABLE_1 TT1
      WHERE EXISTS (
      SELECT *
      FROM TEST_TABLE_2 TT2
      JOIN TEST_TABLE_3 TT3 ON TT2.UID = TT3.UID
      WHERE TT3.UID = TT1.UID
      )
      GROUP BY TT1.UID
      ;

      Attachments

        1. sqlaudit.log
          0.1 kB
        2. slowqry_mariadb.log
          2 kB
        3. server.cnf
          3 kB
        4. query_mariadb.log
          2 kB
        5. error_mariadb.log
          12 kB

        Issue Links

          Activity

            People

              alice Alice Sherepa
              nick.denning@diegesis.co.uk Nicholas Denning
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.