Gabriel39 opened a new pull request, #69541:
URL: https://github.com/apache/doris/pull/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.
- [ ] Regression test: p0 suite added; cluster execution pending.
- 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]