Skip to content

tidb_row_checksum(): Update docs #17633

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

Merged
merged 5 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions functions-and-operators/tidb-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,14 @@ To enable the checksum feature of single-row data in TiDB (controlled by the sys
SET GLOBAL tidb_enable_row_level_checksum = ON;
```

This configuration only takes effect for newly created sessions, so you need to reconnect to TiDB.

Create table `t` and insert data:

```sql
USE test;
CREATE TABLE t (id INT PRIMARY KEY, k INT, c int);
INSERT INTO TABLE t values (1, 10, a);
CREATE TABLE t (id INT PRIMARY KEY, k INT, c CHAR(1));
INSERT INTO t values (1, 10, 'a');
```

The following statement shows how to query the checksum value of the row where `id = 1` in table `t`:
Expand Down
2 changes: 2 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2771,6 +2771,8 @@ Query OK, 0 rows affected (0.09 sec)

</CustomContent>

- You can use the [`TIDB_ROW_CHECKSUM()`](/functions-and-operators/tidb-functions.md#tidb_row_checksum) function to get the checksum value of a row.

### tidb_enforce_mpp <span class="version-mark">New in v5.1</span>

- Scope: SESSION
Expand Down
Loading