mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Fix displaying "20.14" server version on SQL Server 2014. Try to get more exact version with SELECT SERVERPROPERTY('ProductVersion') on 2008 and newer servers. See http://msdn.microsoft.com/de-de/library/ms174396.aspx .
This commit is contained in:
@ -1743,6 +1743,13 @@ begin
|
||||
rx.Expression := '^([^\r\n]+)';
|
||||
if rx.Exec(FServerVersionUntouched) then
|
||||
FServerVersionUntouched := rx.Match[1];
|
||||
try
|
||||
// Try to get more exact server version to avoid displaying "20.14" in some cases
|
||||
FServerVersionUntouched := GetVar('SELECT SERVERPROPERTY('+EscapeString('ProductVersion')+')');
|
||||
except
|
||||
// Above query only works on SQL Server 2008 and newer
|
||||
// Keep value from SELECT @@VERSION on older servers
|
||||
end;
|
||||
rx.Free;
|
||||
FRealHostname := Parameters.Hostname;
|
||||
|
||||
@ -2866,6 +2873,12 @@ begin
|
||||
v2 := rx.Match[2];
|
||||
Result := StrToIntDef(v1, 0) *100 +
|
||||
StrToIntDef(v2, 0);
|
||||
end else begin
|
||||
rx.Expression := '(\d+)[,\.](\d+)[,\.](\d+)[,\.](\d+)';
|
||||
if rx.Exec(FServerVersionUntouched) then begin
|
||||
Result := StrToIntDef(rx.Match[1], 0) *100 +
|
||||
StrToIntDef(rx.Match[2], 0);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user