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

Function allocate_statement

src/remote/server/server.cpp:2278–2322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2276
2277
2278static ISC_STATUS allocate_statement( rem_port* port, /*P_RLSE* allocate,*/ PACKET* send)
2279{
2280/**************************************
2281 *
2282 * a l l o c a t e _ s t a t e m e n t
2283 *
2284 **************************************
2285 *
2286 * Functional description
2287 * Allocate a statement handle.
2288 *
2289 **************************************/
2290 LocalStatus ls;
2291 CheckStatusWrapper status_vector(&ls);
2292
2293 Rdb* rdb = port->port_context;
2294
2295 if (bad_db(&status_vector, rdb))
2296 {
2297 return port->send_response(send, 0, 0, &status_vector, true);
2298 }
2299
2300 OBJCT object = 0;
2301 // Allocate SQL request block
2302
2303 Rsr* statement = FB_NEW Rsr;
2304 statement->rsr_rdb = rdb;
2305 statement->rsr_iface = NULL;
2306
2307 if (statement->rsr_id = port->get_id(statement))
2308 {
2309 object = statement->rsr_id;
2310 statement->rsr_next = rdb->rdb_sql_requests;
2311 rdb->rdb_sql_requests = statement;
2312 }
2313 else
2314 {
2315 delete statement;
2316
2317 status_vector.init();
2318 (Arg::Gds(isc_too_many_handles)).copyTo(&status_vector);
2319 }
2320
2321 return port->send_response(send, object, 0, &status_vector, true);
2322}
2323
2324
2325static void append_request_chain(server_req_t* request, server_req_t** que_inst)

Callers 1

process_packetFunction · 0.85

Calls 6

bad_dbFunction · 0.85
GdsClass · 0.85
send_responseMethod · 0.80
get_idMethod · 0.45
initMethod · 0.45
copyToMethod · 0.45

Tested by

no test coverage detected