| 7000 | |
| 7001 | |
| 7002 | static void verb_post(thread_db* tdbb, |
| 7003 | jrd_tra* transaction, |
| 7004 | record_param* rpb, |
| 7005 | Record* old_data) |
| 7006 | { |
| 7007 | /************************************** |
| 7008 | * |
| 7009 | * v e r b _ p o s t |
| 7010 | * |
| 7011 | ************************************** |
| 7012 | * |
| 7013 | * Functional description |
| 7014 | * Post a record update under verb control to a transaction. |
| 7015 | * If the previous version of the record was created by |
| 7016 | * this transaction in a different verb, save the data as well. |
| 7017 | * |
| 7018 | * Input: |
| 7019 | * rpb: New content of the record |
| 7020 | * old_data: Only supplied if an in-place operation was performed |
| 7021 | * (i.e. update_in_place). |
| 7022 | * |
| 7023 | **************************************/ |
| 7024 | SET_TDBB(tdbb); |
| 7025 | |
| 7026 | VerbAction* const action = transaction->tra_save_point->createAction(rpb->rpb_relation); |
| 7027 | |
| 7028 | if (!RecordBitmap::test(action->vct_records, rpb->rpb_number.getValue())) |
| 7029 | { |
| 7030 | RBM_SET(transaction->tra_pool, &action->vct_records, rpb->rpb_number.getValue()); |
| 7031 | |
| 7032 | if (old_data) |
| 7033 | { |
| 7034 | // An update-in-place is being posted to this savepoint, and this |
| 7035 | // savepoint hasn't seen this record before. |
| 7036 | |
| 7037 | if (!action->vct_undo) |
| 7038 | { |
| 7039 | action->vct_undo = |
| 7040 | FB_NEW_POOL(*transaction->tra_pool) UndoItemTree(*transaction->tra_pool); |
| 7041 | } |
| 7042 | |
| 7043 | action->vct_undo->add(UndoItem(transaction, rpb->rpb_number, old_data)); |
| 7044 | } |
| 7045 | } |
| 7046 | else if (old_data) |
| 7047 | { |
| 7048 | // Double update us posting. The old_data will not be used, |
| 7049 | // so make sure we garbage collect before we lose track of the |
| 7050 | // in-place-updated record. |
| 7051 | action->garbageCollectIdxLite(tdbb, transaction, rpb->rpb_number.getValue(), action, old_data); |
| 7052 | } |
| 7053 | } |
no test coverage detected