expression: fix IS_IPV4_COMPAT for all-zero address#68438
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe ChangesIPv4-compat all-zero address fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #68438 +/- ##
================================================
- Coverage 77.2762% 76.4894% -0.7869%
================================================
Files 2010 1992 -18
Lines 555477 557618 +2141
================================================
- Hits 429252 426519 -2733
- Misses 125305 131054 +5749
+ Partials 920 45 -875
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest-required |
1 similar comment
|
/retest-required |
What problem does this PR solve?
Issue Number: close #59458
Problem Summary:
IS_IPV4_COMPAT(X'00000000000000000000000000000000')returned1, while MySQL-compatible behavior expects0for the all-zero IPv6 unspecified address.What changed and how does it work?
This PR adds a shared
IS_IPV4_COMPATbinary classifier for both scalar and vectorized evaluation.The function still requires a 16-byte IPv6 value with a zero 12-byte prefix, but it now rejects the all-zero address by requiring at least one non-zero byte in the embedded IPv4 suffix.
Check List
Tests
./tools/check/failpoint-go-test.sh pkg/expression -run TestIsIPv4Compat -count=1./tools/check/failpoint-go-test.sh pkg/expression -run TestVectorizedBuiltinMiscellaneousFunc -count=1 -args builtinIsIPv4CompatSig./tools/check/failpoint-go-test.sh pkg/expression/integration_test -run TestVectorMiscFunctions -count=1git diff --check -- pkg/expression/builtin_miscellaneous.go pkg/expression/builtin_miscellaneous_vec.go pkg/expression/builtin_miscellaneous_test.go pkg/expression/builtin_miscellaneous_vec_test.go pkg/expression/integration_test/integration_test.gomake lintSide effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit