| 2375 | |
| 2376 | |
| 2377 | void Attachment::execWithCheck(CheckStatusWrapper* status, const string& stmt) |
| 2378 | { |
| 2379 | /************************************** |
| 2380 | * |
| 2381 | * Used to execute "SET xxx TIMEOUT" statements. Checks for protocol version |
| 2382 | * and convert expected SQL error into isc_wish_list error. The only possible |
| 2383 | * case is when modern network server works with legacy engine. |
| 2384 | * |
| 2385 | **************************************/ |
| 2386 | if (rdb->rdb_port->port_protocol >= PROTOCOL_STMT_TOUT) |
| 2387 | { |
| 2388 | execute(status, NULL, stmt.length(), stmt.c_str(), SQL_DIALECT_CURRENT, NULL, NULL, NULL, NULL); |
| 2389 | |
| 2390 | if (!(status->getState() & IStatus::STATE_ERRORS)) |
| 2391 | return; |
| 2392 | |
| 2393 | // handle isc_dsql_token_unk_err |
| 2394 | const ISC_STATUS* errs = status->getErrors(); |
| 2395 | |
| 2396 | if (!fb_utils::containsErrorCode(errs, isc_sqlerr) || |
| 2397 | !fb_utils::containsErrorCode(errs, isc_dsql_token_unk_err)) |
| 2398 | { |
| 2399 | return; |
| 2400 | } |
| 2401 | |
| 2402 | status->init(); |
| 2403 | } |
| 2404 | |
| 2405 | status->setErrors(Arg::Gds(isc_wish_list).value()); |
| 2406 | } |
| 2407 | |
| 2408 | |
| 2409 | unsigned int Attachment::getIdleTimeout(CheckStatusWrapper* status) |