New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release-23.2: sql: allow dropping routines with UDT-typed parameters #115904
Merged
DrewKimball
merged 1 commit into
release-23.2
from
blathers/backport-release-23.2-115848
Dec 11, 2023
Merged
release-23.2: sql: allow dropping routines with UDT-typed parameters #115904
DrewKimball
merged 1 commit into
release-23.2
from
blathers/backport-release-23.2-115848
Dec 11, 2023
Conversation
This file contains 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
Previously, it was not possible to specify UDT parameters when dropping a routine. This is because of an oversight in `MatchAtIdentical`, which was likely copied from `MatchAt`. Specifically, `MatchAt` has special handling for tuple types that take advantage of the fact that `types.Equivalent` allows `types.AnyTuple` to match with any other tuple. `MatchAtIdentical, on the other hand, uses `types.Identical`, which does not make the same allowance. This meant that overload resolution would always fail for UDT parameters in code paths that use `MatchAtIdentical`, such as DROP FUNCTION. This patch removes the replacement logic for tuple types in `MatchAtIdentical`, so that `types.Identical` is always called with the original type. This allows statements like the following to succeed: ``` DROP PROCEDURE foo(x udt); ``` Fixes #114677 Release note (bug fix): Fixed a bug existing since v23.1 that prevented naming UDT parameters when dropping a user-defined function (or procedure).
blathers-crl
bot
force-pushed
the
blathers/backport-release-23.2-115848
branch
from
December 9, 2023 01:16
3c8940a
to
b2915dd
Compare
blathers-crl
bot
added
blathers-backport
This is a backport that Blathers created automatically.
O-robot
Originated from a bot.
labels
Dec 9, 2023
Thanks for opening a backport. Please check the backport criteria before merging:
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
Also, please add a brief release justification to the body of your PR to justify this |
blathers-crl
bot
requested review from
DrewKimball,
mgartner and
rharding6373
December 9, 2023 01:16
blathers-crl
bot
added
the
backport
Label PR's that are backports to older release branches
label
Dec 9, 2023
rharding6373
approved these changes
Dec 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball and @mgartner)
rafiss
approved these changes
Dec 11, 2023
mgartner
approved these changes
Dec 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport
Label PR's that are backports to older release branches
blathers-backport
This is a backport that Blathers created automatically.
O-robot
Originated from a bot.
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.
Backport 1/1 commits from #115848 on behalf of @DrewKimball.
/cc @cockroachdb/release
Previously, it was not possible to specify UDT parameters when dropping a routine. This is because of an oversight in
MatchAtIdentical
, which was likely copied fromMatchAt
. Specifically,MatchAt
has special handling for tuple types that take advantage of the fact thattypes.Equivalent
allowstypes.AnyTuple
to match with any other tuple.MatchAtIdentical, on the other hand, uses
types.Identical, which does not make the same allowance. This meant that overload resolution would always fail for UDT parameters in code paths that use
MatchAtIdentical`, such as DROP FUNCTION.This patch removes the replacement logic for tuple types in
MatchAtIdentical
, so thattypes.Identical
is always called with the original type. This allows statements like the following to succeed:Fixes #114677
Release note (bug fix): Fixed a bug existing since v23.1 that prevented naming UDT parameters when dropping a user-defined function (or procedure).
Release justification: Fixes a bug that prevents DROP FUNCTION with a UDT parameter.