Skip to content

Commit

Permalink
Closes #2299 - remove lock from the query when unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzheboka committed Jun 20, 2023
1 parent 3ee9024 commit 32de846
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public static String queryTaskSummaries() {
+ "<if test='selectAndClaim == true'> "
+ "FETCH FIRST ROW ONLY FOR UPDATE"
+ "</if>"
+ "<if test=\"_databaseId == 'db2'\">WITH RS USE AND KEEP UPDATE LOCKS </if>"
+ "<if test=\"_databaseId == 'db2' and selectAndClaim \">WITH RS USE "
+ "AND KEEP UPDATE LOCKS </if>"
+ "<if test=\"_databaseId == 'db2' and !selectAndClaim \">WITH UR </if>"
+ CLOSING_SCRIPT_TAG;
}

Expand Down Expand Up @@ -429,9 +431,7 @@ private static String groupBySorIfActive() {
}

private static String openOuterClauseForGroupByPorOrSor() {
return "<if test=\"groupByPor or groupBySor != null\"> "
+ "SELECT * FROM ("
+ "</if> ";
return "<if test=\"groupByPor or groupBySor != null\"> " + "SELECT * FROM (" + "</if> ";
}

private static String closeOuterClauseForGroupByPor() {
Expand Down

0 comments on commit 32de846

Please sign in to comment.