Skip to content

sql: fix the index/table span generation in SHOW RANGES#103667

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20230519-show-ranges
May 23, 2023
Merged

sql: fix the index/table span generation in SHOW RANGES#103667
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20230519-show-ranges

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented May 19, 2023

Fixes #103665.
Needed for #103128.
Epic: CRDB-24928.

Prior to this patch, the table_/index_ start/end key pairs emitted under WITH TABLES/INDEXES were incorrectly computed to span the entire SQL object, not just the intersection between the object and the current range.

This patch fixes it.

Release note (bug fix): When the option WITH TABLES or WITH INDEXES is passed to SHOW RANGES, the per-object start/end key columns now properly refer to the part of the object included inside the range identified by the current row. Previously, they could incorrectly point to keys outside of the current range's boundaries. This bug had been introduced in v23.1.

Prior to this patch, the `table_`/`index_` start/end key pairs emitted
under WITH TABLES/INDEXES were incorrectly computed to span the entire
SQL object, not just the intersection between the object and the
current range.

This patch fixes it.

Release note (bug fix): When the option `WITH TABLES` or `WITH
INDEXES` is passed to `SHOW RANGES`, the per-object start/end key
columns now properly refer to the part of the object included inside
the range identified by the current row. Previously, they could
incorrectly point to keys outside of the current range's boundaries.
This bug had been introduced in v23.1.
@knz knz added the backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only label May 19, 2023
@knz knz requested a review from zachlite May 19, 2023 13:47
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@zachlite zachlite left a comment

Choose a reason for hiding this comment

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

Good catch! LGTM.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented May 23, 2023

TFYR!

bors r=zachlite

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 23, 2023

Build failed:

@knz
Copy link
Copy Markdown
Contributor Author

knz commented May 23, 2023

Build failed on 2 different flakes: #103772 and #103774.

bors r=tbg

@craig
Copy link
Copy Markdown
Contributor

craig bot commented May 23, 2023

Build succeeded:

@craig craig bot merged commit 3d1c664 into cockroachdb:master May 23, 2023
@knz knz deleted the 20230519-show-ranges branch May 23, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-23.1.x PAST MAINTENANCE SUPPORT: 23.1 patch releases via ER request only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql: SHOW RANGES does not properly compute object intersections

3 participants