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

Function TRA_fetch_state

src/jrd/tra.cpp:613–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611
612
613int TRA_fetch_state(thread_db* tdbb, TraNumber number)
614{
615/**************************************
616 *
617 * T R A _ f e t c h _ s t a t e
618 *
619 **************************************
620 *
621 * Functional description
622 * Physically fetch the state of a given
623 * transaction on the transaction inventory
624 * page.
625 *
626 **************************************/
627 SET_TDBB(tdbb);
628 Database* dbb = tdbb->getDatabase();
629 CHECK_DBB(dbb);
630
631 // locate and fetch the proper TIP page
632
633 const ULONG trans_per_tip = dbb->dbb_page_manager.transPerTIP;
634 const ULONG tip_seq = number / trans_per_tip;
635 WIN window(DB_PAGE_SPACE, -1);
636 const tx_inv_page* tip = fetch_inventory_page(tdbb, &window, tip_seq, LCK_read);
637
638 // calculate the state of the desired transaction
639
640 const ULONG byte = TRANS_OFFSET(number % trans_per_tip);
641 const USHORT shift = TRANS_SHIFT(number);
642 const int state = (tip->tip_transactions[byte] >> shift) & TRA_MASK;
643
644 CCH_RELEASE(tdbb, &window);
645
646 return state;
647}
648
649
650void TRA_get_inventory(thread_db* tdbb, UCHAR* bit_vector, TraNumber base, TraNumber top)

Callers 4

snapshotStateMethod · 0.85
TPC_snapshot_stateFunction · 0.85
walk_data_pageMethod · 0.85
TRA_snapshot_stateFunction · 0.85

Calls 5

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
fetch_inventory_pageFunction · 0.85
CCH_RELEASEFunction · 0.85
getDatabaseMethod · 0.80

Tested by

no test coverage detected