Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2910,7 +2910,12 @@ final void doExecutePreparedStatementBatch(PrepStmtBatchExecCmd batchCommand) th
if (!getNextResult(true))
return;

if (isSpPrepareExecuted) {
// If sp_prepare was executed, but a handle doesn't exist that means
// the TDS response for sp_prepare has not been processed yet. Rather, it means
// that another result was processed from a sp_execute query instead. Therefore, we
// skip the if-block below and continue until the handle is set from the processed
// sp_prepare TDS response.
if (isSpPrepareExecuted && hasPreparedStatementHandle()) {
isSpPrepareExecuted = false;
resetForReexecute();
tdsWriter = batchCommand.startRequest(TDS.PKT_RPC);
Expand Down