MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / db_rollback

Function db_rollback

lua/sp.c:2710–2722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2708}
2709
2710static int db_rollback(Lua L)
2711{
2712 luaL_checkudata(L, 1, dbtypes.db);
2713 SP sp = getsp(L);
2714 reset_consumer_cursor(sp);
2715 if (sp->in_parent_trans) { // explicit commit w/o begin
2716 return luaL_error(L, no_transaction());
2717 }
2718 int rc; // rollback rc
2719 const char *err; // logic err - terminate lua prog
2720 if ((err = db_rollback_int(L, &rc)) == NULL) return push_and_return(L, rc);
2721 return luaL_error(L, err);
2722}
2723
2724static const char *db_begin_int(Lua L, int *rc)
2725{

Callers

nothing calls this directly

Calls 6

luaL_checkudataFunction · 0.85
reset_consumer_cursorFunction · 0.85
luaL_errorFunction · 0.85
no_transactionFunction · 0.85
db_rollback_intFunction · 0.85
push_and_returnFunction · 0.85

Tested by

no test coverage detected