rollback the updates taken place by current query
| 127 | |
| 128 | // rollback the updates taken place by current query |
| 129 | static void _UndoLog_Rollback_Update_Entity |
| 130 | ( |
| 131 | QueryCtx *ctx, |
| 132 | int seq_start, |
| 133 | int seq_end |
| 134 | ) { |
| 135 | for(int i = seq_start; i > seq_end; --i) { |
| 136 | UndoOp *op = UNDOLOG_GET_ITEM(ctx->undo_log, i); |
| 137 | UndoUpdateOp *update_op = &op->update_op; |
| 138 | |
| 139 | // update indices |
| 140 | if(update_op->entity_type == GETYPE_NODE) { |
| 141 | // free current entity attribute-set |
| 142 | AttributeSet_Free(update_op->n.attributes); |
| 143 | // restore entity original attribute-set |
| 144 | *update_op->n.attributes = update_op->set; |
| 145 | _index_node(ctx, &update_op->n); |
| 146 | } else { |
| 147 | AttributeSet_Free(update_op->e.attributes); |
| 148 | *update_op->e.attributes = update_op->set; |
| 149 | _index_edge(ctx, &update_op->e); |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | static void _UndoLog_Rollback_Set_Labels |
| 155 | ( |
no test coverage detected