Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidb-functions: add info about special start_key/end_key values (#6728) #15604

Merged

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #6728

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)

  • master (the latest development version)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • 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)

@ti-chi-bot ti-chi-bot added area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 6, 2023
@ti-chi-bot ti-chi-bot added the type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR. label Dec 6, 2023
@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Dec 6, 2023

/approve

Copy link

ti-chi-bot bot commented Dec 6, 2023

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Dec 6, 2023
@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Dec 6, 2023

/verify

@ti-chi-bot ti-chi-bot bot merged commit 3e10786 into pingcap:release-7.1 Dec 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. lgtm size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-7.1 This PR is cherry-picked to release-7.1 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants