Permalink
Browse files

Inform user about preference setting for limiting result tabs. Closes #…

  • Loading branch information...
ansgarbecker committed Jan 7, 2018
1 parent d385628 commit 26ec06edcdea0c396856ca45d30b2a8ffec4f721
Showing with 12 additions and 1 deletion.
  1. +3 −0 out/locale/en/LC_MESSAGES/default.po
  2. +9 −1 source/helpers.pas
@@ -6322,3 +6322,6 @@ msgstr "Tab 5"
msgid "Go to tab 5"
msgstr "Go to tab 5"
msgid "Reached maximum number of result tabs (%d). To display more results, increase setting in Preferences > SQL"
msgstr "Reached maximum number of result tabs (%d). To display more results, increase setting in Preferences > SQL"
View
@@ -2842,14 +2842,15 @@ procedure TQueryThread.Execute;
SQL: String;
i, BatchStartOffset, ResultCount: Integer;
PacketSize, MaxAllowedPacket: Int64;
DoStoreResult, ErrorAborted: Boolean;
DoStoreResult, ErrorAborted, LogMaxResultsDone: Boolean;
begin
inherited;
MaxAllowedPacket := 0;
i := 0;
ResultCount := 0;
ErrorAborted := False;
LogMaxResultsDone := False;
while i < FBatch.Count do begin
SQL := '';
@@ -2880,6 +2881,13 @@ procedure TQueryThread.Execute;
try
FConnection.LockedByThread := Self;
DoStoreResult := ResultCount < AppSettings.ReadInt(asMaxQueryResults);
if (not DoStoreResult) and (not LogMaxResultsDone) then begin
// Inform user about preference setting for limiting result tabs
LogFromOutside(
f_('Reached maximum number of result tabs (%d). To display more results, increase setting in Preferences > SQL', [AppSettings.ReadInt(asMaxQueryResults)]),
lcInfo);
LogMaxResultsDone := True;
end;
FConnection.Query(SQL, DoStoreResult, lcUserFiredSQL);
Inc(ResultCount, FConnection.ResultCount);
FBatchPosition := i;

0 comments on commit 26ec06e

Please sign in to comment.