Fixed issue where no-op queries would never complete (#157)

* Fixed issue where no-op queries would never complete

* Changed approach to solving the race condition with no-op queries

* Addressing feedback
This commit is contained in:
Mitchell Sternke
2016-11-28 14:28:05 -08:00
committed by GitHub
parent 84eb164d87
commit d1b791805a
4 changed files with 58 additions and 2 deletions

View File

@@ -424,6 +424,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
OwnerUri = executeParams.OwnerUri,
BatchSummaries = q.BatchSummaries
};
await requestContext.SendEvent(QueryExecuteCompleteEvent.Type, eventParams);
};
@@ -470,9 +471,15 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
query.Execute();
// Send back a result showing we were successful
string messages = null;
if (query.Batches.Length == 0)
{
// If there were no batches to execute, send back an informational message that the commands were completed successfully
messages = SR.QueryServiceCompletedSuccessfully;
}
await requestContext.SendResult(new QueryExecuteResult
{
Messages = null
Messages = messages
});
}