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

opt: fix crdb_internal.decode_plan_gist to work with unknown index #84682

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

rytaft
Copy link
Collaborator

@rytaft rytaft commented Jul 19, 2022

Release note (bug fix): crdb_internal.decode_plan_gist will no longer
produce an internal error when it is used to decode a plan gist for which
no schema information is available.

Release note (bug fix): crdb_internal.decode_plan_gist will no longer
produce an internal error when it is used to decode a plan gist for which
no schema information is available.
@rytaft rytaft requested a review from a team as a code owner July 19, 2022 22:49
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

Nice find! :lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @cucaroach and @rytaft)


pkg/sql/opt/exec/explain/plan_gist_factory.go line 496 at r1 (raw file):

func (u *unknownTable) Index(i cat.IndexOrdinal) cat.Index {
	return &unknownIndex{}

Interesting. I guess decoding can call this function even if IndexCount returns 0? I had assumed nothing would call this function without IndexCount first.

Copy link
Collaborator Author

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r+

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


pkg/sql/opt/exec/explain/plan_gist_factory.go line 496 at r1 (raw file):

Previously, mgartner (Marcus Gartner) wrote…

Interesting. I guess decoding can call this function even if IndexCount returns 0? I had assumed nothing would call this function without IndexCount first.

Yea, there are some functions in emit.go that just assume every non-virtual table has a primary index.

@craig
Copy link
Contributor

craig bot commented Jul 20, 2022

Build failed (retrying...):

Copy link
Contributor

@cucaroach cucaroach left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)

@craig
Copy link
Contributor

craig bot commented Jul 20, 2022

Build succeeded:

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.

4 participants