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

Method addBlob

src/remote/client/interface.cpp:2880–2928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2878
2879
2880void Batch::addBlob(CheckStatusWrapper* status, unsigned length, const void* inBuffer, ISC_QUAD* blobId,
2881 unsigned parLength, const unsigned char* par)
2882{
2883 try
2884 {
2885 // Check and validate handles, etc.
2886 if (!stmt)
2887 {
2888 Arg::Gds(isc_bad_req_handle).raise();
2889 }
2890
2891 Rsr* statement = stmt->getStatement();
2892 CHECK_HANDLE(statement, isc_bad_req_handle);
2893 Rdb* rdb = statement->rsr_rdb;
2894 CHECK_HANDLE(rdb, isc_bad_db_handle);
2895 rem_port* port = rdb->rdb_port;
2896 RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION);
2897
2898 // Policy check
2899 switch (blobPolicy)
2900 {
2901 case IBatch::BLOB_ID_ENGINE:
2902 genBlobId(blobId);
2903 break;
2904 case IBatch::BLOB_ID_USER:
2905 break;
2906 default:
2907 (Arg::Gds(isc_batch_policy) << "addBlob").raise();
2908 }
2909
2910 // Build blob HDR in stream
2911 newBlob();
2912 putBlobData(sizeof *blobId, blobId);
2913 setSizePointer();
2914 putBlobData(sizeof parLength, &parLength);
2915 putBlobData(sizeof parLength, &parLength);
2916 putBlobData(parLength, par);
2917 segmented = parLength ? fb_utils::isBpbSegmented(parLength, par) : defSegmented;
2918
2919 // Store blob data
2920 putSegment(length, inBuffer);
2921
2922 batchActive = true;
2923 }
2924 catch (const Exception& ex)
2925 {
2926 ex.stuffException(status);
2927 }
2928}
2929
2930
2931void Batch::appendBlobData(CheckStatusWrapper* status, unsigned length, const void* inBuffer)

Callers

nothing calls this directly

Calls 7

GdsClass · 0.85
CHECK_HANDLEFunction · 0.85
isBpbSegmentedFunction · 0.85
putSegmentFunction · 0.85
raiseMethod · 0.45
getStatementMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected