ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/client/3.0/FB30Array.pas
(Generate patch)

Comparing ibx/trunk/fbintf/client/3.0/FB30Array.pas (file contents):
Revision 46 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 47 by tony, Mon Jan 9 15:31:51 2017 UTC

# Line 69 | Line 69 | type
69  
70    TFB30ArrayMetaData = class(TFBArrayMetaData,IArrayMetaData)
71    private
72    FCharSetID: integer;
72      FCodePage: TSystemCodePage;
73    protected
74      procedure LoadMetaData(aAttachment: IAttachment; aTransaction: ITransaction;
# Line 106 | Line 105 | type
105  
106   implementation
107  
108 < uses FB30ClientAPI, FB30Statement;
108 > uses FBAttachment, FB30ClientAPI, FB30Statement;
109  
110   const
111    sGetArrayMetaData = 'Select F.RDB$FIELD_LENGTH, F.RDB$FIELD_SCALE, F.RDB$FIELD_TYPE, '+
# Line 125 | Line 124 | const
124   procedure TFB30ArrayMetaData.LoadMetaData(aAttachment: IAttachment;
125    aTransaction: ITransaction; relationName, columnName: string);
126   var stmt: IStatement;
127 +    CharWidth: integer;
128   begin
129    RelationName := AnsiUpperCase(RelationName);
130    ColumnName := AnsiUpperCase(ColumnName);
# Line 138 | Line 138 | begin
138      if FetchNext then
139      begin
140        FillChar(FArrayDesc.array_desc_field_name,sizeof(FArrayDesc.array_desc_field_name),' ');
141 <      FillChar(FArrayDesc.array_desc_relation_name,sizeof(FArrayDesc.array_desc_field_name),' ');
141 >      FillChar(FArrayDesc.array_desc_relation_name,sizeof(FArrayDesc.array_desc_relation_name),' ');
142        Move(columnName[1],FArrayDesc.array_desc_field_name,Length(columnName));
143        Move(relationName[1],FArrayDesc.array_desc_relation_name,length(relationName));
144        FArrayDesc.array_desc_length := Data[0].AsInteger;
# Line 151 | Line 151 | begin
151          FCharSetID := (aAttachment as TFB30Attachment).CharSetID;
152        FCodePage := CP_NONE;
153        FirebirdClientAPI.CharSetID2CodePage(FCharSetID,FCodePage);
154 +      if (FArrayDesc.array_desc_dtype in [blr_text,blr_cstring, blr_varying]) and
155 +        (FCharSetID = 0) then {This really shouldn't be necessary - but it is :(}
156 +      with aAttachment as TFBAttachment do
157 +      begin
158 +        if HasDefaultCharSet  and FirebirdClientAPI.CharSetWidth(CharSetID,CharWidth) then
159 +          FArrayDesc.array_desc_length *= CharWidth;
160 +      end;
161        repeat
162          with FArrayDesc.array_desc_bounds[Data[4].AsInteger] do
163          begin
# Line 209 | Line 216 | begin
216          SDLItem.addShortInteger(array_desc_length);
217      end;
218  
219 <    FSDL.Add(isc_sdl_relation).SetAsString(GetTableName);
220 <    FSDL.Add(isc_sdl_field).SetAsString(GetColumnName);
219 >    FSDL.Add(isc_sdl_relation).SetAsString(array_desc_relation_name);
220 >    FSDL.Add(isc_sdl_field).SetAsString(array_desc_field_name);
221  
222      for i := 0 to array_desc_dimensions - 1 do
223      begin

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines