41 |
|
Classes, SysUtils, {$IFDEF WINDOWS} windows, {$ENDIF} IB, FBParamBlock, |
42 |
|
FBActivityMonitor, FBClientAPI; |
43 |
|
|
44 |
+ |
const |
45 |
+ |
DefaultMaxInlineBlobLimit = 8192; |
46 |
+ |
|
47 |
|
type |
48 |
|
TCharsetMap = record |
49 |
|
CharsetID: integer; |
63 |
|
FODSMinorVersion: integer; |
64 |
|
FUserCharSetMap: array of TCharSetMap; |
65 |
|
FSecDatabase: AnsiString; |
66 |
+ |
FInlineBlobLimit: integer; |
67 |
|
protected |
68 |
|
FDatabaseName: AnsiString; |
69 |
|
FRaiseExceptionOnConnectError: boolean; |
151 |
|
function GetODSMajorVersion: integer; |
152 |
|
function GetODSMinorVersion: integer; |
153 |
|
function HasDecFloatSupport: boolean; virtual; |
154 |
+ |
function GetInlineBlobLimit: integer; |
155 |
+ |
procedure SetInlineBlobLimit(limit: integer); |
156 |
+ |
function HasBatchMode: boolean; virtual; |
157 |
|
|
158 |
|
public |
159 |
|
{Character Sets} |
192 |
|
function LookupItemType(ParamTypeName: AnsiString): byte; override; |
193 |
|
public |
194 |
|
constructor Create(api: TFBClientAPI); |
195 |
+ |
function GetParamTypeName(ParamType: byte): Ansistring; |
196 |
+ |
{$IFDEF FPC} |
197 |
+ |
function IDPB.GetDPBParamTypeName = GetParamTypeName; |
198 |
+ |
{$ELSE} |
199 |
|
function GetDPBParamTypeName(ParamType: byte): Ansistring; |
200 |
+ |
{$ENDIF} |
201 |
|
end; |
202 |
|
|
203 |
|
implementation |
463 |
|
FRaiseExceptionOnConnectError := RaiseExceptionOnConnectError; |
464 |
|
FODSMajorVersion := 0; |
465 |
|
FODSMinorVersion := 0; |
466 |
+ |
FInlineBlobLimit := DefaultMaxInlineBlobLimit; |
467 |
|
end; |
468 |
|
|
469 |
|
function TFBAttachment.GenerateCreateDatabaseSQL(DatabaseName: AnsiString; aDPB: IDPB): AnsiString; |
874 |
|
Result := false; |
875 |
|
end; |
876 |
|
|
877 |
+ |
function TFBAttachment.GetInlineBlobLimit: integer; |
878 |
+ |
begin |
879 |
+ |
Result := FInlineBlobLimit; |
880 |
+ |
end; |
881 |
+ |
|
882 |
+ |
procedure TFBAttachment.SetInlineBlobLimit(limit: integer); |
883 |
+ |
begin |
884 |
+ |
if limit > 32*1024 then |
885 |
+ |
FInlineBlobLimit := 32*1024 |
886 |
+ |
else |
887 |
+ |
FInlineBlobLimit := limit; |
888 |
+ |
end; |
889 |
+ |
|
890 |
+ |
function TFBAttachment.HasBatchMode: boolean; |
891 |
+ |
begin |
892 |
+ |
Result := false; |
893 |
+ |
end; |
894 |
+ |
|
895 |
|
function TFBAttachment.HasDefaultCharSet: boolean; |
896 |
|
begin |
897 |
|
Result := FHasDefaultCharSet |
1062 |
|
FBuffer^ := isc_dpb_version1; |
1063 |
|
end; |
1064 |
|
|
1065 |
< |
function TDPB.GetDPBParamTypeName(ParamType: byte): Ansistring; |
1065 |
> |
function TDPB.GetParamTypeName(ParamType: byte): Ansistring; |
1066 |
|
begin |
1067 |
|
if ParamType <= isc_dpb_last_dpb_constant then |
1068 |
|
Result := DPBConstantNames[ParamType] |
1070 |
|
Result := ''; |
1071 |
|
end; |
1072 |
|
|
1073 |
+ |
{$IFNDEF FPC} |
1074 |
+ |
function TDPB.GetDPBParamTypeName(ParamType: byte): Ansistring; |
1075 |
+ |
begin |
1076 |
+ |
Result := GetParamTypeName(ParamType); |
1077 |
+ |
end; |
1078 |
+ |
{$ENDIF} |
1079 |
+ |
|
1080 |
|
function TDPB.LookupItemType(ParamTypeName: AnsiString): byte; |
1081 |
|
var i: byte; |
1082 |
|
begin |