From cee71637895deadad147bf28d1be82e2b50cd3bf Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 11 Jun 2020 21:49:24 +0800 Subject: [PATCH 1/3] update auto-random --- auto-random.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-random.md b/auto-random.md index 8b995f810d036..3e6629e965f1f 100644 --- a/auto-random.md +++ b/auto-random.md @@ -122,7 +122,7 @@ TiDB supports parsing the version comment syntax. See the following example: {{< copyable "sql" >}} ```sql -create table t (a bigint primary key /*T!30100 auto_random */) +create table t (a bigint primary key /*T![auto_rand] auto_random */) ``` {{< copyable "sql" >}} @@ -133,7 +133,7 @@ create table t (a bigint 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 a attribute indicator (for example, `/*T![auto_rand] auto_random */`). Here `auto_rand` 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. 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. From e379029d341a88c2e7dab0681868fb0dfee7baf8 Mon Sep 17 00:00:00 2001 From: Ran Date: Thu, 11 Jun 2020 22:52:51 +0800 Subject: [PATCH 2/3] Update auto-random.md --- auto-random.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-random.md b/auto-random.md index 3e6629e965f1f..862bd099ffbef 100644 --- a/auto-random.md +++ b/auto-random.md @@ -133,9 +133,9 @@ create table t (a bigint 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 attribute indicator (for example, `/*T![auto_rand] auto_random */`). Here `auto_rand` 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 a 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 that has not implemented this feature 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. ## Restrictions From ea49d4744a9b86d36e11305a91a70f4c1fec6efd Mon Sep 17 00:00:00 2001 From: Ran Date: Fri, 12 Jun 2020 13:36:58 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Keke Yi <40977455+yikeke@users.noreply.github.com> --- auto-random.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-random.md b/auto-random.md index 862bd099ffbef..862bc32729e5b 100644 --- a/auto-random.md +++ b/auto-random.md @@ -133,9 +133,9 @@ create table t (a bigint 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 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. +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 that has not implemented this feature 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