lava-oushudb-dt-sql-parser/test/parser/mysql/syntax/fixtures/lockTable.sql
琉易 428d851913
feat: #190 improve mysql grammer (#196)
* refactor: generic rename to mysql

* refactor: g4 with mysql syntax

* test: mysql syntax

* refactor: remove useless keywords

* refactor: remove nonReserved keywords

* refactor: lint specificFunction

---------

Co-authored-by: liuyi <liuyi@dtstack.com>
2023-11-27 15:25:40 +08:00

26 lines
518 B
SQL

-- https://dev.mysql.com/doc/refman/8.0/en/lock-instance-for-backup.html
/* LOCK TABLES
tbl_name [[AS] alias] lock_type
[, tbl_name [[AS] alias] lock_type] ...
lock_type: {
READ [LOCAL]
| [LOW_PRIORITY] WRITE
}
UNLOCK TABLES */
LOCK TABLES t1 READ;
LOCK TABLE t WRITE, t AS t1 READ;
LOCK TABLE t READ;
LOCK TABLE t READ LOCAL;
LOCK TABLE t AS my_alias READ;
LOCK TABLES t1 WRITE, t2 READ;
LOCK TABLES trans READ, customer LOW_PRIORITY WRITE;
LOCK TABLES trans READ, customer WRITE;
UNLOCK TABLES;