Commit 25dd36a
SNOW-3489991: block flattening of dropped NEW columns in connect mode
In can_select_statement_be_flattened, the existing guard only refused to
flatten when a dropped NEW column was also is_referenced_by_same_level_column.
This missed the case where a future filter/sort (not yet added at select()
time) references the dropped column, generating invalid SQL.
In connect mode, extend the guard to block flattening unconditionally when
a NEW column is dropped. This preserves the defining subquery and keeps the
column visible to subsequent WHERE/ORDER BY clauses. Non-connect behavior
is unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 9975596 commit 25dd36a
1 file changed
Lines changed: 6 additions & 1 deletion
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2219 | 2219 | | |
2220 | 2220 | | |
2221 | 2221 | | |
2222 | | - | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
2223 | 2228 | | |
2224 | 2229 | | |
2225 | 2230 | | |
| |||
0 commit comments