| 2406 | |
| 2407 | |
| 2408 | static int limbo_transaction(thread_db* tdbb, TraNumber id) |
| 2409 | { |
| 2410 | /************************************** |
| 2411 | * |
| 2412 | * l i m b o _ t r a n s a c t i o n |
| 2413 | * |
| 2414 | ************************************** |
| 2415 | * |
| 2416 | * Functional description |
| 2417 | * |
| 2418 | * limbo_state is called when reconnecting |
| 2419 | * to an existing transaction to assure that |
| 2420 | * the transaction is actually in limbo. |
| 2421 | * It returns the transaction state. |
| 2422 | * |
| 2423 | **************************************/ |
| 2424 | SET_TDBB(tdbb); |
| 2425 | Database* dbb = tdbb->getDatabase(); |
| 2426 | CHECK_DBB(dbb); |
| 2427 | |
| 2428 | const ULONG trans_per_tip = dbb->dbb_page_manager.transPerTIP; |
| 2429 | |
| 2430 | const ULONG page = id / trans_per_tip; |
| 2431 | const ULONG number = id % trans_per_tip; |
| 2432 | |
| 2433 | WIN window(DB_PAGE_SPACE, -1); |
| 2434 | const tx_inv_page* tip = fetch_inventory_page(tdbb, &window, page, LCK_write); |
| 2435 | |
| 2436 | const ULONG trans_offset = TRANS_OFFSET(number); |
| 2437 | const UCHAR* byte = tip->tip_transactions + trans_offset; |
| 2438 | const USHORT shift = TRANS_SHIFT(number); |
| 2439 | const int state = (*byte >> shift) & TRA_MASK; |
| 2440 | CCH_RELEASE(tdbb, &window); |
| 2441 | |
| 2442 | return state; |
| 2443 | } |
| 2444 | |
| 2445 | |
| 2446 | void jrd_tra::unlinkFromAttachment() |
no test coverage detected