Commit cea2c7d
fix(exec): eagerly validate window function args, FILTER and WHERE too
Extends the window `OVER` column validator to a complete window-query column
check. In addition to each window spec's `PARTITION BY` / `ORDER BY`, it now
resolves the projection expressions (a window function's arguments and its
`FILTER` predicate are visited by the shallow-column walker), the `WHERE`, and
each join `ON` against the base source columns, plus `GROUP BY` / `HAVING` / the
query's top-level `ORDER BY` with the usual output-alias exemption for a bare
name. So `sum(zzz) OVER ()`, `sum(a) FILTER(WHERE zzz > 0) OVER ()`, and a bad
`WHERE` column in a window query are now rejected at prepare time — matching
SQLite — even over an empty or filtered table, closing the last window-query
lazy-validation gaps. Verified vs sqlite3 3.50.4
(`tests/eager_window_over_columns.rs`).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 774e996 commit cea2c7d
2 files changed
Lines changed: 94 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21104 | 21104 | | |
21105 | 21105 | | |
21106 | 21106 | | |
21107 | | - | |
| 21107 | + | |
| 21108 | + | |
| 21109 | + | |
| 21110 | + | |
| 21111 | + | |
| 21112 | + | |
| 21113 | + | |
| 21114 | + | |
| 21115 | + | |
| 21116 | + | |
| 21117 | + | |
| 21118 | + | |
| 21119 | + | |
| 21120 | + | |
| 21121 | + | |
| 21122 | + | |
| 21123 | + | |
| 21124 | + | |
21108 | 21125 | | |
21109 | | - | |
| 21126 | + | |
| 21127 | + | |
| 21128 | + | |
| 21129 | + | |
| 21130 | + | |
| 21131 | + | |
| 21132 | + | |
| 21133 | + | |
| 21134 | + | |
| 21135 | + | |
| 21136 | + | |
| 21137 | + | |
| 21138 | + | |
| 21139 | + | |
| 21140 | + | |
| 21141 | + | |
| 21142 | + | |
| 21143 | + | |
| 21144 | + | |
| 21145 | + | |
| 21146 | + | |
21110 | 21147 | | |
21111 | 21148 | | |
21112 | | - | |
| 21149 | + | |
21113 | 21150 | | |
21114 | 21151 | | |
21115 | 21152 | | |
| |||
21119 | 21156 | | |
21120 | 21157 | | |
21121 | 21158 | | |
| 21159 | + | |
| 21160 | + | |
| 21161 | + | |
| 21162 | + | |
| 21163 | + | |
| 21164 | + | |
| 21165 | + | |
| 21166 | + | |
| 21167 | + | |
| 21168 | + | |
| 21169 | + | |
| 21170 | + | |
| 21171 | + | |
| 21172 | + | |
| 21173 | + | |
| 21174 | + | |
21122 | 21175 | | |
21123 | 21176 | | |
21124 | 21177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
48 | 66 | | |
49 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
50 | 71 | | |
51 | 72 | | |
52 | 73 | | |
53 | 74 | | |
54 | 75 | | |
55 | 76 | | |
56 | 77 | | |
57 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
58 | 92 | | |
59 | 93 | | |
60 | 94 | | |
| |||
0 commit comments