Commit 03320a5
committed
Fix CTE double-processing - only register names, process in processIndirect
The CTE's inner SELECT was being processed twice:
1. In WITH clause processing (visiting CTE's SELECT)
2. In processIndirect when CTE is referenced
This caused issues because the annotated AST would have stale/conflicting
data from the first pass when processIndirect tried to analyze it.
Subqueries don't have this issue - they're processed only once in
processIndirect. CTEs should follow the same pattern: just register
the CTE name in the registry, and let processIndirect handle all the
actual SELECT processing when the CTE is referenced.1 parent 9310974 commit 03320a5
1 file changed
+4
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
220 | 223 | | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | 227 | | |
232 | 228 | | |
233 | 229 | | |
| |||
0 commit comments