File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/com/microsoft/sqlserver/jdbc Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2910,7 +2910,12 @@ final void doExecutePreparedStatementBatch(PrepStmtBatchExecCmd batchCommand) th
29102910 if (!getNextResult (true ))
29112911 return ;
29122912
2913- if (isSpPrepareExecuted ) {
2913+ // If sp_prepare was executed, but a handle doesn't exist that means
2914+ // the TDS response for sp_prepare has not been processed yet. Rather, it means
2915+ // that another result was processed from a sp_execute query instead. Therefore, we
2916+ // skip the if-block below and continue until the handle is set from the processed
2917+ // sp_prepare TDS response.
2918+ if (isSpPrepareExecuted && hasPreparedStatementHandle ()) {
29142919 isSpPrepareExecuted = false ;
29152920 resetForReexecute ();
29162921 tdsWriter = batchCommand .startRequest (TDS .PKT_RPC );
You can’t perform that action at this time.
0 commit comments