englefly commented on PR #67549:
URL: https://github.com/apache/doris/pull/67549#issuecomment-6135448798
可以本地复现(同一用例同一断言),已修:commit 0986c479a1f。
根因:本 PR 往 statementBase 加的 hboStatement 每个分支都以 `hbo=identifier` 开头,于是
`abcdefg` 这种不匹配任何语句的输入会进入 hbo 分支、吃掉标识符,然后在 SET/DELETE/SHOW 处失败,报成 `no viable
alternative at input 'abcdefg'(line 1, pos 7)`;而其他未知语句(例如 `12345`)是在语句开头报
`extraneous input '12345' expecting {...}`。demo_p0 断言的正是后者。
修法:把 `HBO` 变成词法关键字(`HBO: 'HBO';`)**同时列入 nonReserved**,语句分支以该 token 开头。这样:
- `abcdefg` → `extraneous input 'abcdefg' expecting {<EOF>, ';', '(',
'ADMIN', 'HBO', 'ALTER', ...}`,与 `12345` 一致;
- `hbo` 仍可当标识符(实测 `select 1 as hbo, count(*) hbo from t` 正常);
- `HBO SET/SHOW/DELETE STATISTICS` 照常工作(实测 SET + SHOW PINNED 返回条目)。
顺带说明:先试过在 statementBase 上加语义谓词 `{next token is hbo}?`,**不够**——生成的 decision
里仍然有 IDENTIFIER 分支,错误还是在分支内部报出来(只是位置从 pos 7 变成 pos 0)。所以必须让首词不再是
identifier。plan builder 里对首词的校验随之删除(parser 已保证)。
本地验证:`demo_p0/test_action` 通过(修前失败);`query_p0/hbo` 19 套件、失败 8 个,与改动前完全一致(都是
legacy 缺 `hbo_slow_query_threshold_ms` 的用例)。
--
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]