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

Function db_commit

lua/sp.c:2696–2708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2694}
2695
2696static int db_commit(Lua L)
2697{
2698 luaL_checkudata(L, 1, dbtypes.db);
2699 SP sp = getsp(L);
2700 reset_consumer_cursor(sp);
2701 if (sp->in_parent_trans) { // explicit commit w/o begin
2702 return luaL_error(L, no_transaction());
2703 }
2704 int rc; // commit rc
2705 const char *err; // logic err - terminate lua prog
2706 if ((err = db_commit_int(L, &rc)) == NULL) return push_and_return(L, rc);
2707 return luaL_error(L, err);
2708}
2709
2710static int db_rollback(Lua L)
2711{

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_commit_intFunction · 0.85
push_and_returnFunction · 0.85

Tested by

no test coverage detected