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

    • Bug
    • Resolution: Done
    • Major
    • 9.0
    • 9.0
    • Query Engine
    • 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.

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            redfox999 Salvatore R. (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: