* fcl-db: PQConnection needs a lowercase port param

git-svn-id: trunk@47607 -
This commit is contained in:
ondrej 2020-11-27 09:45:03 +00:00
parent 1a0ba60de6
commit 63a231a93d
2 changed files with 17 additions and 4 deletions

View File

@ -104,6 +104,8 @@ type
// Release connection in pool.
procedure ReleaseConnection(Conn: PPGConn; DoClear : Boolean);
function PortParamName: string; override;
procedure DoInternalConnect; override;
procedure DoInternalDisconnect; override;
function GetHandle : pointer; override;
@ -1419,6 +1421,11 @@ begin
end;
end;
function TPQConnection.PortParamName: string;
begin
Result := 'port';
end;
procedure TPQConnection.UpdateIndexDefs(IndexDefs : TIndexDefs;TableName : string);
var qry : TSQLQuery;

View File

@ -222,6 +222,7 @@ type
procedure ApplyRecUpdate(Query : TCustomSQLQuery; UpdateKind : TUpdateKind); virtual;
function RefreshLastInsertID(Query : TCustomSQLQuery; Field : TField): Boolean; virtual;
procedure GetDBInfo(const ASchemaType : TSchemaType; const ASchemaObjectName, AReturnField : string; AList: TStrings);
function PortParamName: string; virtual;
function GetConnectionCharSet: string; virtual;
procedure SetTransaction(Value : TSQLTransaction); virtual;
procedure DoConnect; override;
@ -1519,7 +1520,7 @@ end;
function TSQLConnection.GetPort: cardinal;
begin
result := StrToIntDef(Params.Values['Port'],0);
result := StrToIntDef(Params.Values[PortParamName],0);
end;
procedure TSQLConnection.SetOptions(AValue: TSQLConnectionOptions);
@ -1532,9 +1533,9 @@ end;
procedure TSQLConnection.SetPort(const AValue: cardinal);
begin
if AValue<>0 then
Params.Values['Port']:=IntToStr(AValue)
else with params do if IndexOfName('Port') > -1 then
Delete(IndexOfName('Port'));
Params.Values[PortParamName]:=IntToStr(AValue)
else with params do if IndexOfName(PortParamName) > -1 then
Delete(IndexOfName(PortParamName));
end;
function TSQLConnection.AttemptCommit(trans: TSQLHandle): boolean;
@ -2317,6 +2318,11 @@ begin
end;
end;
function TSQLConnection.PortParamName: string;
begin
Result := 'Port';
end;
procedure TSQLConnection.CreateDB;
begin