Skip to content

Conversation

@nicosuave
Copy link
Member

@nicosuave nicosuave commented Jan 9, 2026

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.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines 870 to 873
if idx + keyword.len() > upper.len() {
return false;
}
if &upper[idx..idx + keyword.len()] != keyword {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@nicosuave nicosuave closed this Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants