Skip to content

sql: update the SHOW RANGE FOR ROW command to just take index cols#50479

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
rohany:range-for-row-updated
Jun 22, 2020
Merged

sql: update the SHOW RANGE FOR ROW command to just take index cols#50479
craig[bot] merged 1 commit intocockroachdb:masterfrom
rohany:range-for-row-updated

Conversation

@rohany
Copy link
Copy Markdown
Contributor

@rohany rohany commented Jun 22, 2020

Fixes #41421.

The SHOW RANGE FOR ROW command was difficult to use because it required
the user to input all of the columns in a particular row. This PR
changes the command to only require inputting the index columns now.

Release note (backward-incompatible change): The SHOW RANGE FOR ROW
command has been changed to take in a tuple of the row's index columns,
rather than the full column set of the row.

@rohany rohany requested a review from solongordon June 22, 2020 15:33
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Jun 22, 2020

cc @awoods187, mind playing around with this once it lands?

Copy link
Copy Markdown
Contributor

@solongordon solongordon left a comment

Choose a reason for hiding this comment

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

LGTM though let's give the user more help in the weird implicit columns case.

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


pkg/sql/sem/builtins/builtins.go, line 3332 at r1 (raw file):

						return nil, errors.WithHintf(
							err,
							"columns %v are implicitly part of index %q's key and must be included",

I wonder if we can make this message clearer. It's not clear what order the columns should be provided in. Maybe it would be more helpful to provide a complete list of the columns which should be specified.

Fixes cockroachdb#41421.

The SHOW RANGE FOR ROW command was difficult to use because it required
the user to input all of the columns in a particular row. This PR
changes the command to only require inputting the index columns now.

Release note (backward-incompatible change): The SHOW RANGE FOR ROW
command has been changed to take in a tuple of the row's index columns,
rather than the full column set of the row.
@rohany rohany force-pushed the range-for-row-updated branch from 06fb35c to e039bac Compare June 22, 2020 18:29
@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Jun 22, 2020

Updated the message, PTAL

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Jun 22, 2020

bors r=solongordon

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 22, 2020

Build failed (retrying...)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 22, 2020

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.

sql: allow SHOW RANGE FROM TABLE foo FOR ROW to only apply for fields in PK

3 participants