2019-08-11 16:55:18 +02:00
|
|
|
package mysql
|
|
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
|
|
func TestLockRead(t *testing.T) {
|
2019-08-12 12:11:16 +02:00
|
|
|
assertStatementSql(t, table2.LOCK().READ(), `
|
2019-08-11 16:55:18 +02:00
|
|
|
LOCK TABLES db.table2 READ;
|
|
|
|
|
`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestLockWrite(t *testing.T) {
|
2019-08-12 12:11:16 +02:00
|
|
|
assertStatementSql(t, table2.LOCK().WRITE(), `
|
2019-08-11 16:55:18 +02:00
|
|
|
LOCK TABLES db.table2 WRITE;
|
|
|
|
|
`)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestUNLOCK_TABLES(t *testing.T) {
|
2019-08-12 12:11:16 +02:00
|
|
|
assertStatementSql(t, UNLOCK_TABLES(), `
|
2019-08-11 16:55:18 +02:00
|
|
|
UNLOCK TABLES;
|
|
|
|
|
`)
|
|
|
|
|
}
|