Skip to content

Commit

Permalink
Update tests for DB2 forUpdate()
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed Jul 16, 2024
1 parent bbd5636 commit 0a95ac7
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public void testForUpdate() {

if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock)");
} else if (isDb2()) {
assertThat(sqlOf(query)).contains("with rs use and keep update locks");
} else {
assertThat(sqlOf(query)).contains("for update");
}
Expand Down Expand Up @@ -105,6 +107,8 @@ public void testForUpdate_withLimit() {

if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock)");
} else if (isDb2()) {
assertThat(sqlOf(query)).contains("with rs use and keep update locks");
} else if (!isOracle()) {
// Oracle does not support FOR UPDATE with FETCH
assertThat(sqlOf(query)).contains("for update");
Expand Down Expand Up @@ -138,6 +142,8 @@ public void testForUpdate_when_alreadyInPCAsReference() {
assertThat(sql.get(0)).contains("from o_order");
if (isSqlServer()) {
assertThat(sql.get(1)).contains("from o_customer t0 with (updlock) where t0.id = ?");
} else if (isDb2()) {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? with rs use and keep update locks");
} else {
assertThat(sql.get(1)).contains("from o_customer t0 where t0.id = ? for update");
}
Expand Down

0 comments on commit 0a95ac7

Please sign in to comment.