Do not offer "show all warnings" button if SHOW WARNINGS LIMIT 5 returns less than 5 warnings.

This commit is contained in:
Ansgar Becker
2012-04-06 08:38:50 +00:00
parent 8295a66808
commit 1230b9c6a1

View File

@ -2435,14 +2435,16 @@ begin
MsgTitle := 'Your query produced '+FormatNumber(Thread.WarningCount)+' warnings.';
MsgText := '';
Warnings := Thread.Connection.GetResults('SHOW WARNINGS LIMIT 5');
if Warnings.RecordCount < Thread.WarningCount then
if Warnings.RecordCount < 5 then
MsgText := MsgText + 'Warnings from last query:'+CRLF
else if Warnings.RecordCount < Thread.WarningCount then
MsgText := MsgText + 'First '+FormatNumber(Warnings.RecordCount)+' warnings:'+CRLF;
while not Warnings.Eof do begin
MsgText := MsgText + Warnings.Col('Level') + ': ' + Warnings.Col('Message') + CRLF;
Warnings.Next;
end;
MsgText := Trim(MsgText);
if Warnings.RecordCount = Thread.WarningCount then
if (Warnings.RecordCount = Thread.WarningCount) or (Warnings.RecordCount < 5) then
MessageDialog(MsgTitle, MsgText, mtWarning, [mbOk])
else begin
MsgText := MsgText + CRLF+CRLF + 'Show all warnings in a new query tab?';