| 2266 | |
| 2267 | |
| 2268 | void 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 | |
| 2307 | static ArrayField* find_array(jrd_tra* transaction, const bid* blob_id) |
nothing calls this directly
no test coverage detected