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

Function openOrCreateBlob

src/yvalve/why.cpp:1493–1522  ·  view source on GitHub ↗

Open or create an existing blob (extended edition).

Source from the content-addressed store, hash-verified

1491
1492// Open or create an existing blob (extended edition).
1493static ISC_STATUS openOrCreateBlob(ISC_STATUS* userStatus, isc_db_handle* dbHandle,
1494 isc_tr_handle* traHandle, isc_blob_handle* blobHandle, ISC_QUAD* blobId,
1495 USHORT bpbLength, const UCHAR* bpb, bool createFlag)
1496{
1497 StatusVector status(userStatus);
1498 CheckStatusWrapper statusWrapper(&status);
1499
1500 try
1501 {
1502 nullCheck(blobHandle, isc_bad_segstr_handle);
1503
1504 RefPtr<YAttachment> attachment(translateHandle(attachments, dbHandle));
1505 RefPtr<YTransaction> transaction(translateHandle(transactions, traHandle));
1506
1507 YBlob* blob = createFlag ?
1508 attachment->createBlob(&statusWrapper, transaction, blobId, bpbLength, bpb) :
1509 attachment->openBlob(&statusWrapper, transaction, blobId, bpbLength, bpb);
1510
1511 if (status.getState() & IStatus::STATE_ERRORS)
1512 return status[1];
1513
1514 *blobHandle = blob->getHandle();
1515 }
1516 catch (const Exception& e)
1517 {
1518 e.stuffException(&statusWrapper);
1519 }
1520
1521 return status[1];
1522}
1523
1524
1525//-------------------------------------

Callers 4

Calls 7

nullCheckFunction · 0.85
translateHandleFunction · 0.85
createBlobMethod · 0.45
openBlobMethod · 0.45
getStateMethod · 0.45
getHandleMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected