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

Comparing ibx/trunk/runtime/IBCustomDataSet.pas (file contents):
Revision 65 by tony, Mon Mar 27 15:21:02 2017 UTC vs.
Revision 66 by tony, Wed Aug 23 08:23:42 2017 UTC

# Line 181 | Line 181 | type
181      FCharacterSetSize: integer;
182      FAutoFieldSize: boolean;
183      FCodePage: TSystemCodePage;
184 +    FDataSize: integer;
185    protected
186      procedure Bind(Binding: Boolean); override;
187      function GetDataSize: Integer; override;
# Line 790 | Line 791 | type
791      FCharacterSetSize: integer;
792      FCodePage: TSystemCodePage;
793      FRelationName: string;
794 +    FDataSize: integer;
795    published
796      property CharacterSetName: RawByteString read FCharacterSetName write FCharacterSetName;
797      property CharacterSetSize: integer read FCharacterSetSize write FCharacterSetSize;
798      property CodePage: TSystemCodePage read FCodePage write FCodePage;
799 +    property DataSize: integer read FDataSize write FDataSize;
800      property RelationName: string read FRelationName write FRelationName;
801      property ArrayDimensions: integer read FArrayDimensions write FArrayDimensions;
802      property ArrayBounds: TArrayBounds read FArrayBounds write FArrayBounds;
# Line 1141 | Line 1144 | begin
1144      IBFieldDef := FieldDef as TIBFieldDef;
1145      CharacterSetSize := IBFieldDef.CharacterSetSize;
1146      CharacterSetName := IBFieldDef.CharacterSetName;
1147 +    FDataSize := IBFieldDef.DataSize + 1;
1148      if AutoFieldSize then
1149        Size := IBFieldDef.Size;
1150      CodePage := IBFieldDef.CodePage;
# Line 1149 | Line 1153 | end;
1153  
1154   function TIBStringField.GetDataSize: Integer;
1155   begin
1156 <  Result := Size * CharacterSetSize + 1;
1156 >  Result := FDataSize;
1157   end;
1158  
1159   constructor TIBStringField.Create(aOwner: TComponent);
# Line 3671 | Line 3675 | const
3675   var
3676    FieldType: TFieldType;
3677    FieldSize: Word;
3678 +  FieldDataSize: integer;
3679    charSetID: short;
3680    CharSetSize: integer;
3681    CharSetName: RawByteString;
# Line 3807 | Line 3812 | begin
3812          FieldName := getSQLName;
3813          FAliasNameList[i] := DBAliasName;
3814          FieldSize := 0;
3815 +        FieldDataSize := 0;
3816          FieldPrecision := 0;
3817          FieldNullable := IsNullable;
3818          CharSetSize := 0;
# Line 3823 | Line 3829 | begin
3829                CharSetSize := 1;
3830              CharSetName := Database.Attachment.GetCharsetName(getCharSetID);
3831              Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage);
3832 <            FieldSize := GetSize div CharSetSize;
3832 >            FieldDataSize := GetSize;
3833 >            FieldSize := FieldDataSize div CharSetSize;
3834              FieldType := ftString;
3835            end;
3836            { All Doubles/Floats should be cast to doubles }
# Line 3837 | Line 3844 | begin
3844                FieldType := ftBCD;
3845                FieldPrecision := 4;
3846                FieldSize := -getScale;
3847 +              FieldDataSize := FieldSize;
3848              end;
3849            end;
3850            SQL_LONG:
# Line 3861 | Line 3869 | begin
3869                FieldPrecision := 9;
3870                FieldSize := -getScale;
3871              end;
3872 +            FieldDataSize := FieldSize;
3873            end;
3874  
3875            SQL_INT64:
# Line 3874 | Line 3883 | begin
3883                FieldSize := -getScale;
3884              end
3885              else
3886 <              FieldType := ftFloat
3886 >              FieldType := ftFloat;
3887 >            FieldDataSize := FieldSize;
3888            end;
3889            SQL_TIMESTAMP: FieldType := ftDateTime;
3890            SQL_TYPE_TIME: FieldType := ftTime;
# Line 3892 | Line 3902 | begin
3902              end
3903              else
3904                FieldType := ftBlob;
3905 +            FieldDataSize := FieldSize;
3906            end;
3907            SQL_ARRAY:
3908            begin
3909              FieldSize := sizeof (TISC_QUAD);
3910 +            FieldDataSize := FieldSize;
3911              FieldType := ftArray;
3912              ArrayMetaData := GetArrayMetaData;
3913              if ArrayMetaData <> nil then
# Line 3919 | Line 3931 | begin
3931              Name := FieldAliasName;
3932              FAliasNameMap[FieldNo-1] := DBAliasName;
3933              Size := FieldSize;
3934 +            DataSize := FieldDataSize;
3935              Precision := FieldPrecision;
3936              Required := not FieldNullable;
3937              RelationName := aRelationName;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines