Skip to content

sql/inspect: skip REFCURSOR stored columns in consistency check#155772

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
spilchen:gh-155676/251021/1007/inspect-refcursor/pr-ready
Oct 22, 2025
Merged

sql/inspect: skip REFCURSOR stored columns in consistency check#155772
craig[bot] merged 1 commit intocockroachdb:masterfrom
spilchen:gh-155676/251021/1007/inspect-refcursor/pr-ready

Conversation

@spilchen
Copy link
Copy Markdown
Contributor

REFCURSOR values cannot be compared for equality, which breaks the INSPECT command when an index stores a column of this type. During a consistency check, INSPECT attempts to compare stored column payloads between the primary and secondary indexes. This fails for REFCURSOR values because the column type cannot be used in an equality comparison.

This change skips REFCURSOR stored columns during the primary/secondary comparison.

Informs: #155676
Epic: CRDB-55075

Release note (bug fix): INSPECT can now be run on tables with indexes that store REFCURSOR-typed columns.

@spilchen spilchen self-assigned this Oct 21, 2025
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@spilchen spilchen added branch-master Failures and bugs on the master branch. branch-release-25.4 Used to mark GA and release blockers and technical advisories for 25.4 labels Oct 21, 2025
@spilchen spilchen marked this pull request as ready for review October 21, 2025 17:38
@spilchen spilchen requested a review from a team as a code owner October 21, 2025 17:38
@spilchen spilchen requested a review from fqazi October 21, 2025 17:38
Copy link
Copy Markdown
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

:lgtm:

One minor suggestion

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


pkg/sql/inspect/index_consistency_check.go line 126 at r1 (raw file):

		col := c.tableDesc.PublicColumns()[pos]
		otherColumns = append(otherColumns, col)
		if col.GetType().Family() != types.RefCursorFamily {

Nit: Lets just have it return for refcursor instead?

REFCURSOR values cannot be compared for equality, which breaks the
`INSPECT` command when an index stores a column of this type. During a
consistency check, INSPECT attempts to compare stored column payloads
between the primary and secondary indexes. This fails for REFCURSOR
values because the column type cannot be used in an equality comparison.

This change skips REFCURSOR stored columns during the primary/secondary
comparison.

Informs: cockroachdb#155676
Epic: CRDB-55075

Release note (bug fix): INSPECT can now be run on tables with indexes
that store REFCURSOR-typed columns.
@spilchen spilchen force-pushed the gh-155676/251021/1007/inspect-refcursor/pr-ready branch from ae84d63 to f9aa66a Compare October 22, 2025 16:24
Copy link
Copy Markdown
Contributor Author

@spilchen spilchen left a comment

Choose a reason for hiding this comment

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

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


pkg/sql/inspect/index_consistency_check.go line 126 at r1 (raw file):

Previously, fqazi (Faizan Qazi) wrote…

Nit: Lets just have it return for refcursor instead?

Done

@spilchen
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r+

@craig craig bot merged commit b59054b into cockroachdb:master Oct 22, 2025
33 of 34 checks passed
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 22, 2025

rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Nov 20, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Nov 21, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Nov 21, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Dec 1, 2025
rishabh7m added a commit to crltest-issue-syncing/cockroach-fork that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-master Failures and bugs on the master branch. branch-release-25.4 Used to mark GA and release blockers and technical advisories for 25.4 v26.1.0-prerelease

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants