MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / DSQL_free_statement

Function DSQL_free_statement

src/dsql/dsql.cpp:199–228  ·  view source on GitHub ↗

DSQL_free_statement @brief Release request for a dsql statement @param user_status @param req_handle @param option **/

Source from the content-addressed store, hash-verified

197
198 **/
199void DSQL_free_statement(thread_db* tdbb, DsqlRequest* dsqlRequest, USHORT option)
200{
201 SET_TDBB(tdbb);
202
203 Jrd::ContextPoolHolder context(tdbb, &dsqlRequest->getPool());
204
205 const auto dsqlStatement = dsqlRequest->getDsqlStatement();
206
207 fb_assert(!(option & DSQL_unprepare)); // handled in y-valve
208
209 if (option & DSQL_drop)
210 {
211 // Release everything associated with the request
212 DsqlRequest::destroy(tdbb, dsqlRequest);
213 }
214 else if (option & DSQL_close)
215 {
216 // Just close the cursor associated with the request
217 if (dsqlStatement->isCursorBased())
218 {
219 if (!dsqlRequest->req_cursor)
220 {
221 ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-501) <<
222 Arg::Gds(isc_dsql_cursor_close_err));
223 }
224
225 DsqlCursor::close(tdbb, dsqlRequest->req_cursor);
226 }
227 }
228}
229
230
231/**

Callers 5

freeEngineDataMethod · 0.85
prepareMethod · 0.85
~PreparedStatementMethod · 0.85
initMethod · 0.85
~ResultSetMethod · 0.85

Calls 7

SET_TDBBFunction · 0.85
ERRD_postFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
isCursorBasedMethod · 0.80
destroyFunction · 0.50
getDsqlStatementMethod · 0.45

Tested by

no test coverage detected