From e1daf967e660f545d8cf372a54c9b87c076a0e24 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Wed, 12 Aug 2026 09:55:45 +0800 Subject: [PATCH 1/3] Create empty translation PR From 1e0eb57c0a2f6f5e9566a5961300cd43b76f92fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Aug 2026 01:57:46 +0000 Subject: [PATCH 2/3] Auto-sync: Update English docs from Chinese PR Synced from: https://github.com/pingcap/docs-cn/pull/21863 Target PR: https://github.com/pingcap/docs/pull/23498 Co-authored-by: github-actions[bot] --- auto-random.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto-random.md b/auto-random.md index eb7a7cde676f5..e9b95e792dcb1 100644 --- a/auto-random.md +++ b/auto-random.md @@ -118,9 +118,10 @@ The structure of an `AUTO_RANDOM` value without a signed bit is as follows: |-------------|--------|--------------| | `64-R` bits | `S` bits | `R-S` bits | -- Whether a value has a signed bit depends on whether the corresponding column has the `UNSIGNED` attribute. -- The length of the sign bit is determined by the existence of an `UNSIGNED` attribute. If there is an `UNSIGNED` attribute, the length is `0`. Otherwise, the length is `1`. +- Whether an `AUTO_RANDOM` column has a signed bit depends on whether the column has the `UNSIGNED` attribute. A column without the `UNSIGNED` attribute has 1 signed bit, and a column with the `UNSIGNED` attribute has no signed bit. +- Values implicitly allocated to an `AUTO_RANDOM` column are always positive. For columns with a signed bit, the signed bit of implicitly allocated values is always `0`. This rule does not apply to explicitly inserted values. - The length of the reserved bits is `64-R`. The reserved bits are always `0`. +- The auto-increment bits must be at least 27 bits. For signed columns, `R-1-S >= 27` must be satisfied. For unsigned columns, `R-S >= 27` must be satisfied. - The content of the shard bits is obtained by calculating the hash value of the starting time of the current transaction. To use a different length of shard bits (such as 10), you can specify `AUTO_RANDOM(10)` when creating the table. - The value of the auto-increment bits is stored in the storage engine and allocated sequentially. Each time a new value is allocated, the value is incremented by 1. The auto-increment bits ensure that the values of `AUTO_RANDOM` are unique globally. When the auto-increment bits are exhausted, an error `Failed to read auto-increment value from storage engine` is reported when the value is allocated again. - Value range: the maximum number of bits for the final generated value = shard bits + auto-increment bits. The range of a signed column is `[-(2^(R-1))+1, (2^(R-1))-1]`, and the range of an unsigned column is `[0, (2^R)-1]`. From 6ac03725c5a0e279f191cd244c9fc795287c1b32 Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Wed, 12 Aug 2026 10:10:37 +0800 Subject: [PATCH 3/3] Update auto-random.md --- auto-random.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-random.md b/auto-random.md index e9b95e792dcb1..50d02b1916278 100644 --- a/auto-random.md +++ b/auto-random.md @@ -118,7 +118,7 @@ The structure of an `AUTO_RANDOM` value without a signed bit is as follows: |-------------|--------|--------------| | `64-R` bits | `S` bits | `R-S` bits | -- Whether an `AUTO_RANDOM` column has a signed bit depends on whether the column has the `UNSIGNED` attribute. A column without the `UNSIGNED` attribute has 1 signed bit, and a column with the `UNSIGNED` attribute has no signed bit. +- Whether an `AUTO_RANDOM` column has a signed bit depends on whether the column has the `UNSIGNED` attribute. A column without the `UNSIGNED` attribute has one signed bit, while a column with the `UNSIGNED` attribute has no signed bit. - Values implicitly allocated to an `AUTO_RANDOM` column are always positive. For columns with a signed bit, the signed bit of implicitly allocated values is always `0`. This rule does not apply to explicitly inserted values. - The length of the reserved bits is `64-R`. The reserved bits are always `0`. - The auto-increment bits must be at least 27 bits. For signed columns, `R-1-S >= 27` must be satisfied. For unsigned columns, `R-S >= 27` must be satisfied.