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

Function dbstmt_fetch

lua/sp.c:3438–3452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3436}
3437
3438static int dbstmt_fetch(Lua lua)
3439{
3440 SP sp = getsp(lua);
3441 luaL_checkudata(lua, 1, dbtypes.dbstmt);
3442 dbstmt_t *dbstmt = lua_touserdata(lua, 1);
3443 no_stmt_chk(lua, dbstmt);
3444 if (!dbstmt->readonly) {
3445 return luaL_error(lua, "statement must be read-only");
3446 }
3447 setup_first_sqlite_step(sp, dbstmt, 1);
3448 int rc = stmt_sql_step(lua, dbstmt);
3449 if (rc == SQLITE_ROW) return 1;
3450 donate_stmt(sp, dbstmt);
3451 return 0;
3452}
3453
3454static int dbstmt_emit(Lua L)
3455{

Callers

nothing calls this directly

Calls 7

luaL_checkudataFunction · 0.85
lua_touserdataFunction · 0.85
no_stmt_chkFunction · 0.85
luaL_errorFunction · 0.85
setup_first_sqlite_stepFunction · 0.85
stmt_sql_stepFunction · 0.85
donate_stmtFunction · 0.85

Tested by

no test coverage detected