Commit cf96ea1
fix: Restore implicit alias assignment for views in subquery scopes
Commit 5c2581f added a uniqueness guard to implicit alias assignment
that treated the entire AST as a single scope. This broke views where
the same view is referenced in multiple subqueries (e.g. OUTER APPLY),
since only the first occurrence got an alias and the rest triggered
"Use of tables without using an alias" errors.
Revert to the v0.4.0 behavior of unconditionally assigning
BaseIdentifier as the implicit alias — SQL subquery scopes allow
duplicate alias names. Add regression test for the multi-scope case.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 76c7cc6 commit cf96ea1
File tree
2 files changed
+29
-18
lines changed- src
- SqlInliner.Tests
- SqlInliner
2 files changed
+29
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
50 | 78 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 65 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 66 | + | |
84 | 67 | | |
85 | 68 | | |
86 | 69 | | |
| |||
0 commit comments