undo schema addition
| 289 | |
| 290 | // undo schema addition |
| 291 | static void _UndoLog_Rollback_Add_Schema |
| 292 | ( |
| 293 | QueryCtx *ctx, |
| 294 | int seq_start, |
| 295 | int seq_end |
| 296 | ) { |
| 297 | for(int i = seq_start; i > seq_end; --i) { |
| 298 | Edge e; |
| 299 | UndoOp *op = UNDOLOG_GET_ITEM(ctx->undo_log, i); |
| 300 | UndoAddSchemaOp schema_op = op->schema_op; |
| 301 | int schema_id = schema_op.schema_id; |
| 302 | int schema_count = GraphContext_SchemaCount(ctx->gc, schema_op.t); |
| 303 | ASSERT(schema_id == schema_count - 1); |
| 304 | GraphContext_RemoveSchema(ctx->gc, schema_id, schema_op.t); |
| 305 | if(schema_op.t == SCHEMA_NODE) { |
| 306 | Graph_RemoveLabel(ctx->gc->g, schema_id); |
| 307 | } else { |
| 308 | Graph_RemoveRelation(ctx->gc->g, schema_id); |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | // undo attribute addition |
| 314 | static void _UndoLog_Rollback_Add_Attribute |
no test coverage detected