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

Method prepare

src/remote/client/interface.cpp:4364–4510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4362
4363
4364Statement* Attachment::prepare(CheckStatusWrapper* status, ITransaction* apiTra,
4365 unsigned int stmtLength, const char* sqlStmt, unsigned int dialect, unsigned int flags)
4366{
4367/**************************************
4368 *
4369 * d s q l _ p r e p a r e
4370 *
4371 **************************************
4372 *
4373 * Functional description
4374 * Prepare a dynamic SQL statement for execution.
4375 *
4376 **************************************/
4377
4378 Statement* stmt = NULL;
4379
4380 try
4381 {
4382 reset(status);
4383
4384 // Check and validate handles, etc.
4385
4386 CHECK_HANDLE(rdb, isc_bad_db_handle);
4387 rem_port* port = rdb->rdb_port;
4388 RefMutexGuard portGuard(*port->port_sync, FB_FUNCTION);
4389
4390 Rtr* transaction = NULL;
4391 if (apiTra)
4392 {
4393 transaction = remoteTransaction(apiTra);
4394 CHECK_HANDLE(transaction, isc_bad_trans_handle);
4395 }
4396
4397 if (sqlStmt && !stmtLength)
4398 stmtLength = static_cast<ULONG>(strlen(sqlStmt));
4399
4400 // Validate string length
4401
4402 CHECK_LENGTH(port, stmtLength);
4403
4404 if (dialect > 10)
4405 {
4406 // dimitr: adjust dialect received after
4407 // a multi-hop transmission to be
4408 // redirected in its original value.
4409 dialect /= 10;
4410 }
4411
4412 // create new statement
4413
4414 stmt = createStatement(status, dialect);
4415 Rsr* statement = stmt->getStatement();
4416
4417 // reset current statement
4418
4419 clear_queue(rdb->rdb_port);
4420 REMOTE_reset_statement(statement);
4421

Callers

nothing calls this directly

Calls 15

CHECK_HANDLEFunction · 0.85
CHECK_LENGTHFunction · 0.85
clear_queueFunction · 0.85
REMOTE_reset_statementFunction · 0.85
send_partial_packetFunction · 0.85
send_packetFunction · 0.85
receive_responseFunction · 0.85
resetFunction · 0.70
getStatementMethod · 0.45
testMethod · 0.45
resizeMethod · 0.45
getCountMethod · 0.45

Tested by

no test coverage detected