LockTables locks table with read lock
(ctx context.Context, db *sql.Conn, database, table string)
| 732 | |
| 733 | // LockTables locks table with read lock |
| 734 | func LockTables(ctx context.Context, db *sql.Conn, database, table string) error { |
| 735 | lockTableQuery := fmt.Sprintf("LOCK TABLES `%s`.`%s` READ", escapeString(database), escapeString(table)) |
| 736 | _, err := db.ExecContext(ctx, lockTableQuery) |
| 737 | return errors.Annotatef(err, "sql: %s", lockTableQuery) |
| 738 | } |
| 739 | |
| 740 | // UnlockTables unlocks all tables' lock |
| 741 | func UnlockTables(ctx context.Context, db *sql.Conn) error { |
nothing calls this directly
no test coverage detected