mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 10:09:08 +02:00
* Merging revisions 42831,42832 from trunk:
------------------------------------------------------------------------ r42831 | michael | 2019-08-26 20:32:59 +0200 (Mon, 26 Aug 2019) | 1 line * Fix bug ID #35887 ------------------------------------------------------------------------ r42832 | michael | 2019-08-26 20:50:03 +0200 (Mon, 26 Aug 2019) | 1 line * Add support for citext field ------------------------------------------------------------------------ git-svn-id: branches/fixes_3_2@42850 -
This commit is contained in:
parent
6ef897798e
commit
590c23c6bb
@ -33,7 +33,7 @@ type
|
||||
// TField and TFieldDef only support a limited amount of fields.
|
||||
// TFieldBinding and TExtendedFieldType can be used to map PQ types
|
||||
// on standard fields and retain mapping info.
|
||||
TExtendedFieldType = (eftNone,eftEnum);
|
||||
TExtendedFieldType = (eftNone,eftEnum,eftCitext);
|
||||
|
||||
TFieldBinding = record
|
||||
FieldDef : TSQLDBFieldDef; // FieldDef this is associated with
|
||||
@ -366,15 +366,16 @@ begin
|
||||
tt:=pqgetvalue(Res,i,2);
|
||||
tc:=pqgetvalue(Res,i,3);
|
||||
J:=length(Bindings)-1;
|
||||
while (J>=0) and (Bindings[j].TypeOID<>toid) do
|
||||
Dec(J);
|
||||
if (J>=0) then
|
||||
while (J>= 0) do
|
||||
begin
|
||||
Bindings[j].TypeName:=TN;
|
||||
Case tt of
|
||||
'e': // Enum
|
||||
if (Bindings[j].TypeOID=toid) then
|
||||
Case tt of
|
||||
'e':
|
||||
Bindings[j].ExtendedFieldType:=eftEnum;
|
||||
end;
|
||||
'citext':
|
||||
Bindings[j].ExtendedFieldType:=eftCitext;
|
||||
end;
|
||||
Dec(J);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
@ -1152,6 +1153,10 @@ begin
|
||||
FD.DataType:=ftString;
|
||||
FD.Size:=64;
|
||||
//FD.Attributes:=FD.Attributes+[faReadonly];
|
||||
end;
|
||||
eftCitext:
|
||||
begin
|
||||
FD.DataType:=ftMemo;
|
||||
end
|
||||
else
|
||||
if ErrorOnUnknownType then
|
||||
|
@ -508,7 +508,6 @@ type
|
||||
procedure SetUpdateMode(AValue : TUpdateMode);
|
||||
procedure OnChangeModifySQL(Sender : TObject);
|
||||
procedure Execute;
|
||||
procedure ApplyFilter;
|
||||
Function AddFilter(SQLstr : string) : string;
|
||||
protected
|
||||
function CreateSQLStatement(aOwner: TComponent): TCustomSQLStatement; virtual;
|
||||
@ -2696,19 +2695,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomSQLQuery.ApplyFilter;
|
||||
|
||||
begin
|
||||
FreeFldBuffers;
|
||||
FStatement.Unprepare;
|
||||
FIsEOF := False;
|
||||
inherited InternalClose;
|
||||
FStatement.DoPrepare;
|
||||
FStatement.DoExecute;
|
||||
inherited InternalOpen;
|
||||
First;
|
||||
end;
|
||||
|
||||
procedure TCustomSQLQuery.SetActive(Value: Boolean);
|
||||
|
||||
begin
|
||||
@ -2727,7 +2713,11 @@ begin
|
||||
if (ServerFiltered <> Value) then
|
||||
begin
|
||||
FServerFiltered := Value;
|
||||
if Active then ApplyFilter;
|
||||
if Active then
|
||||
begin
|
||||
Close;
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2736,7 +2726,11 @@ begin
|
||||
if Value <> ServerFilter then
|
||||
begin
|
||||
FServerFilterText := Value;
|
||||
if Active then ApplyFilter;
|
||||
if Active then
|
||||
begin
|
||||
Close;
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user