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

Method newBlobFunction

src/jrd/BlobUtil.cpp:123–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void BlobUtilPackage::newBlobFunction(ThrowStatusExceptionWrapper* status,
124 IExternalContext* context, const NewBlobInput::Type* in, BlobMessage::Type* out)
125{
126 thread_db* tdbb = JRD_get_thread_data();
127 const auto transaction = tdbb->getTransaction();
128
129 const UCHAR bpb[] = {
130 isc_bpb_version1,
131 isc_bpb_type, 1, UCHAR(in->segmented ? isc_bpb_type_segmented : isc_bpb_type_stream),
132 isc_bpb_storage, 1, UCHAR(in->tempStorage ? isc_bpb_storage_temp : isc_bpb_storage_main)
133 };
134
135 bid id;
136 blb* blob = blb::create2(tdbb, transaction, &id, sizeof(bpb), bpb);
137
138 blob->blb_flags |= BLB_close_on_read;
139
140 out->blobNull = FB_FALSE;
141 out->blob.gds_quad_low = (ULONG) blob->getTempId();
142 out->blob.gds_quad_high = ((FB_UINT64) blob->getTempId()) >> 32;
143}
144
145void BlobUtilPackage::openBlobFunction(ThrowStatusExceptionWrapper* status,
146 IExternalContext* context, const BlobMessage::Type* in, HandleMessage::Type* out)

Callers

nothing calls this directly

Calls 3

JRD_get_thread_dataFunction · 0.85
getTempIdMethod · 0.80
getTransactionMethod · 0.45

Tested by

no test coverage detected