mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Add rowcount check so that no results error is sent for a query where no rows are returned (#525)
This commit is contained in:
committed by
Karl Burtram
parent
3d7b87eca2
commit
3392f93a2e
@@ -229,13 +229,15 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
||||
try
|
||||
{
|
||||
// check to make sure any results were recieved
|
||||
if (query.Batches.Length == 0 || query.Batches[0].ResultSets.Count == 0)
|
||||
if (query.Batches.Length == 0
|
||||
|| query.Batches[0].ResultSets.Count == 0
|
||||
|| query.Batches[0].ResultSets[0].RowCount == 0)
|
||||
{
|
||||
await requestContext.SendError(SR.QueryServiceResultSetHasNoResults);
|
||||
return;
|
||||
}
|
||||
|
||||
var rowCount = query.Batches[0].ResultSets[0].RowCount;
|
||||
long rowCount = query.Batches[0].ResultSets[0].RowCount;
|
||||
// check to make sure there is a safe amount of rows to load into memory
|
||||
if (rowCount > Int32.MaxValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user