-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
55543: sql: make SPLIT AT output be consistent with SHOW_RANGES r=ajwerner a=neeral This fixes #24740 The output of the SPLIT AT command returns keys in the form `/Table/52/1/1` whereas the output of SHOW RANGES omits the prefix, of table id and index id, and displays keys as `/1`. This is a little confusing and making them consistent would make it easier to visually compare. This patch strips the prefix from the keys in the output of SPLIT AT. Release note (sql change): pretty column of SPLIT AT output was changed by stripping prefix. This makes it consistent with output from SHOW RANGES. Co-authored-by: neeral <neeral.dodhia@gmail.com>
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# LogicTest: !3node-tenant | ||
|
||
# Test formatting of keys in output of SPLIT AT | ||
|
||
statement ok | ||
CREATE TABLE t (a INT PRIMARY KEY) | ||
|
||
query TTTI colnames,rowsort | ||
SELECT start_key, end_key, replicas, lease_holder FROM [SHOW RANGES FROM TABLE t] | ||
---- | ||
start_key end_key replicas lease_holder | ||
NULL NULL {1} 1 | ||
|
||
query TTT colnames | ||
ALTER TABLE t SPLIT AT VALUES (1), (10) | ||
---- | ||
key pretty split_enforced_until | ||
[189 137 137] /1 2262-04-11 23:47:16.854776 +0000 +0000 | ||
[189 137 146] /10 2262-04-11 23:47:16.854776 +0000 +0000 | ||
|
||
query TTTI colnames,rowsort | ||
SELECT start_key, end_key, replicas, lease_holder FROM [SHOW RANGES FROM TABLE t] | ||
---- | ||
start_key end_key replicas lease_holder | ||
NULL /1 {1} 1 | ||
/1 /10 {1} 1 | ||
/10 NULL {1} 1 | ||
|
||
statement ok | ||
DROP TABLE t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters