FLUSH TABLES

This statement is included for compatibility with MySQL. It has no effective usage in TiDB.

Synopsis

FlushStmt

FLUSH TABLES - 图1

NoWriteToBinLogAliasOpt

FLUSH TABLES - 图2

FlushOption

FLUSH TABLES - 图3

LogTypeOpt

FLUSH TABLES - 图4

TableOrTables

FLUSH TABLES - 图5

TableNameListOpt

FLUSH TABLES - 图6

WithReadLockOpt

FLUSH TABLES - 图7

  1. FlushStmt ::=
  2. 'FLUSH' NoWriteToBinLogAliasOpt FlushOption
  3. NoWriteToBinLogAliasOpt ::=
  4. ( 'NO_WRITE_TO_BINLOG' | 'LOCAL' )?
  5. FlushOption ::=
  6. 'PRIVILEGES'
  7. | 'STATUS'
  8. | 'TIDB' 'PLUGINS' PluginNameList
  9. | 'HOSTS'
  10. | LogTypeOpt 'LOGS'
  11. | TableOrTables TableNameListOpt WithReadLockOpt
  12. LogTypeOpt ::=
  13. ( 'BINARY' | 'ENGINE' | 'ERROR' | 'GENERAL' | 'SLOW' )?
  14. TableOrTables ::=
  15. 'TABLE'
  16. | 'TABLES'
  17. TableNameListOpt ::=
  18. TableNameList?
  19. WithReadLockOpt ::=
  20. ( 'WITH' 'READ' 'LOCK' )?

Examples

  1. mysql> FLUSH TABLES;
  2. Query OK, 0 rows affected (0.00 sec)
  3. mysql> FLUSH TABLES WITH READ LOCK;
  4. ERROR 1105 (HY000): FLUSH TABLES WITH READ LOCK is not supported. Please use @@tidb_snapshot

MySQL compatibility

  • TiDB does not have a concept of table cache as in MySQL. Thus, FLUSH TABLES is parsed but ignored in TiDB for compatibility.
  • The statement FLUSH TABLES WITH READ LOCK produces an error, as TiDB does not currently support locking tables. It is recommended to use Historical reads for this purpose instead.

See also