84 |
|
FHasFullMetaData: boolean; |
85 |
|
FAttachment: TFB25Attachment; |
86 |
|
FTransaction: TFB25Transaction; |
87 |
+ |
FFirebird25ClientAPI: TFB25ClientAPI; |
88 |
|
protected |
89 |
|
function Attachment: IAttachment; override; |
90 |
|
procedure NeedFullMetadata; override; |
102 |
|
private |
103 |
|
FHandle: TISC_BLOB_HANDLE; |
104 |
|
FEOB: boolean; |
105 |
+ |
FFirebird25ClientAPI: TFB25ClientAPI; |
106 |
|
protected |
107 |
|
procedure CheckReadable; override; |
108 |
|
procedure CheckWritable; override; |
149 |
|
ColName := AnsiUpperCase(GetColumnName); |
150 |
|
if (ColName <> '') and (RelName <> '') then |
151 |
|
begin |
152 |
< |
with Firebird25ClientAPI do |
152 |
> |
with FFirebird25ClientAPI do |
153 |
|
Call(isc_blob_lookup_desc(StatusVector,@(FAttachment.Handle), |
154 |
|
@(FTransaction.Handle), |
155 |
|
PAnsiChar(RelName),PAnsiChar(ColName),@BlobDesc,@Global)); |
176 |
|
inherited Create(Transaction,RelationName,ColumnName); |
177 |
|
FAttachment := Attachment; |
178 |
|
FTransaction := Transaction; |
179 |
+ |
FFirebird25ClientAPI := Attachment.Firebird25ClientAPI; |
180 |
+ |
OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError; |
181 |
|
end; |
182 |
|
|
183 |
|
constructor TFB25BlobMetaData.Create(Attachment: TFB25Attachment; |
213 |
|
if FHandle = nil then |
214 |
|
IBError(ibxeBlobNotOpen,[nil]); |
215 |
|
|
216 |
< |
with Firebird25ClientAPI, Response as TBlobInfo do |
216 |
> |
with FFirebird25ClientAPI, Response as TBlobInfo do |
217 |
|
Call(isc_blob_info(StatusVector, @FHandle, Length(Request),@Request, |
218 |
|
GetBufSize, Buffer)); |
219 |
|
end; |
222 |
|
begin |
223 |
|
if FHandle = nil then |
224 |
|
Exit; |
225 |
< |
with Firebird25ClientAPI do |
225 |
> |
with FFirebird25ClientAPI do |
226 |
|
Call(isc_close_blob(StatusVector, @FHandle), not Force); |
227 |
|
FHandle := nil; |
228 |
|
end; |
231 |
|
begin |
232 |
|
if FHandle = nil then |
233 |
|
Exit; |
234 |
< |
with Firebird25ClientAPI do |
234 |
> |
with FFirebird25ClientAPI do |
235 |
|
Call(isc_cancel_blob(StatusVector,@FHandle),not Force); |
236 |
|
FHandle := nil; |
237 |
|
end; |
244 |
|
inherited Create(Attachment,Transaction,MetaData,BPB); |
245 |
|
DBHandle := Attachment.Handle; |
246 |
|
TRHandle := Transaction.Handle; |
247 |
< |
with Firebird25ClientAPI do |
247 |
> |
FFirebird25ClientAPI := Attachment.Firebird25ClientAPI; |
248 |
> |
OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError; |
249 |
> |
with FFirebird25ClientAPI do |
250 |
|
if BPB = nil then |
251 |
|
Call(isc_create_blob2(StatusVector, @DBHandle, @TRHandle, @FHandle, @FBlobID, |
252 |
|
0, nil)) |
269 |
|
inherited Create(Attachment,Transaction,MetaData,BPB); |
270 |
|
DBHandle := Attachment.Handle; |
271 |
|
TRHandle := Transaction.Handle; |
272 |
< |
with Firebird25ClientAPI do |
272 |
> |
FFirebird25ClientAPI := Attachment.Firebird25ClientAPI; |
273 |
> |
OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError; |
274 |
> |
with FFirebird25ClientAPI do |
275 |
|
if BPB = nil then |
276 |
|
Call(isc_create_blob2(StatusVector, @DBHandle, @TRHandle, @FHandle, @FBlobID, |
277 |
|
0, nil)) |
289 |
|
inherited Create(Attachment,Transaction,MetaData,BlobID,BPB); |
290 |
|
DBHandle := Attachment.Handle; |
291 |
|
TRHandle := Transaction.Handle; |
292 |
+ |
FFirebird25ClientAPI := Attachment.Firebird25ClientAPI; |
293 |
+ |
OnDatabaseError := FFirebird25ClientAPI.IBDataBaseError; |
294 |
|
if (BlobID.gds_quad_high = 0) and (BlobID.gds_quad_low = 0) then |
295 |
|
Exit; |
296 |
|
|
297 |
< |
with Firebird25ClientAPI do |
297 |
> |
with FFirebird25ClientAPI do |
298 |
|
if BPB = nil then |
299 |
|
Call(isc_open_blob2(StatusVector, @DBHandle, @TRHandle, @FHandle, |
300 |
|
@FBlobID, 0, nil)) |
322 |
|
localCount := MaxuShort |
323 |
|
else |
324 |
|
localCount := Count; |
325 |
< |
with Firebird25ClientAPI do |
325 |
> |
with FFirebird25ClientAPI do |
326 |
|
returnCode := isc_get_segment(StatusVector, @FHandle, @BytesRead, localCount, |
327 |
|
LocalBuffer); |
328 |
|
Inc(LocalBuffer,BytesRead); |
333 |
|
FEOB := returnCode = isc_segstr_eof; |
334 |
|
ClearStringCache; |
335 |
|
if (returnCode <> 0) and (returnCode <> isc_segment) and (returnCode <> isc_segstr_eof) then |
336 |
< |
Firebird25ClientAPI.IBDataBaseError |
336 |
> |
FFirebird25ClientAPI.IBDataBaseError |
337 |
|
end; |
338 |
|
|
339 |
|
function TFB25Blob.Write(const Buffer; Count: Longint): Longint; |
351 |
|
localCount := MaxuShort |
352 |
|
else |
353 |
|
localCount := Count; |
354 |
< |
with Firebird25ClientAPI do |
354 |
> |
with FFirebird25ClientAPI do |
355 |
|
Call(isc_put_segment(StatusVector,@FHandle,localCount,LocalBuffer)); |
356 |
|
Dec(Count,localCount); |
357 |
|
Inc(LocalBuffer,localCount); |