Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 30 additions & 11 deletions sql-statements/sql-statement-show-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ This statement shows a list of variables for the scope of either `GLOBAL` or `SE

## Synopsis

**ShowStmt:**

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

**ShowTargetFilterable:**

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

**GlobalScope:**

![GlobalScope](/media/sqlgram/GlobalScope.png)
```ebnf+diagram
ShowVariablesStmt ::=
"SHOW" ("GLOBAL" | "SESSION")? VARIABLES ShowLikeOrWhere?

ShowLikeOrWhere ::=
"LIKE" SimpleExpr
| "WHERE" Expression
```

## Examples

Expand Down Expand Up @@ -145,6 +142,28 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'time_zone%';
| time_zone | SYSTEM |
+---------------+--------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES WHERE Variable_name="tidb_window_concurrency";
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| tidb_window_concurrency | -1 |
+-------------------------+-------+
1 row in set (0.00 sec)

mysql> SHOW VARIABLES WHERE Value=300;
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| ddl_slow_threshold | 300 |
| delayed_insert_timeout | 300 |
| innodb_purge_batch_size | 300 |
| key_cache_age_threshold | 300 |
| slave_checkpoint_period | 300 |
| tidb_slow_log_threshold | 300 |
| tidb_wait_split_region_timeout | 300 |
+--------------------------------+-------+
7 rows in set (0.00 sec)
```

## MySQL compatibility
Expand Down