title | summary | aliases | ||
---|---|---|---|---|
FLUSH TABLES |
TiDB 数据库中 FLUSH TABLES 的使用概况。 |
|
FLUSH TABLES
语句用于提供 MySQL 兼容性,但在 TiDB 中并无有效用途。
FlushStmt ::=
'FLUSH' NoWriteToBinLogAliasOpt FlushOption
NoWriteToBinLogAliasOpt ::=
( 'NO_WRITE_TO_BINLOG' | 'LOCAL' )?
FlushOption ::=
'PRIVILEGES'
| 'STATUS'
| 'TIDB' 'PLUGINS' PluginNameList
| 'HOSTS'
| LogTypeOpt 'LOGS'
| TableOrTables TableNameListOpt WithReadLockOpt
LogTypeOpt ::=
( 'BINARY' | 'ENGINE' | 'ERROR' | 'GENERAL' | 'SLOW' )?
TableOrTables ::=
'TABLE'
| 'TABLES'
TableNameListOpt ::=
TableNameList?
WithReadLockOpt ::=
( 'WITH' 'READ' 'LOCK' )?
{{< copyable "sql" >}}
FLUSH TABLES;
Query OK, 0 rows affected (0.00 sec)
{{< copyable "sql" >}}
FLUSH TABLES WITH READ LOCK;
ERROR 1105 (HY000): FLUSH TABLES WITH READ LOCK is not supported. Please use @@tidb_snapshot
- TiDB 没有 MySQL 中的表缓存这一概念。所以,
FLUSH TABLES
因 MySQL 兼容性会在 TiDB 中解析出但会被忽略掉。 - 因为 TiDB 目前不支持锁表,所以
FLUSH TABLES WITH READ LOCK
语句会产生错误。建议使用 Historical reads 来实现锁表。