MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / addBlob

Method addBlob

src/dsql/DsqlBatch.cpp:344–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342}
343
344void DsqlBatch::addBlob(thread_db* tdbb, ULONG length, const void* inBuffer, ISC_QUAD* blobId,
345 unsigned parLength, const unsigned char* par)
346{
347 blobCheckMode(false, "addBlob");
348 blobPrepare();
349
350 // Get ready to appendBlobData()
351 m_lastBlob = m_blobs.getSize();
352 fb_assert(m_lastBlob % BLOB_STREAM_ALIGN == 0);
353
354 // Generate auto blob ID if needed
355 if (m_blobPolicy == IBatch::BLOB_ID_ENGINE)
356 genBlobId(blobId);
357
358 // Determine type of current blob
359 setFlag(FLAG_CURRENT_SEGMENTED, parLength ? fb_utils::isBpbSegmented(parLength, par) : m_flags & (1 << FLAG_DEFAULT_SEGMENTED));
360
361 // Store header
362 m_blobs.put(blobId, sizeof(ISC_QUAD));
363 ULONG fullLength = length + parLength;
364 m_blobs.put(&fullLength, sizeof(ULONG));
365 m_blobs.put(&parLength, sizeof(ULONG));
366 DEB_BATCH(fprintf(stderr, "addBlob %08x.%08x par %u full %u ",
367 blobId->gds_quad_high, blobId->gds_quad_low, parLength, fullLength));
368
369 // Store BPB
370 if (parLength)
371 m_blobs.put(par, parLength);
372
373 // Finally store user data
374 putSegment(length, inBuffer);
375}
376
377void DsqlBatch::appendBlobData(thread_db* tdbb, ULONG length, const void* inBuffer)
378{

Callers

nothing calls this directly

Calls 4

isBpbSegmentedFunction · 0.85
putSegmentFunction · 0.85
getSizeMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected