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

Method execute

src/dsql/DsqlRequests.cpp:711–745  ·  view source on GitHub ↗

Execute a dynamic SQL statement with tracing, restart and timeout handler

Source from the content-addressed store, hash-verified

709
710// Execute a dynamic SQL statement with tracing, restart and timeout handler
711void 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
747void DsqlDmlRequest::executeReceiveWithRestarts(thread_db* tdbb, jrd_tra** traHandle,
748 IMessageMetadata* outMetadata, UCHAR* outMsg,

Callers

nothing calls this directly

Calls 12

ERRD_postFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
init_statusFunction · 0.85
REPL_exec_sqlFunction · 0.85
JRD_autocommit_ddlFunction · 0.85
getSendMsgMethod · 0.80
isCursorBasedMethod · 0.80
executeDdlMethod · 0.80
finishMethod · 0.45
mustBeReplicatedMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected