Fix like matching with newlines and no wildcard#23404
Fix like matching with newlines and no wildcard#23404rschlussel merged 1 commit intoprestodb:masterfrom
Conversation
fb43c7a to
2fa50d1
Compare
|
Suggested additional tests cc @tdcmeehan |
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull branch, new local doc build, looks good. Thanks!
|
Nit, suggest adding the PR number to the release note entry |
2fa50d1 to
fa30369
Compare
@jp-sivaprasad Thanks for the review! I added the first test. The second case I felt the existing newline tests with wildcards provided enough coverage, so I left it out. Also, I see now that you had assigned this issue to yourself. Sorry for not coordinating with you first! |
|
@rschlussel has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
hantangwangd
left a comment
There was a problem hiding this comment.
Looks good to me, some little nits.
fa30369 to
300ea9f
Compare
LIKE expressions were not looking past newlines when there was no wild card. That means that certain expressions were incorrectly returning matches when after the newline the input did not match. This change fixes that behavior. For example: SELECT 'foo\nbar' LIKE 'foo'. Previously that query would return "true". Now it will return false.
300ea9f to
21eb6f0
Compare
|
@rschlussel has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Description
LIKE expressions were not looking past newlines when there was no wild card. That means that certain expressions were incorrectly returning matches when after the newline the input did not match. This change fixes that behavior. For example:
SELECT 'foo\nbar' LIKE 'foo'.
Previously that query would return "true". Now it will return false.
Motivation and Context
Fixes #23281
Fixes a bug with like expressions incorrectly matching only to a newline when there is no wildcard.
Impact
Like expressions with patterns that do not end in a wildcard may now return false when previously they would return true
Test Plan
unit tests
verification on our production workload
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.