From 0e4b2607e0682091443092afb53368bf19c5d926 Mon Sep 17 00:00:00 2001 From: Ran Date: Fri, 12 Jun 2020 13:39:27 +0800 Subject: [PATCH 1/2] cherry pick #2811 to release-3.1 Signed-off-by: sre-bot --- auto-random.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/auto-random.md b/auto-random.md index 3e37d5f00a7ef..6eb234dfecd96 100644 --- a/auto-random.md +++ b/auto-random.md @@ -118,7 +118,11 @@ TiDB supports parsing the version comment syntax. See the following example: {{< copyable "sql" >}} ```sql +<<<<<<< HEAD create table t (a int primary key /*T!30100 auto_random */) +======= +create table t (a bigint primary key /*T![auto_rand] auto_random */) +>>>>>>> 48e7da5... update auto-random.md (#2811) ``` {{< copyable "sql" >}} @@ -129,9 +133,9 @@ create table t (a int primary key auto_random) The above two statements have the same meaning. -In the result of `show create table`, the `AUTO_RANDOM` attribute is commented out. This comment includes a version number (for example, `/*T!30100 auto_random */`). Here `30100` indicates that the `AUTO_RANDOM` attribute is introduced in v3.1.0. TiDB of a lower version ignores the `AUTO_RANDOM` attribute in the above comment. +In the result of `show create table`, the `AUTO_RANDOM` attribute is commented out. This comment includes an attribute identifier (for example, `/*T![auto_rand] auto_random */`). Here `auto_rand` represents the `AUTO_RANDOM` attribute. Only the version of TiDB that implements the feature corresponding to this identifier can parse the SQL statement fragment properly. -This attribute supports forward compatibility, namely, downgrade compatibility. TiDB earlier than v3.1.0 ignores the `AUTO_RANDOM` attribute of a table (with the above comment), so TiDB of earlier versions can also use the table with the attribute. +This attribute supports forward compatibility, namely, downgrade compatibility. TiDB of earlier versions that do not implement this feature ignore the `AUTO_RANDOM` attribute of a table (with the above comment) and can also use the table with the attribute. ## Restrictions From da61fa8bbdba03eb269b294040574ecd8182ad09 Mon Sep 17 00:00:00 2001 From: Ran Date: Fri, 12 Jun 2020 13:52:23 +0800 Subject: [PATCH 2/2] change bigint to int --- auto-random.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/auto-random.md b/auto-random.md index 6eb234dfecd96..b8faad209277e 100644 --- a/auto-random.md +++ b/auto-random.md @@ -118,11 +118,7 @@ TiDB supports parsing the version comment syntax. See the following example: {{< copyable "sql" >}} ```sql -<<<<<<< HEAD -create table t (a int primary key /*T!30100 auto_random */) -======= -create table t (a bigint primary key /*T![auto_rand] auto_random */) ->>>>>>> 48e7da5... update auto-random.md (#2811) +create table t (a int primary key /*T![auto_rand] auto_random */) ``` {{< copyable "sql" >}}