Commit 29b5d9a
fix(sql): validate table qualifiers in single-table scope (SQLR-14) (#167)
SingleTableScope now carries the user-visible scope name (FROM alias
when declared, else the table name) and rejects any other qualifier
with the same unknown-table-qualifier error JoinedScope produces.
Validation covers the projection list, WHERE (including the index-probe
shape, which previously stripped the qualifier via parts.last()),
ORDER BY, GROUP BY keys, aggregate args, and UPDATE SET right-hand
sides. UPDATE / DELETE now plumb their FROM alias through
extract_table_name, so alias forms validate too — and per SQLite
semantics a declared alias shadows the table name as a qualifier.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent b8617d2 commit 29b5d9a
4 files changed
Lines changed: 322 additions & 83 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
0 commit comments