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

Method delete_blob_id

src/jrd/blb.cpp:2268–2304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2266
2267
2268void blb::delete_blob_id(thread_db* tdbb, const bid* blob_id, ULONG prior_page, jrd_rel* relation)
2269{
2270/**************************************
2271 *
2272 * d e l e t e _ b l o b _ i d
2273 *
2274 **************************************
2275 *
2276 * Functional description
2277 * Delete an existing blob for purpose of garbage collection.
2278 *
2279 **************************************/
2280 SET_TDBB(tdbb);
2281 Jrd::Attachment* attachment = tdbb->getAttachment();
2282 Database* dbb = tdbb->getDatabase();
2283 CHECK_DBB(dbb);
2284
2285 // If the blob is null, don't bother to delete it. Reasonable?
2286
2287 if (blob_id->isEmpty())
2288 return;
2289
2290 if (blob_id->bid_internal.bid_relation_id != relation->rel_id)
2291 CORRUPT(200); // msg 200 invalid blob id
2292
2293 // Fetch blob
2294
2295 blb* blob = allocate_blob(tdbb, attachment->getSysTransaction());
2296 blob->blb_relation = relation;
2297 blob->blb_pg_space_id = relation->getPages(tdbb)->rel_pg_space_id;
2298 prior_page = DPM_get_blob(tdbb, blob, blob_id->get_permanent_number(), true, prior_page);
2299
2300 if (!(blob->blb_flags & BLB_damaged))
2301 blob->delete_blob(tdbb, prior_page);
2302
2303 blob->destroy(true);
2304}
2305
2306
2307static ArrayField* find_array(jrd_tra* transaction, const bid* blob_id)

Callers

nothing calls this directly

Calls 10

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
getDatabaseMethod · 0.80
getSysTransactionMethod · 0.80
get_permanent_numberMethod · 0.80
delete_blobMethod · 0.80
getAttachmentMethod · 0.45
isEmptyMethod · 0.45
getPagesMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected