Skip to content

Commit

Permalink
Fix EArgumentOutOfRangeException in TDBConnection.PrefetchResults whe…
Browse files Browse the repository at this point in the history
…n SQL batch could not be separated correctly. Should be a rare case, but happened, see http://www.heidisql.com/forum.php?t=21380
  • Loading branch information
ansgarbecker committed May 24, 2016
1 parent 4db4931 commit 9754d5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/dbconnection.pas
Expand Up @@ -3421,7 +3421,8 @@ procedure TDBConnection.PrefetchResults(SQL: String);
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;
Expand Down

0 comments on commit 9754d5d

Please sign in to comment.