Skip to content

Commit

Permalink
ebnf show variables (#17000)
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden authored Apr 10, 2024
1 parent a2a2fc9 commit c272615
Showing 1 changed file with 30 additions and 11 deletions.
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 @@ -10,17 +10,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 @@ -146,6 +143,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

0 comments on commit c272615

Please sign in to comment.