Execute a dynamic SQL statement with tracing, restart and timeout handler
| 709 | |
| 710 | // Execute a dynamic SQL statement with tracing, restart and timeout handler |
| 711 | void DsqlDmlRequest::execute(thread_db* tdbb, jrd_tra** traHandle, |
| 712 | IMessageMetadata* inMetadata, const UCHAR* inMsg, |
| 713 | IMessageMetadata* outMetadata, UCHAR* outMsg, |
| 714 | bool singleton) |
| 715 | { |
| 716 | if (!request) |
| 717 | { |
| 718 | ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-504) << |
| 719 | Arg::Gds(isc_unprepared_stmt)); |
| 720 | } |
| 721 | |
| 722 | // If there is no data required, just start the request |
| 723 | |
| 724 | const dsql_msg* message = dsqlStatement->getSendMsg(); |
| 725 | if (message) |
| 726 | mapInOut(tdbb, false, message, inMetadata, NULL, inMsg); |
| 727 | |
| 728 | // we need to mapInOut() before tracing of execution start to let trace |
| 729 | // manager know statement parameters values |
| 730 | TraceDSQLExecute trace(req_dbb->dbb_attachment, this); |
| 731 | |
| 732 | // Setup and start timeout timer |
| 733 | const bool have_cursor = dsqlStatement->isCursorBased() && !singleton; |
| 734 | |
| 735 | setupTimer(tdbb); |
| 736 | thread_db::TimerGuard timerGuard(tdbb, req_timer, !have_cursor); |
| 737 | |
| 738 | if (needRestarts()) |
| 739 | executeReceiveWithRestarts(tdbb, traHandle, outMetadata, outMsg, singleton, true, false); |
| 740 | else { |
| 741 | doExecute(tdbb, traHandle, outMetadata, outMsg, singleton); |
| 742 | } |
| 743 | |
| 744 | trace.finish(have_cursor, ITracePlugin::RESULT_SUCCESS); |
| 745 | } |
| 746 | |
| 747 | void DsqlDmlRequest::executeReceiveWithRestarts(thread_db* tdbb, jrd_tra** traHandle, |
| 748 | IMessageMetadata* outMetadata, UCHAR* outMsg, |
nothing calls this directly
no test coverage detected