Skip to content
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

builtins: add missing UnwrapDatum call and change panics to error #49601

Merged
merged 1 commit into from
Jun 2, 2020

Conversation

asubiotto
Copy link
Contributor

getNameForArg does not handle tree.DOidWrappers. The assumption in this code is
that the datum gets unwrapped before calling this code. This commit adds a
missing UnwrapDatum call and changes an unhandled type panic to an error
instead.

Release note (bug fix): a panic observed as "unexpected arg type
tree.DOidWrapper" has been fixed.

Closes #43166

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@asubiotto
Copy link
Contributor Author

Not sure how to add a test for this, would appreciate any suggestions.

@jordanlewis
Copy link
Member

DOidWrapper is only used for Names. Try passing a Name into one of these casts, maybe?

@asubiotto
Copy link
Contributor Author

Done

@asubiotto
Copy link
Contributor Author

Friendly ping

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto and @jordanlewis)


pkg/sql/logictest/testdata/logic_test/pg_builtins, line 18 at r1 (raw file):

0

# Regression test for https://github.com/cockroachdb/cockroach/issues/49072.

nit: I think we tend to use short form #49072.

@jordanlewis
Copy link
Member

LGTM, thanks for adding the test!

getNameForArg does not handle tree.DOidWrappers. The assumption in this code is
that the datum gets unwrapped before calling this code. This commit adds a
missing UnwrapDatum call and changes an unhandled type panic to an error
instead.

Release note (bug fix): a panic observed as "unexpected arg type
tree.DOidWrapper" has been fixed.
Copy link
Contributor Author

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTRs

bors r=yuzefovich,jordanlewis

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)

@craig
Copy link
Contributor

craig bot commented Jun 2, 2020

Build succeeded

@craig craig bot merged commit 1be1ec0 into cockroachdb:master Jun 2, 2020
@asubiotto asubiotto deleted the uart branch June 11, 2020 11:32
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.

builtins: v19.2.1: unexpected arg type tree.DOidWrapper
4 participants