Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4232

Wrong detection of recursive plans when same aliases are used in nested CTEs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 9.0
    • Fix Version/s: 9.0
    • Component/s: Query Engine
    • Labels:
      None

      Description

      I defined the following view:

      create view v1 as
      WITH mycte as (SELECT 1 as col1) SELECT col1 FROM mycte;
      

      If I run this query:

      WITH mycte as (SELECT * FROM views.v1) SELECT * from mycte ;
      

      it fails on generate the query plan with this exception:

      TEIID31124 Recursive plan detected.  Command type Query was already issued against mycte.  Planning cycle: [Query mycte, Query views.v1]
      

      Using /*+ no_inline */ hint to prevent the inlining doesn't fail and returns the correct result.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                fox123 Salvatore R.
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: