Add support for OF in row lock clauses

This adds support for statements such as `SELECT ... FOR UPDATE OF table NOWAIT` where `OF table`
could not be specified previously. Fixes #285.
This commit is contained in:
Matthew Dowdell 2023-11-30 07:52:54 +00:00
parent 6a13530ec1
commit f16f0b5e5d
4 changed files with 48 additions and 1 deletions

View file

@ -132,5 +132,11 @@ FOR KEY SHARE NOWAIT;
SELECT table1.col_bool AS "table1.col_bool"
FROM db.table1
FOR NO KEY UPDATE SKIP LOCKED;
`)
assertStatementSql(t, SELECT(table1ColBool).FROM(table1).FOR(UPDATE().OF(table1, table2).NOWAIT()), `
SELECT table1.col_bool AS "table1.col_bool"
FROM db.table1
FOR UPDATE OF table1, table2 NOWAIT;
`)
}