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

Function donate_stmt

lua/sp.c:1117–1134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1115}
1116
1117static void donate_stmt(SP sp, dbstmt_t *dbstmt)
1118{
1119 sqlite3_stmt *stmt = dbstmt->stmt;
1120 if (stmt == NULL) return;
1121
1122 if (!gbl_enable_sql_stmt_caching || !dbstmt->rec) {
1123 sqlite3_finalize(stmt);
1124 } else {
1125 stmt_cache_put(sp->thd, sp->clnt, dbstmt->rec, sp->rc);
1126 }
1127 if (dbstmt->num_tbls) {
1128 LIST_REMOVE(dbstmt, entries);
1129 }
1130 free(dbstmt->rec);
1131 dbstmt->rec = NULL;
1132 dbstmt->stmt = NULL;
1133 dbstmt->num_tbls = 0;
1134}
1135
1136static int enable_global_variables(lua_State *lua)
1137{

Callers 5

reset_stmtFunction · 0.85
dbstmt_freeFunction · 0.85
dbstmt_execFunction · 0.85
dbstmt_fetchFunction · 0.85
dbstmt_closeFunction · 0.85

Calls 3

sqlite3_finalizeFunction · 0.85
stmt_cache_putFunction · 0.85
freeFunction · 0.85

Tested by

no test coverage detected