fix(oracle): guard SUBSTRB end boundary - #1848
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe multibyte ChangesSUBSTRB multibyte boundary handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change prevents SUBSTRB from inspecting beyond a multibyte input boundary and adds coverage for an exact UTF-8 byte boundary. The implementation and regression expectation align, with no remaining merge-blocking risk. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The implementation guards the multibyte SUBSTRB boundary before advancing and inspecting the next character. The SQL and expected-output changes add regression coverage for a UTF-8 substring that ends at the source boundary. These changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
|
Thank you for this patch! We'll review it shortly. |
Summary - stop SUBSTRB from calling pg_mblen after reaching the end of a multibyte varlena payload - cover a substring ending exactly at the UTF-8 source boundary ## Testing - git diff --check Closes #1844 ## Summary by CodeRabbit * Bug Fixes * Corrected byte-based substring handling for multibyte text. *
SUBSTRBnow returns the complete string when the requested byte length ends exactly at a multibyte character boundary. * Tests * Added regression coverage forSUBSTRB('你好', 1, 6), confirming the expected result.