From bdf1bf42e6bbbf04aae6199e956c46f661015903 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Thu, 12 Nov 2009 20:37:56 +0000 Subject: [PATCH] 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 --- source/main.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/main.pas b/source/main.pas index 5387f310..2090f031 100644 --- a/source/main.pas +++ b/source/main.pas @@ -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;