← 输入框|github.com|刷新
Skip to content

[sqllib] Fix POSITION and REPLACE with an empty needle - #7775

Merged
mihaibudiu merged 1 commit into
mainfrom
issue7772
Nov 1, 2026
Merged

mihaibudiu merged 1 commit into
mainfrom
issue7772

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor
  • POSITION of an empty VARBINARY needle returns 1 instead of panicking.
  • REPLACE with an empty needle returns the haystack unchanged.

Fixes #7772

Checklist

  • Unit tests added/updated
  • Documentation updated

- POSITION of an empty VARBINARY needle returns 1 instead of panicking.
- REPLACE with an empty needle returns the haystack unchanged.

Fixes #7772

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

LGTM.

Check Result
cargo check --locked -p feldera-sqllib pass
./build.sh + FunctionsTest#testPositionEmptyNeedle+testReplaceEmptyNeedle 2/2 pass
Regression coverage both tests fail on the old code (windows(0) panics; Rust str::replace("", …) yields xaxbxcx)
feldera-pr-checks gates tests, docs, and commit message all OK; no unsafe, deps, or breaking changes

@mihaibudiu
mihaibudiu added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 5adf603 Nov 1, 2026
3 checks passed
@mihaibudiu
mihaibudiu deleted the issue7772 branch November 1, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SQL] POSITION panics when the binary search value is empty

2 participants