44 |
|
|
45 |
|
TFB25ArrayMetaData = class(TFBArrayMetaData,IArrayMetaData) |
46 |
|
private |
47 |
– |
FCharSetID: integer; |
47 |
|
FCodePage: TSystemCodePage; |
48 |
|
protected |
49 |
|
procedure LoadMetaData(aAttachment: IAttachment; aTransaction: ITransaction; |
69 |
|
|
70 |
|
implementation |
71 |
|
|
72 |
< |
uses FB25ClientAPI; |
72 |
> |
uses FBAttachment, FB25ClientAPI; |
73 |
|
|
74 |
|
const |
75 |
|
sGetArrayMetaData = 'Select F.RDB$CHARACTER_SET_ID '+ |
85 |
|
DBHandle: TISC_DB_HANDLE; |
86 |
|
TRHandle: TISC_TR_HANDLE; |
87 |
|
stmt: IStatement; |
88 |
+ |
CharWidth: integer; |
89 |
|
begin |
90 |
|
DBHandle := (aAttachment as TFB25Attachment).Handle; |
91 |
|
TRHandle := (aTransaction as TFB25Transaction).Handle; |
120 |
|
end; |
121 |
|
end; |
122 |
|
end; |
123 |
+ |
if (FArrayDesc.array_desc_dtype in [blr_text,blr_cstring, blr_varying]) and |
124 |
+ |
(FCharSetID = 0) then {This really shouldn't be necessary - but it is :(} |
125 |
+ |
with aAttachment as TFBAttachment do |
126 |
+ |
begin |
127 |
+ |
if HasDefaultCharSet and FirebirdClientAPI.CharSetWidth(CharSetID,CharWidth) then |
128 |
+ |
FArrayDesc.array_desc_length *= CharWidth; |
129 |
+ |
end; |
130 |
|
end; |
131 |
|
|
132 |
|
function TFB25ArrayMetaData.GetCharSetID: cardinal; |