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

Function delete_record

src/jrd/vio.cpp:4911–4981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4909
4910
4911static void delete_record(thread_db* tdbb, record_param* rpb, ULONG prior_page, MemoryPool* pool)
4912{
4913/**************************************
4914 *
4915 * d e l e t e _ r e c o r d
4916 *
4917 **************************************
4918 *
4919 * Functional description
4920 * Delete a record an all of its fragments. This assumes the
4921 * record has already been fetched for write. If a pool is given,
4922 * the caller has requested that data be fetched as the record is
4923 * deleted.
4924 *
4925 **************************************/
4926 SET_TDBB(tdbb);
4927
4928#ifdef VIO_DEBUG
4929 jrd_rel* relation = rpb->rpb_relation;
4930 VIO_trace(DEBUG_WRITES,
4931 "delete_record (rel_id %u, record_param %" QUADFORMAT"d, prior_page %" SLONGFORMAT", pool %p)\n",
4932 relation->rel_id, rpb->rpb_number.getValue(), prior_page, (void*)pool);
4933
4934 VIO_trace(DEBUG_WRITES_INFO,
4935 " delete_record record %" SLONGFORMAT":%d, rpb_trans %" SQUADFORMAT
4936 ", flags %d, back %" SLONGFORMAT":%d, fragment %" SLONGFORMAT":%d\n",
4937 rpb->rpb_page, rpb->rpb_line, rpb->rpb_transaction_nr,
4938 rpb->rpb_flags, rpb->rpb_b_page, rpb->rpb_b_line,
4939 rpb->rpb_f_page, rpb->rpb_f_line);
4940#endif
4941 UCHAR* tail = nullptr;
4942 const UCHAR* tail_end = nullptr;
4943
4944 Difference difference;
4945
4946 Record* record = nullptr;
4947 const Record* prior = nullptr;
4948
4949 if (pool && !(rpb->rpb_flags & rpb_deleted))
4950 {
4951 record = VIO_record(tdbb, rpb, NULL, pool);
4952 prior = rpb->rpb_prior;
4953
4954 if (prior)
4955 {
4956 tail = difference.getData();
4957 tail_end = tail + difference.getCapacity();
4958
4959 if (prior != record)
4960 record->copyDataFrom(prior);
4961 }
4962 else
4963 {
4964 tail = record->getData();
4965 tail_end = tail + record->getLength();
4966 }
4967
4968 tail = unpack(rpb, tail_end - tail, tail);

Callers 5

VIO_backoutFunction · 0.85
expungeFunction · 0.85
garbage_collectFunction · 0.85
prepare_updateFunction · 0.85
VIO_update_in_placeFunction · 0.85

Calls 11

SET_TDBBFunction · 0.85
VIO_traceFunction · 0.85
VIO_recordFunction · 0.85
unpackFunction · 0.85
delete_tailFunction · 0.85
copyDataFromMethod · 0.80
getValueMethod · 0.45
getDataMethod · 0.45
getCapacityMethod · 0.45
getLengthMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected