officialasishkumar opened a new pull request, #63215:
URL: https://github.com/apache/doris/pull/63215
### What problem does this PR solve?
Issue Number: close #62768
Related PR: None
Problem Summary:
`count_substrings` scanned candidate positions even when the remaining
suffix was shorter than the search pattern. Because the implementation uses
`memcmp_small_allow_overflow15`, that could count a tail position where the
full pattern does not fit, for example `count_substrings("ccc", "cc")`.
This PR limits comparisons to positions where the full pattern fits and
keeps the existing not-found distance contract used by the caller.
### Release note
Fix `count_substrings` tail-boundary matching for non-overlapping substring
counts.
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
- Behavior changed:
- [ ] No.
- [x] Yes. `count_substrings` no longer counts a match when the full
pattern does not fit in the remaining suffix.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]