Fix new crash in ConnectionInfo (mouse over server version status panel)

This commit is contained in:
Ansgar Becker
2019-06-30 08:59:49 +02:00
parent 92a34000e3
commit a9fd8be2f3

View File

@ -5020,21 +5020,23 @@ var
begin begin
Result := Inherited; Result := Inherited;
Result.Values[f_('Client version (%s)', [FLib.DllFile])] := DecodeApiString(FLib.mysql_get_client_info); Result.Values[f_('Client version (%s)', [FLib.DllFile])] := DecodeApiString(FLib.mysql_get_client_info);
Infos := DecodeApiString(FLib.mysql_stat(FHandle)); if FActive then begin
rx := TRegExpr.Create; Infos := DecodeApiString(FLib.mysql_stat(FHandle));
rx.ModifierG := False; rx := TRegExpr.Create;
rx.Expression := '(\S.*)\:\s+(\S*)(\s+|$)'; rx.ModifierG := False;
if rx.Exec(Infos) then while True do begin rx.Expression := '(\S.*)\:\s+(\S*)(\s+|$)';
Val := rx.Match[2]; if rx.Exec(Infos) then while True do begin
if LowerCase(rx.Match[1]) = 'uptime' then Val := rx.Match[2];
Val := FormatTimeNumber(StrToFloatDef(Val, 0), True) if LowerCase(rx.Match[1]) = 'uptime' then
else Val := FormatTimeNumber(StrToFloatDef(Val, 0), True)
Val := FormatNumber(Val); else
Result.Values[_(rx.Match[1])] := Val; Val := FormatNumber(Val);
if not rx.ExecNext then Result.Values[_(rx.Match[1])] := Val;
break; if not rx.ExecNext then
break;
end;
rx.Free;
end; end;
rx.Free;
end; end;
@ -5044,14 +5046,16 @@ var
rx: TRegExpr; rx: TRegExpr;
begin begin
Result := Inherited; Result := Inherited;
// clear out password if FActive then begin
ConnectionString := FAdoHandle.ConnectionString; // clear out password
rx := TRegExpr.Create; ConnectionString := FAdoHandle.ConnectionString;
rx.ModifierI := True; rx := TRegExpr.Create;
rx.Expression := '(\Wpassword=)([^;]*)'; rx.ModifierI := True;
ConnectionString := rx.Replace(ConnectionString, '${1}******', True); rx.Expression := '(\Wpassword=)([^;]*)';
rx.Free; ConnectionString := rx.Replace(ConnectionString, '${1}******', True);
Result.Values[_('Connection string')] := ConnectionString; rx.Free;
Result.Values[_('Connection string')] := ConnectionString;
end;
end; end;