Skip to content

Commit

Permalink
fixed Statement.update returning -1 when schema altering statement
Browse files Browse the repository at this point in the history
  • Loading branch information
chernser committed Jan 30, 2025
1 parent d79d470 commit f1a1476
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public int executeUpdate(String sql, QuerySettings settings) throws SQLException
try (QueryResponse response = queryTimeout == 0 ? connection.client.query(lastSql, mergedSettings).get()
: connection.client.query(lastSql, mergedSettings).get(queryTimeout, TimeUnit.SECONDS)) {
currentResultSet = null;
updateCount = (int) response.getWrittenRows();
updateCount = Math.max(0, (int) response.getWrittenRows()); // when statement alters schema no result rows returned.
metrics = response.getMetrics();
lastQueryId = response.getQueryId();
} catch (Exception e) {
Expand Down

0 comments on commit f1a1476

Please sign in to comment.