Repository navigation
Conversation
Member
|
This is an automated comment for commit 3a18e3f with description of existing statuses. It's updated for the latest CI running
|
Makes the actual and the documented behavior consistent.
tupleElement() with default values
KochetovNicolai
approved these changes
Jun 29, 2023
KochetovNicolai
left a comment
Member
There was a problem hiding this comment.
Ok.
Maybe mark it as backward compatibility?
Member
Author
|
Merged into |
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.
Closes #51525
(same as #51534 but against master)
This PR does two things (besides an extra commit with cosmetics):
tupleElement()now returns the default value if the index argument is out-of-bounds and a default value is given (it previously threw an exception). This aligns the documented and expected behavior with the actual behavior. Note that we continue to throw an exception if the index argument is out-of-bounds and no default value is given.tupleElement()now allows default values of arbitrary type, fixing Fuzzer: Logical error in tupleElement() #51525 as a side effect. This logical error happened in a sanity check which made sure that an input value ofArraytype has the same size (element count) as the (Array) default value. There was some discussion about this in the original PR but I don't really understand why this restriction is necessary. On the one hand, lifting it simplifies the code + will allow useful statements likeSELECT tupleElement([(1, 2), (3, 4)], 'no column name', 'invalid column'), on the other hand, operatorstuple.index,tuple.name,array.indexandarray.nameare not affected anyways as they don't use default values.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix a logical assert in "tupleElement()" with default values