Skip to content

opt: fix error when crdb_internal_mvcc_timestamp used in view#63413

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
rytaft:view-error
Apr 13, 2021
Merged

opt: fix error when crdb_internal_mvcc_timestamp used in view#63413
craig[bot] merged 1 commit intocockroachdb:masterfrom
rytaft:view-error

Conversation

@rytaft
Copy link
Copy Markdown
Collaborator

@rytaft rytaft commented Apr 9, 2021

Prior to this commit, selecting crdb_internal_mvcc_timestamp in a view
caused an index out of range error since the execFactory tried to find
the column in the table descriptor's PublicColumns(). This commit fixes
the error by searching instead in AllColumns().

Fixes #62798

Release note (bug fix): Fixed an index out of range error that could
occur when crdb_internal_mvcc_timestamp was selected as part of a view.
It is now possible to select crdb_internal_mvcc_timestamp as part of
a view as long as it is aliased with a different name.

Prior to this commit, selecting crdb_internal_mvcc_timestamp in a view
caused an index out of range error since the execFactory tried to find
the column in the table descriptor's PublicColumns(). This commit fixes
the error by searching instead in AllColumns().

Fixes cockroachdb#62798

Release note (bug fix): Fixed an index out of range error that could
occur when crdb_internal_mvcc_timestamp was selected as part of a view.
It is now possible to select crdb_internal_mvcc_timestamp as part of
a view as long as it is aliased with a different name.
@rytaft rytaft requested review from a team and solongordon April 9, 2021 22:12
@rytaft rytaft requested a review from a team as a code owner April 9, 2021 22:12
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@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.

:lgtm:

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

Copy link
Copy Markdown
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 @solongordon)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 13, 2021

Build succeeded:

@craig craig bot merged commit 7495d19 into cockroachdb:master Apr 13, 2021
@RaduBerinde
Copy link
Copy Markdown
Member

:lgtm:

@RaduBerinde
Copy link
Copy Markdown
Member

Should we backport to 21.1 and 20.2?

@rytaft
Copy link
Copy Markdown
Collaborator Author

rytaft commented Apr 14, 2021

Yea, good call.

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.

sql: unexpected error when using crdb_internal_mvcc_timestamp in a view

5 participants