dynamobi/dynamobi — Issue #718: [FRG-154] Add rule to pull expressions through a setop
Author: dynamobi-build
Created: 2011-12-30 03:45:00+00:00
State: open
Labels: FRG

[reporter="jhyde", created="Sat, 24 Jun 2006 18:41:35 -0500 (GMT-05:00)"]
Add rule to pull expressions through a setop.

For example,

select 5, x from t union all select 5, y from u

can be rewritten as

select 5, x from (select x from t union all select y from u)

This rule can be applied to all set operations, regardless of whether 'ALL' is specified.

It is especially useful in DT's imlementation of VALUES ('a'), ('b'), where pulling up CURRENT_ROW_TIMESTAMP function call will yield relational expressions which are obviously constant.