mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Fix version detection on PostgreSQL, when there is no third segment in the version string. Closes #137.
This commit is contained in:
@@ -3319,12 +3319,12 @@ end;
|
||||
function TDBConnection.ServerVersionInt: Integer;
|
||||
var
|
||||
rx: TRegExpr;
|
||||
v1, v2: String;
|
||||
v1, v2, v3: String;
|
||||
begin
|
||||
Result := 0;
|
||||
rx := TRegExpr.Create;
|
||||
case FParameters.NetTypeGroup of
|
||||
ngMySQL, ngPgSQL: begin
|
||||
ngMySQL: begin
|
||||
rx.Expression := '(\d+)\.(\d+)\.(\d+)';
|
||||
if rx.Exec(FServerVersionUntouched) then begin
|
||||
Result := StrToIntDef(rx.Match[1], 0) *10000 +
|
||||
@@ -3352,6 +3352,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ngPgSQL: begin
|
||||
rx.Expression := '(\d+)\.(\d+)(\.(\d+))?';
|
||||
if rx.Exec(FServerVersionUntouched) then begin
|
||||
Result := StrToIntDef(rx.Match[1], 0) *10000 +
|
||||
StrToIntDef(rx.Match[2], 0) *100 +
|
||||
StrToIntDef(rx.Match[3], 0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
rx.Free;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user