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

Method openBlob

src/jrd/jrd.cpp:3677–3728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3675
3676
3677JBlob* JAttachment::openBlob(CheckStatusWrapper* user_status, ITransaction* tra, ISC_QUAD* blob_id,
3678 unsigned int bpb_length, const unsigned char* bpb)
3679{
3680/**************************************
3681 *
3682 * g d s _ $ o p e n _ b l o b 2
3683 *
3684 **************************************
3685 *
3686 * Functional description
3687 * Open an existing blob.
3688 *
3689 **************************************/
3690 blb* blob = NULL;
3691
3692 try
3693 {
3694 JTransaction* const jt = getTransactionInterface(user_status, tra);
3695 EngineContextHolder tdbb(user_status, this, FB_FUNCTION);
3696
3697 jrd_tra* transaction = jt->getHandle();
3698 validateHandle(tdbb, transaction);
3699 check_database(tdbb);
3700
3701 try
3702 {
3703 const bid* id = reinterpret_cast<bid*>(blob_id);
3704
3705 if (blob_id->gds_quad_high)
3706 transaction->checkBlob(tdbb, id, NULL, true);
3707
3708 blob = blb::open2(tdbb, transaction, id, bpb_length, bpb, true);
3709 }
3710 catch (const Exception& ex)
3711 {
3712 transliterateException(tdbb, ex, user_status, "JAttachment::openBlob");
3713 return NULL;
3714 }
3715 }
3716 catch (const Exception& ex)
3717 {
3718 ex.stuffException(user_status);
3719 return NULL;
3720 }
3721
3722 successful_completion(user_status);
3723
3724 JBlob* jb = FB_NEW JBlob(blob, getStable());
3725 jb->addRef();
3726 blob->blb_interface = jb;
3727 return jb;
3728}
3729
3730
3731void JTransaction::prepare(CheckStatusWrapper* user_status, unsigned int msg_length, const unsigned char* msg)

Callers 7

listFieldMethod · 0.45
getListMethod · 0.45
openMethod · 0.45
openMethod · 0.45
dumpDataMethod · 0.45
mainFunction · 0.45
printMethod · 0.45

Calls 9

validateHandleFunction · 0.85
check_databaseFunction · 0.85
transliterateExceptionFunction · 0.85
successful_completionFunction · 0.85
JBlobClass · 0.85
checkBlobMethod · 0.80
getHandleMethod · 0.45
stuffExceptionMethod · 0.45
addRefMethod · 0.45

Tested by

no test coverage detected