mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 10:02:10 +08:00
When total command count is very low, percentage values in command stats tab were miscalculated. Fixes issue #2015.
This commit is contained in:
@ -7909,8 +7909,8 @@ procedure TMainForm.ListCommandStatsBeforePaint(Sender: TBaseVirtualTree; Target
|
|||||||
tmpval := commandCount / Connection.ServerUptime;
|
tmpval := commandCount / Connection.ServerUptime;
|
||||||
VTRowDataListCommandStats[idx].Captions.Add( FormatNumber( tmpval, 1 ) );
|
VTRowDataListCommandStats[idx].Captions.Add( FormatNumber( tmpval, 1 ) );
|
||||||
// Percentage. Take care of division by zero errors and Int64's
|
// Percentage. Take care of division by zero errors and Int64's
|
||||||
if commandCount < 1 then
|
if commandCount < 0 then
|
||||||
commandCount := 1;
|
commandCount := 0;
|
||||||
if totalCount < 1 then
|
if totalCount < 1 then
|
||||||
totalCount := 1;
|
totalCount := 1;
|
||||||
tmpval := 100 / totalCount * commandCount;
|
tmpval := 100 / totalCount * commandCount;
|
||||||
|
Reference in New Issue
Block a user