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
sql: properly qualify the names of dropped views #59058
sql: properly qualify the names of dropped views #59058
Conversation
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.
Reviewed 17 of 17 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @the-ericwang35)
pkg/sql/resolver.go, line 405 at r1 (raw file):
// reverse of the Resolve() functions. func (p *planner) getQualifiedTableName( ctx context.Context, desc catalog.TableDescriptor, flags tree.DatabaseLookupFlags,
I think we should just always set IncludeOffline
and IncludeDropped
to true and assume that the caller is fine with resolving a name for something dropped earlier in the transaction, instead of allowing callers to pass in flags. (NB: the GetImmutable
methods try to resolve a leased descriptor unless AvoidCached
is set. But dropped and offline descriptors can't be leased, so we just end up resolving the descriptor from the store every time. But that's fine.)
Fixes #57735. Previously, event logs were not capturing the fully qualified names of dropped views. This PR changes the event logs to use the fully qualified view names. Tests were also updated to reflect this change. Release note (bug fix): add qualification prefix for dropped views.
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! 0 of 0 LGTMs obtained (waiting on @lucy-zhang)
pkg/sql/resolver.go, line 405 at r1 (raw file):
Previously, lucy-zhang (Lucy Zhang) wrote…
I think we should just always set
IncludeOffline
andIncludeDropped
to true and assume that the caller is fine with resolving a name for something dropped earlier in the transaction, instead of allowing callers to pass in flags. (NB: theGetImmutable
methods try to resolve a leased descriptor unlessAvoidCached
is set. But dropped and offline descriptors can't be leased, so we just end up resolving the descriptor from the store every time. But that's fine.)
Sure sounds good, I've changed it to always set IncludeOffline
and IncludeDropped
to be true
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.
Reviewed 16 of 16 files at r2.
Reviewable status: complete! 0 of 0 LGTMs obtained
TFTR! bors r+ |
Build succeeded: |
Fixes #57735.
Previously, event logs were not capturing the
fully qualified names of dropped views.
This PR changes the event logs to use the fully
qualified view names.
Tests were also updated to reflect this change.
Release note (bug fix): add qualification prefix for dropped views.