MySQL lock and unlock tables statement.
This commit is contained in:
parent
ee4897a1e2
commit
a3ae52c43c
5 changed files with 128 additions and 18 deletions
21
mysql/lock_statement_test.go
Normal file
21
mysql/lock_statement_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package mysql
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestLockRead(t *testing.T) {
|
||||
assertStatement(t, table2.LOCK().READ(), `
|
||||
LOCK TABLES db.table2 READ;
|
||||
`)
|
||||
}
|
||||
|
||||
func TestLockWrite(t *testing.T) {
|
||||
assertStatement(t, table2.LOCK().WRITE(), `
|
||||
LOCK TABLES db.table2 WRITE;
|
||||
`)
|
||||
}
|
||||
|
||||
func TestUNLOCK_TABLES(t *testing.T) {
|
||||
assertStatement(t, UNLOCK_TABLES(), `
|
||||
UNLOCK TABLES;
|
||||
`)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue