MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _UndoLog_Rollback_Update_Entity

Function _UndoLog_Rollback_Update_Entity

src/undo_log/undo_log.c:129–152  ·  view source on GitHub ↗

rollback the updates taken place by current query

Source from the content-addressed store, hash-verified

127
128// rollback the updates taken place by current query
129static 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
154static void _UndoLog_Rollback_Set_Labels
155(

Callers 1

UndoLog_RollbackFunction · 0.85

Calls 3

AttributeSet_FreeFunction · 0.85
_index_nodeFunction · 0.85
_index_edgeFunction · 0.85

Tested by

no test coverage detected