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; |
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; |
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; |
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); |
3675 |
|
var |
3676 |
|
FieldType: TFieldType; |
3677 |
|
FieldSize: Word; |
3678 |
+ |
FieldDataSize: integer; |
3679 |
|
charSetID: short; |
3680 |
|
CharSetSize: integer; |
3681 |
|
CharSetName: RawByteString; |
3812 |
|
FieldName := getSQLName; |
3813 |
|
FAliasNameList[i] := DBAliasName; |
3814 |
|
FieldSize := 0; |
3815 |
+ |
FieldDataSize := 0; |
3816 |
|
FieldPrecision := 0; |
3817 |
|
FieldNullable := IsNullable; |
3818 |
|
CharSetSize := 0; |
3825 |
|
their values } |
3826 |
|
SQL_VARYING, SQL_TEXT: |
3827 |
|
begin |
3828 |
< |
FirebirdAPI.CharSetWidth(getCharSetID,CharSetSize); |
3829 |
< |
CharSetName := FirebirdAPI.GetCharsetName(getCharSetID); |
3830 |
< |
FirebirdAPI.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3831 |
< |
FieldSize := GetSize div CharSetSize; |
3828 |
> |
if not Database.Attachment.CharSetWidth(getCharSetID,CharSetSize) then |
3829 |
> |
CharSetSize := 1; |
3830 |
> |
CharSetName := Database.Attachment.GetCharsetName(getCharSetID); |
3831 |
> |
Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3832 |
> |
FieldDataSize := GetSize; |
3833 |
> |
FieldSize := FieldDataSize div CharSetSize; |
3834 |
|
FieldType := ftString; |
3835 |
|
end; |
3836 |
|
{ All Doubles/Floats should be cast to doubles } |
3844 |
|
FieldType := ftBCD; |
3845 |
|
FieldPrecision := 4; |
3846 |
|
FieldSize := -getScale; |
3847 |
+ |
FieldDataSize := FieldSize; |
3848 |
|
end; |
3849 |
|
end; |
3850 |
|
SQL_LONG: |
3869 |
|
FieldPrecision := 9; |
3870 |
|
FieldSize := -getScale; |
3871 |
|
end; |
3872 |
+ |
FieldDataSize := FieldSize; |
3873 |
|
end; |
3874 |
|
|
3875 |
|
SQL_INT64: |
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; |
3894 |
|
FieldSize := sizeof (TISC_QUAD); |
3895 |
|
if (getSubtype = 1) then |
3896 |
|
begin |
3897 |
< |
FirebirdAPI.CharSetWidth(getCharSetID,CharSetSize); |
3898 |
< |
CharSetName := FirebirdAPI.GetCharsetName(getCharSetID); |
3899 |
< |
FirebirdAPI.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3897 |
> |
if not Database.Attachment.CharSetWidth(getCharSetID,CharSetSize) then |
3898 |
> |
CharSetSize := 1; |
3899 |
> |
CharSetName := Database.Attachment.GetCharsetName(getCharSetID); |
3900 |
> |
Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3901 |
|
FieldType := ftMemo; |
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 |
3931 |
|
Name := FieldAliasName; |
3932 |
|
FAliasNameMap[FieldNo-1] := DBAliasName; |
3933 |
|
Size := FieldSize; |
3934 |
+ |
DataSize := FieldDataSize; |
3935 |
|
Precision := FieldPrecision; |
3936 |
|
Required := not FieldNullable; |
3937 |
|
RelationName := aRelationName; |