| 2694 | } |
| 2695 | |
| 2696 | static 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 | |
| 2710 | static int db_rollback(Lua L) |
| 2711 | { |
nothing calls this directly
no test coverage detected