ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/FBAttachment.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/FBAttachment.pas (file contents):
Revision 314 by tony, Fri Apr 17 10:26:08 2020 UTC vs.
Revision 315 by tony, Thu Feb 25 11:56:36 2021 UTC

# Line 79 | Line 79 | type
79      procedure EndAllTransactions;
80      procedure DPBFromCreateSQL(CreateSQL: AnsiString);
81      procedure SetParameters(SQLParams: ISQLParams; params: array of const);
82 +    procedure UseServerICUChanged; virtual;
83    public
84      destructor Destroy; override;
85      function getFirebirdAPI: IFirebirdAPI;
# Line 135 | Line 136 | type
136      function OpenArray(transaction: ITransaction; ArrayMetaData: IArrayMetaData; ArrayID: TISC_QUAD): IArray; overload; virtual; abstract;
137      property SQLDialect: integer read FSQLDialect;
138      property DPB: IDPB read FDPB;
139 < public
140 <  function GetDBInformation(Requests: array of byte): IDBInformation; overload;
141 <  function GetDBInformation(Request: byte): IDBInformation; overload;
142 <  function GetDBInformation(Requests: IDIRB): IDBInformation; overload;
143 <  function GetConnectString: AnsiString;
144 <  function GetRemoteProtocol: AnsiString;
145 <  function GetAuthenticationMethod: AnsiString;
146 <  function GetSecurityDatabase: AnsiString;
147 <  function GetODSMajorVersion: integer;
148 <  function GetODSMinorVersion: integer;
149 <  {Character Sets}
150 <  function HasDefaultCharSet: boolean;
151 <  function GetDefaultCharSetID: integer;
152 <  function GetCharsetName(CharSetID: integer): AnsiString;
153 <  function CharSetID2CodePage(CharSetID: integer; var CodePage: TSystemCodePage): boolean;
154 <  function CodePage2CharSetID(CodePage: TSystemCodePage; var CharSetID: integer): boolean;
155 <  function CharSetName2CharSetID(CharSetName: AnsiString; var CharSetID: integer): boolean;
156 <  function CharSetWidth(CharSetID: integer; var Width: integer): boolean;
157 <  procedure RegisterCharSet(CharSetName: AnsiString; CodePage: TSystemCodePage;
158 <    AllowReverseLookup:boolean; out CharSetID: integer);
159 <  function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IBlobMetaData; virtual; abstract;
160 <  function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IArrayMetaData; virtual; abstract;
161 <  property CharSetID: integer read FCharSetID;
162 <  property CodePage: TSystemCodePage read FCodePage;
139 >  public
140 >    function GetDBInformation(Requests: array of byte): IDBInformation; overload;
141 >    function GetDBInformation(Request: byte): IDBInformation; overload;
142 >    function GetDBInformation(Requests: IDIRB): IDBInformation; overload;
143 >    function GetConnectString: AnsiString;
144 >    function GetRemoteProtocol: AnsiString;
145 >    function GetAuthenticationMethod: AnsiString;
146 >    function GetSecurityDatabase: AnsiString;
147 >    function GetODSMajorVersion: integer;
148 >    function GetODSMinorVersion: integer;
149 >    function HasDecFloatSupport: boolean; virtual;
150 >
151 >  public
152 >    {Character Sets}
153 >    function HasDefaultCharSet: boolean;
154 >    function GetDefaultCharSetID: integer;
155 >    function GetCharsetName(CharSetID: integer): AnsiString;
156 >    function CharSetID2CodePage(CharSetID: integer; var CodePage: TSystemCodePage): boolean;
157 >    function CodePage2CharSetID(CodePage: TSystemCodePage; var CharSetID: integer): boolean;
158 >    function CharSetName2CharSetID(CharSetName: AnsiString; var CharSetID: integer): boolean;
159 >    function CharSetWidth(CharSetID: integer; var Width: integer): boolean;
160 >    procedure RegisterCharSet(CharSetName: AnsiString; CodePage: TSystemCodePage;
161 >      AllowReverseLookup:boolean; out CharSetID: integer);
162 >    function GetBlobMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IBlobMetaData; virtual; abstract;
163 >    function GetArrayMetaData(Transaction: ITransaction; tableName, columnName: AnsiString): IArrayMetaData; virtual; abstract;
164 >    property CharSetID: integer read FCharSetID;
165 >    property CodePage: TSystemCodePage read FCodePage;
166 >
167 >  public
168 >    {Time Zone Support}
169 >    function GetTimeZoneServices: ITimeZoneServices; virtual;
170 >    function HasTimeZoneSupport: boolean; virtual;
171 >
172 >  end;
173 >
174 >  { TDPBItem }
175 >
176 >  TDPBItem = class(TParamBlockItem,IDPBItem)
177 >  public
178 >   function getParamTypeName: AnsiString; override;
179 >  end;
180 >
181 >  { TDPB }
182 >
183 >  TDPB = class (TCustomParamBlock<TDPBItem,IDPBItem>, IDPB)
184 >  protected
185 >   function LookupItemType(ParamTypeName: AnsiString): byte; override;
186 >  public
187 >    constructor Create(api: TFBClientAPI);
188 >    function GetDPBParamTypeName(ParamType: byte): Ansistring;
189    end;
190  
191   implementation
# Line 239 | Line 266 | const
266    (CharsetID: 69; CharSetName: 'GB18030'; CharSetWidth: 4; CodePage: 54936; AllowReverseLookup: true)
267   );
268  
269 + const
270 +  isc_dpb_last_dpb_constant = isc_dpb_decfloat_traps;
271 +
272 +  DPBConstantNames: array[1..isc_dpb_last_dpb_constant] of string = (
273 +    'cdd_pathname',
274 +    'allocation',
275 +    'journal',
276 +    'page_size',
277 +    'num_buffers',
278 +    'buffer_length',
279 +    'debug',
280 +    'garbage_collect',
281 +    'verify',
282 +    'sweep',
283 +    'enable_journal',
284 +    'disable_journal',
285 +    'dbkey_scope',
286 +    'number_of_users',
287 +    'trace',
288 +    'no_garbage_collect',
289 +    'damaged',
290 +    'license',
291 +    'sys_user_name',
292 +    'encrypt_key',
293 +    'activate_shadow',
294 +    'sweep_interval',
295 +    'delete_shadow',
296 +    'force_write',
297 +    'begin_log',
298 +    'quit_log',
299 +    'no_reserve',
300 +    'user_name',
301 +    'password',
302 +    'password_enc',
303 +    'sys_user_name_enc',
304 +    'interp',
305 +    'online_dump',
306 +    'old_file_size',
307 +    'old_num_files',
308 +    'old_file',
309 +    'old_start_page',
310 +    'old_start_seqno',
311 +    'old_start_file',
312 +    'drop_walfile',
313 +    'old_dump_id',
314 +    'wal_backup_dir',
315 +    'wal_chkptlen',
316 +    'wal_numbufs',
317 +    'wal_bufsize',
318 +    'wal_grp_cmt_wait',
319 +    'lc_messages',
320 +    'lc_ctype',
321 +    'cache_manager',
322 +    'shutdown',
323 +    'online',
324 +    'shutdown_delay',
325 +    'reserved',
326 +    'overwrite',
327 +    'sec_attach',
328 +    'disable_wal',
329 +    'connect_timeout',
330 +    'dummy_packet_interval',
331 +    'gbak_attach',
332 +    'sql_role_name',
333 +    'set_page_buffers',
334 +    'working_directory',
335 +    'sql_dialect',
336 +    'set_db_readonly',
337 +    'set_db_sql_dialect',
338 +    'gfix_attach',
339 +    'gstat_attach',
340 +    'set_db_charset',
341 +    'gsec_attach',
342 +    'address_path' ,
343 +    'process_id',
344 +    'no_db_triggers',
345 +    'trusted_auth',
346 +    'process_name',
347 +    'trusted_role',
348 +    'org_filename',
349 +    'utf8_ilename',
350 +    'ext_call_depth',
351 +    'auth_block',
352 +    'client_version',
353 +    'remote_protocol',
354 +    'host_name',
355 +    'os_user',
356 +    'specific_auth_data',
357 +    'auth_plugin_list',
358 +    'auth_plugin_name',
359 +    'config',
360 +    'nolinger',
361 +    'reset_icu',
362 +    'map_attach',
363 +    'session_time_zone',
364 +    'set_db_replica',
365 +    'set_bind',
366 +    'decfloat_round',
367 +    'decfloat_traps'
368 +    );
369  
370  
371  
# Line 273 | Line 400 | begin
400    begin
401      Stmt := Prepare(StartTransaction([isc_tpb_read,isc_tpb_nowait,isc_tpb_concurrency],taCommit),
402                      'Select MON$CHARACTER_SET_ID, MON$REMOTE_PROTOCOL, MON$AUTH_METHOD, MON$SEC_DATABASE From MON$ATTACHMENTS, MON$DATABASE '+
403 <                    'Where MON$ATTACHMENT_ID = CURRENT_CONNECTION');
403 >                    'Where MON$ATTACHMENT_ID = CURRENT_CONNECTION ');
404      ResultSet := Stmt.OpenCursor;
405      if ResultSet.FetchNext then
406      begin
# Line 457 | Line 584 | begin
584    end;
585   end;
586  
587 + procedure TFBAttachment.UseServerICUChanged;
588 + begin
589 +  // Do nothing by default
590 + end;
591 +
592   destructor TFBAttachment.Destroy;
593   begin
594    Disconnect(true);
# Line 724 | Line 856 | begin
856    Result := FODSMinorVersion;
857   end;
858  
859 + function TFBAttachment.HasDecFloatSupport: boolean;
860 + begin
861 +  Result := false;
862 + end;
863 +
864   function TFBAttachment.HasDefaultCharSet: boolean;
865   begin
866    Result := FHasDefaultCharSet
# Line 868 | Line 1005 | begin
1005    CharSetID := CharSets[0].AsInteger;
1006   end;
1007  
1008 + function TFBAttachment.GetTimeZoneServices: ITimeZoneServices;
1009 + begin
1010 +  IBError(ibxeNotSupported,[]);
1011 + end;
1012 +
1013 + function TFBAttachment.HasTimeZoneSupport: boolean;
1014 + begin
1015 +  Result := false;
1016 + end;
1017 +
1018 + { TDPBItem }
1019 +
1020 + function TDPBItem.getParamTypeName: AnsiString;
1021 + begin
1022 +  Result := DPBPrefix + DPBConstantNames[getParamType];
1023 + end;
1024 +
1025 + { TDPB }
1026 +
1027 + constructor TDPB.Create(api: TFBClientAPI);
1028 + begin
1029 +  inherited Create(api);
1030 +  FDataLength := 1;
1031 +  FBuffer^ := isc_dpb_version1;
1032 + end;
1033 +
1034 + function TDPB.GetDPBParamTypeName(ParamType: byte): Ansistring;
1035 + begin
1036 +  if ParamType <= isc_dpb_last_dpb_constant then
1037 +    Result := DPBConstantNames[ParamType]
1038 +  else
1039 +    Result := '';
1040 + end;
1041 +
1042 + function TDPB.LookupItemType(ParamTypeName: AnsiString): byte;
1043 + var i: byte;
1044 + begin
1045 +  Result := 0;
1046 +  ParamTypeName := LowerCase(ParamTypeName);
1047 +  if (Pos(DPBPrefix, ParamTypeName) = 1) then
1048 +    Delete(ParamTypeName, 1, Length(DPBPrefix));
1049 +
1050 +  for i := 1 to isc_dpb_last_dpb_constant do
1051 +    if (ParamTypeName = DPBConstantNames[i]) then
1052 +    begin
1053 +      Result := i;
1054 +      break;
1055 +    end;
1056 + end;
1057 +
1058   end.
1059  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines