select c.name as customer_name, o.id as order_id, o.date, sum(ol.count*p.price) as total from Orders o join OrderLines ol on o.id=ol.order_id join Products p on p.id=ol.product_id join Customers c on c.id=o.customer_id group by o
Hint panel says "no such column o on table Orders, OrderLines, Products, Customers" - not sure whether we expect to hint/complete the o alias here, but the hint message is misleading in any case.
This query text:
```
select c.name as customer_name, o.id as order_id, o.date, sum(ol.count*p.price) as total from Orders o join OrderLines ol on o.id=ol.order_id join Products p on p.id=ol.product_id join Customers c on c.id=o.customer_id group by o
```
Hint panel says "no such column `o` on table `Orders, OrderLines, Products, Customers`" - not sure whether we expect to hint/complete the `o` alias here, but the hint message is misleading in any case.
Misleading message — a bare in-scope table alias (o) used where a column is expected no longer reports no such column o on table Orders, .... It now emits a targeted hint: o` is a table alias — write `o.<column>` to reference one of its columns (and the table_used_as_column variant for an un-aliased table source). It's a drop-in replacement for unknown_column at the same span/Error severity, so the validity indicator, token overlay and hint panel behave exactly as before — only the wording changes.
Hint/complete the alias — yes, we now do. At a bare SQL-expression slot (projection / WHERE / GROUP BY / HAVING, not already past a qualifier.) completion offers each FROM source's qualifier (its alias if it has one, else the table name) as a Tab candidate, so o is discoverable on the way to o.<column>. On an exact-alias partial the alias source steps aside so the targeted hint surfaces instead of sibling-alias noise.
Two correctness guards (each with regression tests):
SQL only — the hint is gated to role == "sql_expr_ident". The simple-mode DSL Expr reaches the same code path but has no table.column syntax, so a DSL bare table-name ref keeps the generic unknown_column (advising the qualified form there would be wrong).
Effective-qualifier match — an aliased source must be referenced by its alias; FROM a x … GROUP BY a is invalid SQL, so the shadowed real name a falls through to unknown_column rather than being advised as a.<column>.
A genuine unknown column still reports no such column verbatim.
Decision recorded in ADR-0032 Amendment 3. +10 tests; full suite green (2417 pass, 1 ignored).
Fixed in `7e4bc12`.
**Both halves of the report addressed:**
1. **Misleading message** — a bare in-scope table alias (`o`) used where a column is expected no longer reports `no such column o on table Orders, ...`. It now emits a targeted hint: **``o` is a table alias — write `o.<column>` to reference one of its columns``** (and the `table_used_as_column` variant for an un-aliased table source). It's a drop-in replacement for `unknown_column` at the same span/Error severity, so the validity indicator, token overlay and hint panel behave exactly as before — only the wording changes.
2. **Hint/complete the alias** — yes, we now do. At a bare SQL-expression slot (projection / `WHERE` / `GROUP BY` / `HAVING`, not already past a `qualifier.`) completion offers each FROM source's qualifier (its alias if it has one, else the table name) as a Tab candidate, so `o` is discoverable on the way to `o.<column>`. On an exact-alias partial the alias source steps aside so the targeted hint surfaces instead of sibling-alias noise.
**Two correctness guards** (each with regression tests):
- **SQL only** — the hint is gated to `role == "sql_expr_ident"`. The simple-mode DSL `Expr` reaches the same code path but has no `table.column` syntax, so a DSL bare table-name ref keeps the generic `unknown_column` (advising the qualified form there would be wrong).
- **Effective-qualifier match** — an aliased source must be referenced by its alias; `FROM a x … GROUP BY a` is invalid SQL, so the shadowed real name `a` falls through to `unknown_column` rather than being advised as `a.<column>`.
A genuine unknown column still reports `no such column` verbatim.
Decision recorded in **ADR-0032 Amendment 3**. +10 tests; full suite green (2417 pass, 1 ignored).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This query text:
Hint panel says "no such column
oon tableOrders, OrderLines, Products, Customers" - not sure whether we expect to hint/complete theoalias here, but the hint message is misleading in any case.Fixed in
7e4bc12.Both halves of the report addressed:
Misleading message — a bare in-scope table alias (
o) used where a column is expected no longer reportsno such column o on table Orders, .... It now emits a targeted hint:o` is a table alias — write `o.<column>` to reference one of its columns(and thetable_used_as_columnvariant for an un-aliased table source). It's a drop-in replacement forunknown_columnat the same span/Error severity, so the validity indicator, token overlay and hint panel behave exactly as before — only the wording changes.Hint/complete the alias — yes, we now do. At a bare SQL-expression slot (projection /
WHERE/GROUP BY/HAVING, not already past aqualifier.) completion offers each FROM source's qualifier (its alias if it has one, else the table name) as a Tab candidate, soois discoverable on the way too.<column>. On an exact-alias partial the alias source steps aside so the targeted hint surfaces instead of sibling-alias noise.Two correctness guards (each with regression tests):
role == "sql_expr_ident". The simple-mode DSLExprreaches the same code path but has notable.columnsyntax, so a DSL bare table-name ref keeps the genericunknown_column(advising the qualified form there would be wrong).FROM a x … GROUP BY ais invalid SQL, so the shadowed real nameafalls through tounknown_columnrather than being advised asa.<column>.A genuine unknown column still reports
no such columnverbatim.Decision recorded in ADR-0032 Amendment 3. +10 tests; full suite green (2417 pass, 1 ignored).