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

This commit is contained in:
Ansgar Becker
2018-01-07 12:05:19 +01:00
parent d3856282d1
commit 26ec06edcd
2 changed files with 12 additions and 1 deletions

View File

@@ -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 File

@@ -2842,7 +2842,7 @@ var
SQL: String;
i, BatchStartOffset, ResultCount: Integer;
PacketSize, MaxAllowedPacket: Int64;
DoStoreResult, ErrorAborted: Boolean;
DoStoreResult, ErrorAborted, LogMaxResultsDone: Boolean;
begin
inherited;
@@ -2850,6 +2850,7 @@ begin
i := 0;
ResultCount := 0;
ErrorAborted := False;
LogMaxResultsDone := False;
while i < FBatch.Count do begin
SQL := '';
@@ -2880,6 +2881,13 @@ begin
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;