Skip to content

Commit

Permalink
Backport #2368 (#2420)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffery-Wasty authored May 22, 2024
1 parent 8b9afec commit 312092b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6912,6 +6912,15 @@ final boolean readPacket() throws SQLServerException {

// if messageType is RPC or QUERY, then increment Counter's state
if (tdsChannel.getWriter().checkIfTdsMessageTypeIsBatchOrRPC() && null != command) {
if (logger.isLoggable(Level.FINER)) {
logger.warning(toString() + ": increasing state of counter for TDS Command: " + command.toString());
}

if (null == command.getCounter()) {
MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_NullValue"));
Object[] msgArgs1 = {"TDS command counter"};
throw new SQLServerException(form.format(msgArgs1), null);
}
command.getCounter().increaseCounter(packetLength);
}

Expand Down

0 comments on commit 312092b

Please sign in to comment.