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

indexrec: fix internal error with inverted indexes #110116

Merged
merged 1 commit into from Sep 6, 2023

Conversation

mgartner
Copy link
Collaborator

@mgartner mgartner commented Sep 6, 2023

A bug was introduced in #108576 in code that compares index columns of
an existing index and a hypothetical index. Prior to this commit, this
logic only checked that the hypothetical index column was an inverted
column (the last explicitly indexed column in an inverted index) before
fetching the inverted source column ordinal for both the hypothetical
and existing index column. When the existing index column was not an
inverted column, and internal error would occur.

This commit fixes the bug by checking that both the hypothetical and
existing index columns are inverted columns before fetching the source
column ordinals.

There is no release note because this bug does not exist in any
releases.

Fixes #109974

Release note: None

A bug was introduced in cockroachdb#108576 in code that compares index columns of
an existing index and a hypothetical index. Prior to this commit, this
logic only checked that the hypothetical index column was an inverted
column (the last explicitly indexed column in an inverted index) before
fetching the inverted source column ordinal for both the hypothetical
and existing index column. When the existing index column was not an
inverted column, and internal error would occur.

This commit fixes the bug by checking that both the hypothetical and
existing index columns are inverted columns before fetching the source
column ordinals.

There is no release note because this bug does not exist in any
releases.

Fixes cockroachdb#109974

Release note: None
@mgartner mgartner requested a review from a team as a code owner September 6, 2023 16:15
@mgartner mgartner requested review from DrewKimball and removed request for a team September 6, 2023 16:15
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@mgartner mgartner requested review from michae2 and a team September 6, 2023 16:16
@mgartner mgartner added backport-22.2.x Flags PRs that need to be backported to 22.2. backport-23.1.x Flags PRs that need to be backported to 23.1 FROZEN.backport-23.1.11-rc labels Sep 6, 2023
Copy link
Collaborator

@DrewKimball DrewKimball 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, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2)

Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

Gah, good catch! :lgtm:

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

@mgartner
Copy link
Collaborator Author

mgartner commented Sep 6, 2023

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 6, 2023

Build succeeded:

@craig craig bot merged commit 86adbd4 into cockroachdb:master Sep 6, 2023
8 checks passed
@blathers-crl
Copy link

blathers-crl bot commented Sep 6, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from b10ee46 to blathers/backport-release-22.2-110116: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-22.2.x Flags PRs that need to be backported to 22.2. backport-23.1.x Flags PRs that need to be backported to 23.1 FROZEN.backport-23.1.11-rc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

roachtest: sqlsmith/setup=rand-tables/setting=default failed
4 participants