Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Add format support:

  • ShowPrivilegesQuery and ShowCreateQuotaQuery statements
  • INTERSECT/EXCEPT operators (stored in AST)
  • Backslash escaping in string literals

Add test normalizations for semantically equivalent SQL:

  • Backslash escapes in strings (\, ')
  • REGEXP operator to match() function
  • Heredoc syntax ($$...$$ to '...')
  • Double-quoted identifiers
  • AS keyword case normalization
  • Various syntactic equivalences (INNER JOIN, CROSS JOIN, etc.)

Add format support:
- ShowPrivilegesQuery and ShowCreateQuotaQuery statements
- INTERSECT/EXCEPT operators (stored in AST)
- Backslash escaping in string literals

Add test normalizations for semantically equivalent SQL:
- Backslash escapes in strings (\\, \')
- REGEXP operator to match() function
- Heredoc syntax ($$...$$ to '...')
- Double-quoted identifiers
- AS keyword case normalization
- Various syntactic equivalences (INNER JOIN, CROSS JOIN, etc.)
Extract normalization code from parser_test.go into a dedicated package:
- DecodeHexEscapes: decode \xNN sequences
- Whitespace: collapse whitespace
- EscapesInStrings: normalize \' to '' and \\ to \
- CommasOutsideStrings: normalize comma spacing
- ForFormat: comprehensive SQL normalization for format comparison
- StripComments: remove SQL comments

Pre-compile regexes for better performance.
@kyleconroy kyleconroy merged commit 49cbb1f into main Dec 28, 2025
1 check passed
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.

3 participants