Skip to content

Commit

Permalink
*: Update documents and sqlgrams with "alter" prefixed statements (pi…
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored May 22, 2020
1 parent 832cc1f commit 79b9b63
Show file tree
Hide file tree
Showing 33 changed files with 87 additions and 16 deletions.
Binary file added media/sqlgram/AlterDatabaseStmt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/AlterInstanceStmt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/AlterTableSpec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/AlterTableStmt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/AlterUserStmt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/AuthOption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/ColumnDef.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/ColumnPosition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/Constraint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/ConstraintElem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/ConstraintKeywordOpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/DatabaseOption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/IndexInvisible.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/IndexKeyTypeOpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/IndexNameAndTypeOpt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/IndexOption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/IndexOptionList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/IndexPartSpecification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/IndexPartSpecificationList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/IndexTypeName.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/sqlgram/InstanceOption.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/KeyOrIndex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/UserSpec.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/UserSpecList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/sqlgram/Username.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/figma-quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ summary: 本文档介绍如何使用 Figma 绘制图片。

### 第 2 步:打开 tidb-sketch-book 文件

点击 [tidb-sketch-book](https://www.figma.com/file/MOBwqkBtuA03agMjeGEGUT/tidb-sketch-book) 查看该绘图模板文件。
点击 [tidb-sketch-book](https://www.figma.com/file/dHQ9B7X4mF1q78NRIzNTs5/tidb-sketch-book-2020) 查看该绘图模板文件。

> **注意:**
>
Expand Down
7 changes: 2 additions & 5 deletions sql-statements/sql-statement-add-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ aliases: ['/docs-cn/dev/reference/sql/statements/add-column/']

![AlterTableSpec](/media/sqlgram/AlterTableSpec.png)

**ColumnKeywordOpt:**

![ColumnKeywordOpt](/media/sqlgram/ColumnKeywordOpt.png)

**ColumnDef:**

![ColumnDef](/media/sqlgram/ColumnDef.png)
Expand Down Expand Up @@ -120,9 +116,10 @@ SELECT * FROM t1;

## MySQL 兼容性

* 不支持同时添加多列
* 不支持在一条语句中同时添加多列
* 不支持将新添加的列设为 `PRIMARY KEY`
* 不支持将新添加的列设为 `AUTO_INCREMENT`
* 对添加生成列有局限性,具体可参考:[生成列局限性](/generated-columns.md#局限性)

## 另请参阅

Expand Down
53 changes: 45 additions & 8 deletions sql-statements/sql-statement-add-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,53 @@ aliases: ['/docs-cn/dev/reference/sql/statements/add-index/']

![AlterTableSpec](/media/sqlgram/AlterTableSpec.png)

**ColumnKeywordOpt:**
**Constraint:**

![ColumnKeywordOpt](/media/sqlgram/ColumnKeywordOpt.png)
![Constraint](/media/sqlgram/Constraint.png)

**ColumnDef:**
**ConstraintKeywordOpt:**

![ColumnDef](/media/sqlgram/ColumnDef.png)
![ConstraintKeywordOpt](/media/sqlgram/ConstraintKeywordOpt.png)

**ColumnPosition:**
**ConstraintElem:**

![ColumnPosition](/media/sqlgram/ColumnPosition.png)
![ConstraintElem](/media/sqlgram/ConstraintElem.png)

**IndexNameAndTypeOpt:**

![IndexNameAndTypeOpt](/media/sqlgram/IndexNameAndTypeOpt.png)

**IndexPartSpecificationList:**

![IndexPartSpecificationList](/media/sqlgram/IndexPartSpecificationList.png)

**IndexPartSpecification:**

![IndexPartSpecification](/media/sqlgram/IndexPartSpecification.png)

**IndexOptionList:**

![IndexOptionList](/media/sqlgram/IndexOptionList.png)

**IndexOption:**

![IndexOption](/media/sqlgram/IndexOption.png)

**KeyOrIndex:**

![KeyOrIndex](/media/sqlgram/KeyOrIndex.png)

**IndexKeyTypeOpt:**

![IndexKeyTypeOpt](/media/sqlgram/IndexKeyTypeOpt.png)

**IndexInvisible:**

![IndexInvisible](/media/sqlgram/IndexInvisible.png)

**IndexTypeName:**

![IndexTypeName](/media/sqlgram/IndexTypeName.png)

## 示例

Expand Down Expand Up @@ -100,9 +136,10 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = 3;
## MySQL 兼容性

* 不支持 `FULLTEXT``HASH``SPATIAL` 索引。
* 不支持 `VISIBLE/INVISIBLE` 索引。
* 不支持降序索引(类似于 MySQL 5.7)。
* 目前尚不支持同时添加多个索引
* 默认无法向表中添加 `PRIMARY KEY`,在开启 `alter-primary-key` 配置项后可支持此功能,详情参考[alter-primary-key](/tidb-configuration-file.md#alter-primary-key)
* 目前尚不支持在一条中同时添加多个索引
* 默认无法向表中添加 `PRIMARY KEY`,在开启 `alter-primary-key` 配置项后可支持此功能,详情可参考[alter-primary-key](/tidb-configuration-file.md#alter-primary-key)

## 另请参阅

Expand Down
10 changes: 10 additions & 0 deletions sql-statements/sql-statement-alter-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ aliases: ['/docs-cn/dev/reference/sql/statements/alter-database/']

`ALTER DATABASE` 用于修改指定或当前数据库的默认字符集和排序规则。`ALTER SCHEMA``ALTER DATABASE` 操作效果一样。

## 语法图

**AlterDatabaseStmt:**

![AlterDatabaseStmt](/media/sqlgram/AlterDatabaseStmt.png)

**DatabaseOption:**

![DatabaseOption](/media/sqlgram/DatabaseOption.png)

## 示例

{{< copyable "sql" >}}
Expand Down
14 changes: 14 additions & 0 deletions sql-statements/sql-statement-alter-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ aliases: ['/docs-cn/dev/reference/sql/statements/alter-index/']

`ALTER INDEX` 语句用于修改索引的可见性,可以将索引设置为 `Visible` 或者 `Invisible`。设置为 `Invisible` 的索引将无法被优化器使用。

## 语法图

**AlterTableStmt:**

![AlterTableStmt](/media/sqlgram/AlterTableStmt.png)

**AlterTableSpec:**

![AlterTableSpec](/media/sqlgram/AlterTableSpec.png)

**IndexInvisible:**

![IndexInvisible](/media/sqlgram/IndexInvisible.png)

## 语法

{{< copyable "sql" >}}
Expand Down
6 changes: 6 additions & 0 deletions sql-statements/sql-statement-alter-instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ aliases: ['/docs-cn/dev/reference/sql/statements/alter-instance/']

## 语法图

**AlterInstanceStmt:**

![AlterInstanceStmt](/media/sqlgram/AlterInstanceStmt.png)

**InstanceOption:**

![InstanceOption](/media/sqlgram/InstanceOption.png)

## 示例

{{< copyable "sql" >}}
Expand Down
3 changes: 1 addition & 2 deletions sql-statements/sql-statement-alter-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ EXPLAIN SELECT * FROM t1 WHERE c1 = 3;

## MySQL 兼容性

* 支持除空间类型外的所有数据类型。
* 不支持 `FULLTEXT``HASH``SPATIAL` 索引。
* 支持除空间类型外的所有数据类型。其它不支持的情况可参考:[alter-primary-key](/tidb-configuration-file.md#alter-primary-key)

## 另请参阅

Expand Down
8 changes: 8 additions & 0 deletions sql-statements/sql-statement-alter-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ aliases: ['/docs-cn/dev/reference/sql/statements/alter-user/']

![UserSpec](/media/sqlgram/UserSpec.png)

**Username:**

![Username](/media/sqlgram/Username.png)

**AuthOption:**

![AuthOption](/media/sqlgram/AuthOption.png)

## 示例

{{< copyable "sql" >}}
Expand Down

0 comments on commit 79b9b63

Please sign in to comment.