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

Method readDataFunction

src/jrd/BlobUtil.cpp:181–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void BlobUtilPackage::readDataFunction(ThrowStatusExceptionWrapper* status,
182 IExternalContext* context, const ReadDataInput::Type* in, BinaryMessage::Type* out)
183{
184 if (!in->lengthNull && in->length <= 0)
185 status_exception::raise(Arg::Gds(isc_random) << "Length must be NULL or greater than 0");
186
187 const auto tdbb = JRD_get_thread_data();
188 const auto transaction = tdbb->getTransaction();
189 const auto blob = getBlobFromHandle(tdbb, in->handle);
190
191 if (in->lengthNull)
192 out->data.length = blob->BLB_get_segment(tdbb, (UCHAR*) out->data.str, sizeof(out->data.str));
193 else
194 {
195 out->data.length = blob->BLB_get_data(tdbb, (UCHAR*) out->data.str,
196 MIN(in->length, sizeof(out->data.str)), false);
197 }
198
199 out->dataNull = out->data.length == 0 && (blob->blb_flags & BLB_eof) ? FB_TRUE : FB_FALSE;
200}
201
202//--------------------------------------
203

Callers

nothing calls this directly

Calls 7

raiseFunction · 0.85
GdsClass · 0.85
JRD_get_thread_dataFunction · 0.85
getBlobFromHandleFunction · 0.85
BLB_get_segmentMethod · 0.80
BLB_get_dataMethod · 0.80
getTransactionMethod · 0.45

Tested by

no test coverage detected