Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0beb011422
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if idx + keyword.len() > upper.len() { | ||
| return false; | ||
| } | ||
| if &upper[idx..idx + keyword.len()] != keyword { |
There was a problem hiding this comment.
Avoid UTF-8 slicing with byte offsets
The new has_group_by_anywhere/matches_keyword_at path scans the uppercased SQL by byte index and then slices upper[idx..idx + keyword.len()]. In Rust this panics if idx is not on a UTF-8 boundary, which will happen whenever the SQL contains any non-ASCII character (e.g., quoted identifiers or string literals like "地区") because the loop increments idx one byte at a time and to_uppercase() can change byte lengths. This means semantic expansion can crash at runtime for valid SQL containing Unicode.
Useful? React with 👍 / 👎.
Fix GROUP BY spacing detection in semantic expansion and view processing. Add SQLLogic coverage for GROUP BY spacing in CREATE VIEW and SELECT. Tests: make test.