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

Incorrect name resolution in CTE

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.8.8, 10.4.31, 11.3, 10.6.15, 10.9.8, 10.11.5, 11.0.3, 11.1.2, 11.2.1
    • 10.4, 10.6, 10.11, 11.1, 11.2
    • Optimizer - CTE
    • None

    Description

       
      create table t1 (c1 int, c2 int, c3 int);
      create table t2 like t1;
       
      with d3 (a1, a2, a3) as (select * from t1 union select * from t2 order by c1) select * from d3;
      

      ERROR 1054 (42S22): Unknown column 'c1' in 'order clause'

      code in st_select_lex_unit::prepare() is renaming columns in the select_lex before name resolution happens (in this case setting up order).

      Attachments

        Issue Links

          Activity

            People

              Johnston Rex Johnston
              Johnston Rex Johnston
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.