Skip to content

Commit

Permalink
update several sql statements
Browse files Browse the repository at this point in the history
 - sql-statements/sql-statement-set-names.md
 - sql-statements/sql-statement-show-columns-from.md
 - sql-statements/sql-statement-show-create-sequence.md
  • Loading branch information
bb7133 committed May 25, 2020
1 parent 8f64239 commit d5a48bd
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 9 deletions.
Binary file modified media/sqlgram/CharsetKw.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/CharsetName.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/CharsetNameOrDefault.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/DBName.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/FieldsOrColumns.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/SetNamesStmt.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/ShowColumnsFilterable.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/ShowCreateSequenceStmt.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/ShowDatabaseNameOpt.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/ShowLikeOrWhereOpt.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/ShowStmt.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/ShowTableAliasOpt.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/StringName.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/VariableAssignment.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/VariableAssignmentList.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 26 additions & 2 deletions sql-statements/sql-statement-set-names.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,33 @@ aliases: ['/docs-cn/dev/reference/sql/statements/set-names/']

## 语法图

**SetStmt:**
**SetNamesStmt:**

![SetStmt](/media/sqlgram/SetStmt.png)
![SetNamesStmt](/media/sqlgram/SetNamesStmt.png)

**VariableAssignmentList:**

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

**VariableAssignment:**

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

**CharsetName:**

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

**StringName:**

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

**CharsetKw:**

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

**CharsetNameOrDefault:**

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

## 示例

Expand Down
40 changes: 36 additions & 4 deletions sql-statements/sql-statement-show-columns-from.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,42 @@ aliases: ['/docs-cn/dev/reference/sql/statements/show-columns-from/']

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

**ShowTargetFilterable:**
**ShowColumnsFilterable:**

![ShowTargetFilterable](/media/sqlgram/ShowTargetFilterable.png)
![ShowColumnsFilterable](/media/sqlgram/ShowColumnsFilterable.png)

**OptFull:**

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

**FieldsOrColumns:**

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

**ShowTableAliasOpt:**

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

**FromOrIn:**

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

**TableName:**

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

**ShowDatabaseNameOpt:**

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

**DBName:**

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

**ShowLikeOrWhereOpt:**

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

## 示例

{{< copyable "sql" >}}
Expand Down Expand Up @@ -139,7 +167,7 @@ show full columns from mysql.user;
+-----------------------+---------------+-------------+------+------+---------+-------+---------------------------------+---------+
| Host | char(64) | utf8mb4_bin | NO | PRI | NULL | | select,insert,update,references | |
| User | char(32) | utf8mb4_bin | NO | PRI | NULL | | select,insert,update,references | |
| Password | char(41) | utf8mb4_bin | YES | | NULL | | select,insert,update,references | |
| authentication_string | text | utf8mb4_bin | YES | | NULL | | select,insert,update,references | |
| Select_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Insert_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Update_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
Expand All @@ -166,8 +194,12 @@ show full columns from mysql.user;
| Create_role_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Drop_role_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Account_locked | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Shutdown_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Reload_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| FILE_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
| Config_priv | enum('N','Y') | utf8mb4_bin | NO | | N | | select,insert,update,references | |
+-----------------------+---------------+-------------+------+------+---------+-------+---------------------------------+---------+
29 rows in set (0.00 sec)
33 rows in set (0.01 sec)
```

## MySQL 兼容性
Expand Down
6 changes: 3 additions & 3 deletions sql-statements/sql-statement-show-create-sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ aliases: ['/docs-cn/dev/reference/sql/statements/show-create-sequence/']

## 语法图

**ShowStmt:**
**ShowCreateSequenceStmt:**

![ShowStmt](/media/sqlgram/ShowStmt.png)
![ShowCreateSequenceStmt](/media/sqlgram/ShowCreateSequenceStmt.png)

**TableName:**

Expand Down Expand Up @@ -48,7 +48,7 @@ SHOW CREATE SEQUENCE seq;

## MySQL 兼容性

MySQL 暂无序列选项。TiDB 序列借鉴自 MariaDB。`SETVAL` 函数的步调是 TiDB 特有的,其他函数的步调与 MariaDB 保持一致。
MySQL 暂无序列选项。TiDB 序列部分借鉴自 MariaDB。`SETVAL` 函数的步调是 TiDB 特有的,其他函数的步调与 MariaDB 保持一致。

## 另请参阅

Expand Down

0 comments on commit d5a48bd

Please sign in to comment.