mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 01:56:36 +08:00
mysql_get_server_info() returns "5.5.5-10.0.10-MariaDB". Override that with the "version" server variable, which is more exact here.
This commit is contained in:
@ -825,6 +825,7 @@ begin
|
||||
rx.Expression := '(-pw\s+")[^"]*(")';
|
||||
PlinkCmdDisplay := FConnection.Parameters.SSHPlinkExe + ' ' + rx.Replace(PlinkParameters, '${1}******${2}', True);
|
||||
FConnection.Log(lcInfo, f_('Attempt to create plink.exe process, waiting %ds for response ...', [FConnection.Parameters.SSHTimeout]));
|
||||
FConnection.Log(lcInfo, PlinkCmdDisplay);
|
||||
|
||||
// Prepare process
|
||||
FillChar(StartupInfo, SizeOf(StartupInfo), 0);
|
||||
@ -1617,16 +1618,20 @@ begin
|
||||
Status.Next;
|
||||
end;
|
||||
FServerVersionUntouched := DecodeAPIString(mysql_get_server_info(FHandle));
|
||||
log(lcinfo, FServerVersionUntouched);
|
||||
Vars := GetSessionVariables(False);
|
||||
while not Vars.Eof do begin
|
||||
if Vars.Col(0) = 'version_compile_os' then
|
||||
FServerOS := Vars.Col(1);
|
||||
if Vars.Col(0) = 'hostname' then
|
||||
FRealHostname := Vars.Col(1);
|
||||
if (Vars.Col(0) = 'version') and (Vars.Col(1) <> '') then
|
||||
FServerVersionUntouched := Vars.Col(1);
|
||||
if (Vars.Col(0) = 'version_comment') and (Vars.Col(1) <> '') then
|
||||
FServerVersionUntouched := FServerVersionUntouched + ' - ' + Vars.Col(1);
|
||||
Vars.Next;
|
||||
end;
|
||||
log(lcinfo, FServerVersionUntouched);
|
||||
if FDatabase <> '' then begin
|
||||
tmpdb := FDatabase;
|
||||
FDatabase := '';
|
||||
@ -2098,7 +2103,7 @@ begin
|
||||
Log(lcDebug, 'Ping server ...');
|
||||
if (FHandle=nil) or (PQping(FHandle) <> PQPING_OK) then begin
|
||||
// Be sure to release some stuff before reconnecting
|
||||
//log(lcinfo, 'TPGConnection.Ping reconnect: handle:'+inttostr(integer(FHandle=nil))+' '+inttostr(integer(PQping(FHandle))));
|
||||
log(lcinfo, 'TPGConnection.Ping reconnect: handle:'+inttostr(integer(FHandle=nil))+' '+inttostr(integer(PQping(FHandle))));
|
||||
//Active := False;
|
||||
//if Reconnect then
|
||||
// Active := True;
|
||||
@ -2906,9 +2911,8 @@ end;
|
||||
|
||||
function TPGConnection.GetAllDatabases: TStringList;
|
||||
begin
|
||||
Result := inherited;
|
||||
if not Assigned(Result) then begin
|
||||
try
|
||||
// Do not inherit, as in PG we cannot use the
|
||||
if not Assigned(FAllDatabases) then try
|
||||
// Query is.schemata when using schemata, for databases use pg_database
|
||||
//FAllDatabases := GetCol('SELECT datname FROM pg_database WHERE datistemplate=FALSE');
|
||||
FAllDatabases := GetCol('SELECT '+QuoteIdent('schema_name')+
|
||||
@ -2918,7 +2922,6 @@ begin
|
||||
FAllDatabases := TStringList.Create;
|
||||
end;
|
||||
Result := FAllDatabases;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
@ -3937,7 +3940,7 @@ begin
|
||||
obj.Name := Results.Col('table_name');
|
||||
obj.Created := 0;
|
||||
obj.Updated := 0;
|
||||
obj.Database := db;
|
||||
//obj.Database := db;
|
||||
obj.Schema := Results.Col('table_schema'); // Remove when using schemata
|
||||
obj.Comment := Results.Col('comment');
|
||||
obj.Rows := StrToIntDef(Results.Col('reltuples'), obj.Rows);
|
||||
|
Reference in New Issue
Block a user