executor: Fix LIKE with non-ASCII patterns on unsigned-char platforms (#11038) - #11047
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yongman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #11038
What problem does this PR solve?
Issue Number: close #11037
Problem Summary
LIKEpattern matching can produce incorrect results for non-ASCII patterns on platforms wherecharis unsigned, such as Linux AArch64.The implementation used
charvalues as sentinel states while scanning UTF-8 characters. Bytes greater than0x7Fwere interpreted differently whencharis unsigned, causing the matcher to incorrectly handle escaped non-ASCII characters and patterns containing UTF-8 literals.The initial correctness fix avoided the signedness-dependent behavior, but introduced an extra per-character decoding cost in the hot matching path. This could cause a measurable performance regression for common
LIKEworkloads on AArch64.What is changed and how it works
charsentinel handling in theLIKEmatcher with an explicit representation that works consistently regardless of whether the compiler treatscharas signed or unsigned.As a result,
LIKEmatching is correct for non-ASCII patterns on unsigned-charplatforms, without giving up the substantial performance benefit of the prior optimized implementation.Check List
Tests
Side effects
Documentation
Release note
Summary by CodeRabbit
Bug Fixes
Tests