Skip to content

Commit

Permalink
fix ctc doc (#5914) (#5953)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Jul 8, 2021
1 parent 48fc0a2 commit 98989b5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
10 changes: 8 additions & 2 deletions sql-statements/sql-statement-alter-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,15 @@ Query OK, 0 rows affected, 1 warning (0.25 sec)

The following major restrictions apply to `ALTER TABLE` in TiDB:

* Multiple operations cannot be completed in a single `ALTER TABLE` statement.
* Making multiple changes in a single `ALTER TABLE` statement is currently not supported.

* Lossy changes such as changing from `BIGINT` to `INT` are currently not supported.
* Changes of the [Reorg-Data](/sql-statements/sql-statement-modify-column.md#reorg-data-change) types on primary key columns are not supported.

* Changes of column types on partitioned tables are not supported.

* Changes of column types on generated columns are not supported.

* Changes of some data types (for example, some TIME, Bit, Set, Enum, and JSON types) are not supported due to the compatibility issues of the `CAST` function's behavior between TiDB and MySQL.

* Spatial data types are not supported.

Expand Down
8 changes: 4 additions & 4 deletions sql-statements/sql-statement-change-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ ERROR 8200 (HY000): Unsupported modify column: change from original type decimal

## MySQL compatibility

* Making multiple changes in a single `ALTER TABLE` statement is not currently supported.
* Changes of data types on primary key columns are not supported.
* Making multiple changes in a single `ALTER TABLE` statement is currently not supported.
* Changes of [Reorg-Data](/sql-statements/sql-statement-modify-column.md#reorg-data-change) types on primary key columns are not supported.
* Changes of column types on partitioned tables are not supported.
* Changes of column types on the generated columns are not supported.
* Changes of some data types (for example, some TIME types, Bit, Set, Enum, JSON) are not supported due to some compatibility issues of the `cast` function's behavior between TiDB and MySQL.
* Changes of column types on generated columns are not supported.
* Changes of some data types (for example, some TIME, Bit, Set, Enum, and JSON types) are not supported due to the compatibility issues of the `CAST` function's behavior between TiDB and MySQL.

## See also

Expand Down
10 changes: 8 additions & 2 deletions sql-statements/sql-statement-modify-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,21 @@ CREATE TABLE `t1` (
ERROR 1105 (HY000): Unsupported multi schema change
```
* Does not support modifying the data types on the primary key columns. For example:
* Does not support modifying the Reorg-Data types on the primary key columns but supports modifying the Meta-Only types. For example:
```sql
CREATE TABLE t (a int primary key);
ALTER TABLE t MODIFY COLUMN a VARCHAR(10);
ERROR 8200 (HY000): Unsupported modify column: column has primary key flag
```
* Does not support modifying the types of generate columns. For example:
```sql
CREATE TABLE t (a int primary key);
ALTER TABLE t MODIFY COLUMN a bigint;
Query OK, 0 rows affected (0.01 sec)
```
* Does not support modifying the column types on generated columns. For example:
```sql
CREATE TABLE t (a INT, b INT as (a+1));
Expand Down

0 comments on commit 98989b5

Please sign in to comment.