docs
docs copied to clipboard
tidb-functions: add info about special start_key/end_key values
What is changed, added or deleted? (Required)
sql> SELECT TABLE_NAME, REGION_ID, START_KEY, END_KEY FROM information_schema.TIKV_REGION_STATUS WHERE TABLE_NAME='stock' AND IS_INDEX=0;
+------------+-----------+--------------------------------------------------------+--------------------------------------------------------+
| TABLE_NAME | REGION_ID | START_KEY | END_KEY |
+------------+-----------+--------------------------------------------------------+--------------------------------------------------------+
| stock | 74 | 7480000000000000FF4700000000000000F8 | 7480000000000000FF475F728000000000FF029DF00000000000FA |
| stock | 72 | 7480000000000000FF475F728000000000FF0D7ECA0000000000FA | 7480000000000000FF4900000000000000F8 |
| stock | 78 | 7480000000000000FF475F728000000000FF063E890000000000FA | 7480000000000000FF475F728000000000FF09E0350000000000FA |
| stock | 76 | 7480000000000000FF475F728000000000FF029DF00000000000FA | 7480000000000000FF475F728000000000FF063E890000000000FA |
| stock | 80 | 7480000000000000FF475F728000000000FF09E0350000000000FA | 7480000000000000FF475F728000000000FF0D7ECA0000000000FA |
+------------+-----------+--------------------------------------------------------+--------------------------------------------------------+
5 rows in set (0.0144 sec)
sql> SELECT TIDB_DECODE_KEY('7480000000000000FF4700000000000000F8');
+---------------------------------------------------------+
| TIDB_DECODE_KEY('7480000000000000FF4700000000000000F8') |
+---------------------------------------------------------+
| 7480000000000000FF4700000000000000F8 |
+---------------------------------------------------------+
1 row in set, 1 warning (0.0013 sec)
Warning (code 1105): invalid record/index key: 748000000000000047
sql> SELECT TIDB_DECODE_KEY('7480000000000000FF475F728000000000FF0D7ECA0000000000FA');
+---------------------------------------------------------------------------+
| TIDB_DECODE_KEY('7480000000000000FF475F728000000000FF0D7ECA0000000000FA') |
+---------------------------------------------------------------------------+
| {"_tidb_rowid":884426,"table_id":"71"} |
+---------------------------------------------------------------------------+
1 row in set (0.0013 sec)
sql> SELECT TABLE_NAME, REGION_ID, TIDB_DECODE_KEY(START_KEY) sk, TIDB_DECODE_KEY(END_KEY) ek FROM information_schema.TIKV_REGION_STATUS WHERE TABLE_NAME='stock' AND IS_INDEX=0 ORDER BY IF(JSON_VALID(sk),sk->'$."_tidb_rowid"',0);
+------------+-----------+----------------------------------------+----------------------------------------+
| TABLE_NAME | REGION_ID | sk | ek |
+------------+-----------+----------------------------------------+----------------------------------------+
| stock | 74 | 7480000000000000FF4700000000000000F8 | {"_tidb_rowid":171504,"table_id":"71"} |
| stock | 76 | {"_tidb_rowid":171504,"table_id":"71"} | {"_tidb_rowid":409225,"table_id":"71"} |
| stock | 78 | {"_tidb_rowid":409225,"table_id":"71"} | {"_tidb_rowid":647221,"table_id":"71"} |
| stock | 80 | {"_tidb_rowid":647221,"table_id":"71"} | {"_tidb_rowid":884426,"table_id":"71"} |
| stock | 72 | {"_tidb_rowid":884426,"table_id":"71"} | 7480000000000000FF4900000000000000F8 |
+------------+-----------+----------------------------------------+----------------------------------------+
5 rows in set, 2 warnings (0.0133 sec)
Warning (code 1105): invalid record/index key: 748000000000000047
Warning (code 1105): invalid record/index key: 748000000000000049
Which TiDB version(s) do your changes apply to? (Required)
- [x] master (the latest development version)
- [x] v5.4 (TiDB 5.4 versions)
- [x] v5.3 (TiDB 5.3 versions)
- [x] v5.2 (TiDB 5.2 versions)
- [ ] v5.1 (TiDB 5.1 versions)
- [ ] v5.0 (TiDB 5.0 versions)
- [ ] v4.0 (TiDB 4.0 versions)
- [ ] v3.1 (TiDB 3.1 versions)
- [ ] v3.0 (TiDB 3.0 versions)
- [ ] v2.1 (TiDB 2.1 versions)
[REVIEW NOTIFICATION]
This pull request has not been approved.
To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer
in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer
in the comment to help you merge this pull request.
The full list of commands accepted by this bot can be found here.
Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.
/cc @kolbe
@dveeden this is great, but maybe you could also submit a patch to tidb to make tidb_decode_key do something more sensible with these values 🙂
@kolbe yes, that's my plan.
@kolbe: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.
In response to this:
LGTM
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.
/label needs-cherry-pick-release-5.2
/cc @morgo
/label needs-cherry-pick-release-5.4
Removed the needs-cherry-pick-release-6.3 label because the v6.3 docs have been archived at https://docs-archive.pingcap.com/tidb/v6.3 and will no longer receive new updates.
Removed the needs-cherry-pick-release-6.4 label because the v6.4 docs have been archived at https://docs-archive.pingcap.com/tidb/v6.4 and will no longer receive new updates.
Removed the needs-cherry-pick-release-6.6 label because the v6.6 docs have been archived at https://docs-archive.pingcap.com/tidb/v6.6 and will no longer receive new updates.
@mjonss: adding LGTM is restricted to approvers and reviewers in OWNERS files.
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
[LGTM Timeline notifier]
Timeline:
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Oreoxmt
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [Oreoxmt]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
In response to a cherrypick label: new pull request created to branch release-7.1
: #15604.
In response to a cherrypick label: new pull request created to branch release-7.5
: #15605.
/assign
/translation done
/remove-translation welcome