Skip to content

feat(collation): add a constant-space rune LIKE matcher - #33758

Draft
VioletQwQ-0 wants to merge 2 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/like-rune-matcher-30833
Draft

VioletQwQ-0 wants to merge 2 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/like-rune-matcher-30833

Conversation

@VioletQwQ-0

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Prerequisite for #30833 and the JSON_SEARCH portion of #28033.

What this PR does / why we need it:

Add a reusable LIKE matcher for collations with one comparison rune per character. It compares literals without compiling a regular expression or allocating a temporary pattern or subject. It also handles escape characters and Unicode wildcards, anchors the fixed suffix after the last percent wildcard, checks cancellation, and bounds the work spent retrying interior segments. Existing SQL LIKE call sites keep their current matcher.

Validation on personal Ubuntu with Go 1.27.1:

  • The collation package passed under the race detector with the same package source and Go module files as this branch.
  • Differential tests compare escape and wildcard behavior with the existing weighted matcher. Allocation assertions cover large literal and wildcard patterns. Tests also cover the general case-insensitive fold and cancellation.
  • git diff --check and the local scope preflight passed. SQL integration is covered in feat(json): implement JSON_SEARCH compatibility #30833.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Dec 3, 2026

This branch had an error being deployed

1 failed (outdated) deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants