mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 23:42:34 +02:00
* Allow using of connection charset if none is specified at DB level (bug ID 35755)
git-svn-id: trunk@42279 -
This commit is contained in:
parent
73b365cd30
commit
16b827aa88
@ -61,6 +61,7 @@ type
|
|||||||
FDatabaseInfo : TDatabaseInfo;
|
FDatabaseInfo : TDatabaseInfo;
|
||||||
FDialect : integer;
|
FDialect : integer;
|
||||||
FBlobSegmentSize : word; //required for backward compatibilty; not used
|
FBlobSegmentSize : word; //required for backward compatibilty; not used
|
||||||
|
FUseConnectionCharSetIfNone: Boolean;
|
||||||
|
|
||||||
procedure ConnectFB;
|
procedure ConnectFB;
|
||||||
|
|
||||||
@ -132,6 +133,7 @@ type
|
|||||||
property Params;
|
property Params;
|
||||||
property OnLogin;
|
property OnLogin;
|
||||||
Property Port stored false;
|
Property Port stored false;
|
||||||
|
Property UseConnectionCharSetIfNone : Boolean Read FUseConnectionCharSetIfNone Write FUseConnectionCharSetIfNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TIBConnectionDef }
|
{ TIBConnectionDef }
|
||||||
@ -988,7 +990,8 @@ begin
|
|||||||
TransType, TransLen, TransPrec);
|
TransType, TransLen, TransPrec);
|
||||||
|
|
||||||
// [var]char or blob column character set NONE or OCTETS overrides connection charset
|
// [var]char or blob column character set NONE or OCTETS overrides connection charset
|
||||||
if ((TransType in [ftString, ftFixedChar]) and (PSQLVar^.sqlsubtype and $FF in [CS_NONE,CS_BINARY])) or
|
if (((TransType in [ftString, ftFixedChar]) and (PSQLVar^.sqlsubtype and $FF in [CS_NONE,CS_BINARY])) and not UseConnectionCharSetIfNone)
|
||||||
|
or
|
||||||
((TransType = ftMemo) and (PSQLVar^.relname_length>0) and (PSQLVar^.sqlname_length>0) and (GetBlobCharset(@PSQLVar^.relname,@PSQLVar^.sqlname) in [CS_NONE,CS_BINARY])) then
|
((TransType = ftMemo) and (PSQLVar^.relname_length>0) and (PSQLVar^.sqlname_length>0) and (GetBlobCharset(@PSQLVar^.relname,@PSQLVar^.sqlname) in [CS_NONE,CS_BINARY])) then
|
||||||
FieldDefs.Add(PSQLVar^.AliasName, TransType, TransLen, TransPrec, (PSQLVar^.sqltype and 1)=0, False, i+1, CP_NONE)
|
FieldDefs.Add(PSQLVar^.AliasName, TransType, TransLen, TransPrec, (PSQLVar^.sqltype and 1)=0, False, i+1, CP_NONE)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user