| 611 | |
| 612 | |
| 613 | int 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 | |
| 650 | void TRA_get_inventory(thread_db* tdbb, UCHAR* bit_vector, TraNumber base, TraNumber top) |
no test coverage detected