Repository navigation
fix: honor mysql ignore space for built-in functions - #28677
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
ebce9b1 to
31bcca6
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed exact head 31bcca6 against base 7013fbb. Two concrete issues remain: generic TRIM calls now reach a native-only formatter and panic before binding; and IGNORE_SPACE does not enforce the documented reserved-name behavior. Details inline.
Reviewed the lexer lookahead/function allowlist, grammar and generated semantic change, AST/binder consumers, session cache invalidation, saved-mode prepared/view paths, internal SHOW ACCOUNT SQL adjustment and UT/BVT oracles. The intended whitespace-sensitive builtin-vs-UDF distinction, unaffected ABS/MOD controls and session-local mode flag are otherwise scoped. No new runtime wire opcode, asynchronous ownership or per-row allocation path is introduced. The lexer adds lookahead on sensitive names; tests currently focus function calls and omit the two failing contracts below.
Evidence is source-derived, with MySQL's official function-name parsing contract checked; no fresh native UT, live SQL or performance run is claimed. CI was not awaited and live head/base were rechecked before posting.
aptend
left a comment
There was a problem hiding this comment.
Deep review completed on exact head 31bcca6ad3531a8be9ccff92b4fb2d6f94fa4442 against exact base 7013fbbd6e152ba31da2d3dbba7012ac7f8b8462. I read the complete existing review/comment history and both current unresolved threads, then independently audited the full diff and reproduced both blocking contracts below.
The function allowlist matches MySQL's documented whitespace-sensitive set, parser-mode propagation/cache invalidation and saved-mode prepared/view behavior are otherwise coherent. No lifecycle, concurrency, wire-version, or unbounded-allocation risk was introduced.
Validation:
- full
pkg/sql/parsers/dialect/mysqltests passed - focused IGNORE_SPACE parser tests passed under
-race - focused planner and frontend/cache tests passed
- parser regeneration was deterministic;
git diff --checkpassed - review-only counterexample tests reproduced the formatter panic, semantic round-trip loss, and identifier-reservation failures; those tests were removed afterward
The two inline findings are blocking, so I am requesting changes.
07e3866 to
f91c6f1
Compare
8292a09 to
ce91959
Compare
ce91959 to
77d436e
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
The previous TRIM/formatter blocker appears fixed, but the new reserved-function-name check rejects a valid qualified identifier under IGNORE_SPACE.
ident applies rejectSQLModeReservedFunctionName to every unquoted not_keyword/non_reserved_keyword token, including the component after .. In IGNORE_SPACE mode the helper rejects the name unconditionally. Thus SELECT src.count FROM src fails even though count is qualified; MySQL permits reserved words after the qualification dot. The new test currently marks this valid query as an expected error, locking in the regression.
Please distinguish an unqualified identifier used as a function name from a qualified identifier component. Keep the rejection for the unqualified reserved function name, but allow the name following .; change the test to assert the qualified query succeeds, and retain the quoted/unqualified controls. Please also cover qualified DDL names if they share this reduction.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed head 0ec424e57a6316ea297861752c4e6529d8320efb against current base 10ce23e7423d690ece19098e39a78b17236aa771.
The prior blockers are addressed: the identifier check now exempts components after the qualification dot, with positive qualified SELECT and CREATE TABLE coverage; generic TRIM/GROUP_CONCAT formatting is guarded by IsGeneric, and formatting/reparsing preserves the separator and UDF interpretation. Unqualified reserved names and quoted-name controls remain covered.
I reviewed the complete change map: scanner/function allowlist and generated grammar, mode propagation and plan-cache invalidation, AST formatting and binder/UDF dispatch, internal SHOW ACCOUNT SQL, and UT/BVT assertions including saved-mode PREPARE/view execution. The fix is appropriately scoped to parsing/binding. Lookahead adds bounded scanning at sensitive identifiers, with no new per-row execution work, background ownership, retry loop, or wire format. Normal, rejected, quoted, qualified, comment-separated, ANSI, and mode-change paths were considered; no remaining blocking defect was found.
Validation reused from this head: workflow 34681759104 passed owning UT/coverage, SCA, proxy BVT and pessimistic multi-CN BVT. No new local native test or performance run is claimed. Approval applies to the reviewed head.
aptend
left a comment
There was a problem hiding this comment.
Deep re-review completed on exact head 0ec424e against exact current base 10ce23e. I read the complete review history, author replies, and resolved/outdated thread state, compared the changes after my prior reviewed head 31bcca6, and re-audited the full diff.
Both prior blockers are closed in code, not only by the replies: generic TRIM/GROUP_CONCAT formatting now respects IsGeneric and preserves the separator through format/reparse, while sensitive identifiers are rejected in the required unqualified contexts and remain valid after a qualification dot. The parser allowlist matches the documented MySQL 8.4 whitespace-sensitive set; mode propagation, plan-cache invalidation, saved-mode PREPARE/view behavior, internal SQL, and normal/error/quoted/comment-separated controls are coherent. I found no remaining blocking correctness, lifecycle, concurrency, wire-compatibility, or unbounded-work issue.
Validation on this exact head: deterministic parser regeneration and git diff --check passed; the full mysql parser package passed; focused IGNORE_SPACE parser/scanner tests passed under -race; focused planner/UDF-dispatch and frontend plan-cache/internal-SQL tests passed. Exact-head CI Required, Ubuntu UT, coverage, SCA, shared build, proxy BVT, and pessimistic multi-CN BVT are green. Approval applies to this head.
Merge Queue Status
This pull request spent 58 minutes 38 seconds in the queue, including 58 minutes 17 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #28603
What this PR does / why we need it:
fix: honor mysql ignore space for built-in functions