SQL: Test and fix the NULL handling of the String functions (#68379)#68684
Merged
palesz merged 3 commits intoelastic:7.xfrom Feb 8, 2021
Merged
SQL: Test and fix the NULL handling of the String functions (#68379)#68684palesz merged 3 commits intoelastic:7.xfrom
palesz merged 3 commits intoelastic:7.xfrom
Conversation
…68379) Fixed the inconsistencies regarding NULL argument handling. NULL literal vs NULL field value as function arguments in some case resulted in different function return values. Functions should return with the same value no matter if the argument(s) came from a field or from a literal. The introduced integration test tests if function calls with same argument values (regardless of literal/field) will return with the same output (also checks if newly added functions are added to the testcases). Fixed the following functions: * Insert: NULL start, length and replacement arguments (as fields) also result in NULL return value instead of returning the input. * Locate: NULL pattern results in NULL return value, NULL optional start argument handled the same as missing start argument * Replace: NULL pattern and replacement results in NULL instead of returning the input * Substring: NULL start or length results in NULL instead of returning the input Fixes elastic#58907
Collaborator
|
Pinging @elastic/es-ql (Team:QL) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed the inconsistencies regarding NULL argument handling.
NULL literal vs NULL field value as function arguments in some case
resulted in different function return values.
Functions should return with the same value no matter if the argument(s)
came from a field or from a literal.
The introduced integration test tests if function calls with same
argument values (regardless of literal/field) will return with the
same output (also checks if newly added functions are added to the
testcases).
Fixed the following functions:
result in NULL return value instead of returning the input.
argument handled the same as missing start argument
returning the input
the input
Fixes #58907
(cherry-pick from a3dbdae)