Details

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      The same query will succeed if the inner view is an inline view, rather than an actual view.

      Show
      The same query will succeed if the inner view is an inline view, rather than an actual view.

      Description

      A set operation involving a nested view can result in expression symbols in the select clause of the first union branch which cause the alias generator logic to not work properly (as the expressions can collide) and place an unwanted projected symbol in the select clause of the source query. This could look something like:

      select v_0.c_0 ... v_0.actualName ...

      This can be reproduced with:

      create foreign table smalla (intkey integer, stringkey string);
      create foreign table smallb (intkey integer, stringkey string);
      create view inner_view as (select null as x, null as y from smalla);
      

      and issuing the query:

      select x, y FROM (select x, y, null as z from inner_view union select intkey, stringkey, null from smallb) v LIMIT 99999
      

      Note that the inner_view has two projected expressions with the same constant/null value.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                shawkins Steven Hawkins
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: