Skip to content

Commit

Permalink
Fix #3234 - Return -1 as update count for stored procedure calls (#3235)
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Apr 30, 2024
1 parent 8afde80 commit 5c0dbf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ void set(long oid, long rows) {
public void parse(String status) throws PSQLException {
// Assumption: command neither starts nor ends with a digit
if (!Parser.isDigitAt(status, status.length() - 1)) {
set(0, 0);
// For CALL statements, JDBC requires an update count of -1
set(0, "CALL".equals(status) ? -1 : 0);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static Iterable<Object[]> data() {
(Long.MAX_VALUE / 100), (Long.MAX_VALUE / 100)},
{"CREATE TABLE", 0, 0},
{"CREATE OR DROP OR DELETE TABLE 42", 0, 42},
{"CALL", 0, -1},
});
}

Expand Down

0 comments on commit 5c0dbf0

Please sign in to comment.