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

Function db_commit_int

lua/sp.c:2744–2767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2742}
2743
2744static const char *db_commit_int(Lua L, int *rc)
2745{
2746 SP sp = getsp(L);
2747 if (sp->clnt->ctrl_sqlengine != SQLENG_INTRANS_STATE &&
2748 sp->clnt->ctrl_sqlengine != SQLENG_STRT_STATE) {
2749 sql_set_sqlengine_state(sp->clnt, __FILE__, __LINE__, SQLENG_WRONG_STATE);
2750 return no_transaction();
2751 }
2752 reset_stmts(sp);
2753 sql_set_sqlengine_state(sp->clnt, __FILE__, __LINE__, SQLENG_FNSH_STATE);
2754 if ((*rc = handle_sql_commitrollback(sp->thd, sp->clnt, TRANS_CLNTCOMM_NOREPLY)) == 0) {
2755 free(sp->error);
2756 sp->error = NULL;
2757 } else {
2758 luabb_error(L, sp, errstat_get_str(&sp->clnt->osql.xerr));
2759 }
2760 sp->clnt->ready_for_heartbeats = 1; /* Don't stop sending heartbeats. */
2761 if ((sp->in_parent_trans == 0) && sp->make_parent_trans) {
2762 int tmp;
2763 if (db_begin_int(L, &tmp) == 0) sp->in_parent_trans = 1;
2764 }
2765 sp->clnt->osql.tran_ops = 0;
2766 return NULL;
2767}
2768
2769static const char *db_rollback_int(Lua L, int *rc)
2770{

Callers 4

dbconsumer_consumeFunction · 0.85
db_commitFunction · 0.85
db_begin_intFunction · 0.85
commit_parentFunction · 0.85

Calls 8

sql_set_sqlengine_stateFunction · 0.85
no_transactionFunction · 0.85
reset_stmtsFunction · 0.85
freeFunction · 0.85
luabb_errorFunction · 0.85
errstat_get_strFunction · 0.85
db_begin_intFunction · 0.85

Tested by

no test coverage detected