| 7281 | } |
| 7282 | |
| 7283 | void lua_func(sqlite3_context *context, int argc, sqlite3_value **argv) |
| 7284 | { |
| 7285 | lua_func_arg_t *arg = sqlite3_user_data(context); |
| 7286 | struct sqlthdstate *thd = arg->thd; |
| 7287 | char *spname = arg->name; |
| 7288 | struct sqlclntstate *clnt = thd->sqlthd->clnt; |
| 7289 | char *err = NULL; |
| 7290 | struct sp_state state = {0}; |
| 7291 | check_sp(spname, clnt, &state); |
| 7292 | int rc = lua_func_int(spname, &err, thd, clnt, context, argc, argv); |
| 7293 | if (rc != 0) { |
| 7294 | sqlite3_result_error(context, err, -1); |
| 7295 | } else { |
| 7296 | emit_sqlite_result(clnt, context); |
| 7297 | } |
| 7298 | free(err); |
| 7299 | if (state.sp) { |
| 7300 | close_sp(clnt); |
| 7301 | restore_sp(clnt, &state); |
| 7302 | } else { |
| 7303 | reset_sp(clnt->sp); |
| 7304 | } |
| 7305 | } |
| 7306 | |
| 7307 | void *exec_trigger(char *spname) |
| 7308 | { |
nothing calls this directly
no test coverage detected