Skip to content

fix: canonicalize keywords and whitespaces - #66

Open
Snehil-Shah wants to merge 2 commits into
ProxySQL:mainfrom
Snehil-Shah:keyword-canonicalization
Open

fix: canonicalize keywords and whitespaces#66
Snehil-Shah wants to merge 2 commits into
ProxySQL:mainfrom
Snehil-Shah:keyword-canonicalization

Conversation

@Snehil-Shah

@Snehil-Shah Snehil-Shah commented Aug 29, 2026

Copy link
Copy Markdown

Currently, many values are stored as spans of the input in the AST, which later produces a different digest for the same query written with different casing, spacing, or comments.

This PR stores the canonical spelling at parse time instead of deriving it from the input, with the parser writing its own separators rather than inheriting whatever sat between tokens. The result is stable ASTs and stable digests.

It also adds dialect-aware canonicalization for function names: MySQL resolves them case-insensitively (including backtick-quoted), while PostgreSQL folds only undelimited names, and folds them down.

Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e3be2aa-28a1-4926-9970-2e16246c20f5


Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@renecannao I added a dedicated file as an AST-level regression suite for this. Let me know if you want it spread across existing files instead.

Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@Snehil-Shah Snehil-Shah changed the title fix: canonicalize keywords fix: canonicalize keywords and whitespaces Aug 30, 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.

1 participant