Skip to content

Commit

Permalink
Only return actual execution plan when requested
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Jan 11, 2023
1 parent 054ce1b commit 49e30bb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ public ExecuteRequestResult HandleExecuteDocumentSelection(ExecuteDocumentSelect

if (!request.ExecutionPlanOptions.IncludeEstimatedExecutionPlanXml)
{
if (request.ExecutionPlanOptions.IncludeActualExecutionPlanXml)
{
cmd.StatementCompleted += (_, stmt) =>
{
var resultSet = new ResultSetSummary
Expand Down Expand Up @@ -201,6 +203,7 @@ public ExecuteRequestResult HandleExecuteDocumentSelection(ExecuteDocumentSelect
ResultSetSummary = resultSet,
}).ConfigureAwait(false).GetAwaiter().GetResult();
};
}

using (var reader = await cmd.ExecuteReaderAsync())
{
Expand Down

0 comments on commit 49e30bb

Please sign in to comment.