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

Outer query reference is not resolved inside a nested set-operation operand

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.4, 11.8, 12.3, 13.1, 12.3.2
    • 10.11, 11.4, 11.8, 12.3, 13.1
    • Optimizer
    • None

    Description

      Description

      MariaDB Server 12.3.2 cannot resolve an outer query's table alias in a correlated SELECT inside a parenthesized INTERSECT operand of UNION. The outer alias is visible to an equivalent flat UNION branch and to a non-nested INTERSECT.

      This report concerns a correlated SELECT in WHERE EXISTS. The reproduction does not place an outer reference inside a FROM-derived table that would require LATERAL.

      How to repeat

       
      SELECT o.a
      FROM (SELECT 1 AS a UNION ALL SELECT 2) AS o
      WHERE EXISTS (
          SELECT 0 WHERE FALSE
          UNION
          (SELECT 1 WHERE o.a = 1 INTERSECT SELECT 1)
      );
      

      Actual result

      ERROR 1109 (42S02): Unknown table 'o' in WHERE
      

      Attachments

        Activity

          People

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