Files
Gabriel 06af439e3c [fix](parser) Reject unquoted suffixes attached to quoted table names (#69541)
### What problem does this PR solve?

`` SELECT * FROM `t`$snapshots `` currently parses `$snapshots` as an
implicit table alias and silently returns rows from `t`. The same issue
affects qualified names such as `` `catalog`.`db`.`t`$snapshots ``.

Reject an unquoted dollar-prefixed suffix immediately adjacent to a
quoted table name during parsing. The error explains how to quote the
complete table name or separate an intended alias. Supported forms such
as `t$snapshots`, `` `t$snapshots` ``, and `` `t` AS $snapshots ``
remain valid, as do aliases separated by whitespace or comments.

Add parser coverage for qualified names, escaped backticks, non-ASCII
names, explicit and separated aliases, and parsing without building a
tree. Add a p0 regression suite with six syntax-error checks that
require no external catalog.

### Release note

Queries that attach an unquoted dollar suffix directly to a quoted table
name now fail explicitly instead of silently scanning the base table.
Quote the entire system table name, for example `` `t$snapshots` ``.

### Check List (For Author)

- Test
- [x] Unit Test: reproduced the failure before the fix; all 255
`fe-sql-parser` tests pass after the fix.
- [x] Manual test: all six SQL statements in the new regression suite
produce the expected diagnostic with the standalone parser CLI; Groovy
syntax validation passes.
- [x] Regression test: `test_quoted_table_suffix` passed on a locally
built FE/BE cluster; all six syntax-error checks passed.
    - FE Checkstyle: zero violations in the parent and parser modules.
- Behavior changed:
- [x] Yes. Ambiguous adjacent suffixes produce a parse error; explicit
and separated dollar-prefixed aliases retain their existing behavior.
- Does this need documentation?
    - [x] No.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
2026-10-25 22:34:41 +08:00
..