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

Method setupInlineBlob

src/remote/remote.cpp:980–1019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

978};
979
980void Rtr::setupInlineBlob(P_INLINE_BLOB* p_blob)
981{
982 fb_assert(p_blob->p_tran_id == this->rtr_id);
983 fb_assert(rtr_inline_blob);
984
985 Rbl* blb = rtr_inline_blob;
986 rtr_inline_blob = nullptr;
987
988 fb_assert(blb->rbl_data.getCount() <= MAX_INLINE_BLOB_SIZE);
989 fb_assert(blb->rbl_data.getCount() <= MAX_USHORT);
990
991 blb->rbl_buffer_length = MIN(MAX_USHORT, blb->rbl_data.getCapacity());
992 const ULONG cachedSize = blb->getCachedSize();
993 if (!rtr_rdb->incBlobCache(cachedSize))
994 {
995 delete blb;
996 return;
997 }
998
999 blb->rbl_blob_id = p_blob->p_blob_id;
1000 if (Rbl* old = rtr_blobs.locate(blb->rbl_blob_id))
1001 {
1002 // Blob with the same blob id already exists. It could be in use, or it
1003 // could be opened by user explicitly with custom BPB - thus delete new one.
1004
1005 fb_assert(blb != old);
1006 delete blb;
1007
1008 rtr_rdb->decBlobCache(cachedSize);
1009 return;
1010 }
1011 else
1012 rtr_blobs.add(blb);
1013
1014 blb->rbl_info.parseInfo(p_blob->p_blob_info.cstr_length, p_blob->p_blob_info.cstr_address);
1015
1016 blb->rbl_length = blb->rbl_data.getCount();
1017 blb->rbl_ptr = blb->rbl_buffer = blb->rbl_data.begin();
1018 blb->rbl_flags |= Rbl::EOF_PENDING;
1019}
1020
1021void Rsr::saveException(const Exception& ex, bool overwrite)
1022{

Callers 2

executeMethod · 0.80
batch_dsql_fetchFunction · 0.80

Calls 9

getCachedSizeMethod · 0.80
incBlobCacheMethod · 0.80
decBlobCacheMethod · 0.80
parseInfoMethod · 0.80
getCountMethod · 0.45
getCapacityMethod · 0.45
locateMethod · 0.45
addMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected