| 4362 | |
| 4363 | |
| 4364 | Statement* 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 |
nothing calls this directly
no test coverage detected