Fix EArgumentOutOfRangeException in TDBConnection.PrefetchResults when SQL batch could not be separated correctly. Should be a rare case, but happened, see http://www.heidisql.com/forum.php?t=21380

This commit is contained in:
Ansgar Becker
2016-05-24 16:14:22 +00:00
parent 4db4931753
commit 9754d5d3b2

View File

@@ -3421,7 +3421,8 @@ begin
LastResults := GetLastResults;
for i:=0 to LastResults.Count-1 do begin
FPrefetchResults.Add(LastResults[i]);
FPrefetchResults[i].SQL := Batch[i].SQL;
if Batch.Count > i then
FPrefetchResults[i].SQL := Batch[i].SQL;
end;
Batch.Free;
end;