Remove dependency from "Questions" status variable. Seems some servers return wrong values in it which lets the command statistics display wrong percentages. Fixes issue #1463

This commit is contained in:
Ansgar Becker
2009-11-12 20:37:56 +00:00
parent d15d8b48f6
commit bdf1bf42e6

View File

@@ -7930,11 +7930,14 @@ begin
Screen.Cursor := crHourglass;
try
Results := Connection.GetResults('SHOW /*!50002 GLOBAL */ STATUS LIKE ''Com\_%''' );
questions := MakeInt(Connection.GetVar('SHOW /*!50002 GLOBAL */ STATUS LIKE ''Questions''', 1));
if questions = 0 then
Raise Exception.Create('Could not detect value of "Questions" status. Command statistics are not available.');
questions := 0;
while not Results.Eof do begin
Inc(questions, MakeInt(Results.Col(1)));
Results.Next;
end;
SetLength(VTRowDataListCommandStats, Results.RecordCount+1);
addLVitem(0, ' All commands', questions, questions );
Results.First;
for i:=1 to Results.RecordCount do begin
addLVitem(i, Results.Col(0), MakeInt(Results.Col(1)), questions );
Results.Next;