| 1115 | } |
| 1116 | |
| 1117 | static 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 | |
| 1136 | static int enable_global_variables(lua_State *lua) |
| 1137 | { |
no test coverage detected