| 1364 | |
| 1365 | |
| 1366 | const StmtNode* EXE_looper(thread_db* tdbb, Request* request, const StmtNode* node) |
| 1367 | { |
| 1368 | /************************************** |
| 1369 | * |
| 1370 | * E X E _ l o o p e r |
| 1371 | * |
| 1372 | ************************************** |
| 1373 | * |
| 1374 | * Functional description |
| 1375 | * Cycle thru request execution tree. Return next node for |
| 1376 | * execution on stall or request complete. |
| 1377 | * |
| 1378 | **************************************/ |
| 1379 | if (!request->req_transaction) |
| 1380 | ERR_post(Arg::Gds(isc_req_no_trans)); |
| 1381 | |
| 1382 | SET_TDBB(tdbb); |
| 1383 | const auto dbb = tdbb->getDatabase(); |
| 1384 | const auto attachment = tdbb->getAttachment(); |
| 1385 | |
| 1386 | if (!node) |
| 1387 | BUGCHECK(147); |
| 1388 | |
| 1389 | // Save the old pool and request to restore on exit |
| 1390 | StmtNode::ExeState exeState(tdbb, request, request->req_transaction); |
| 1391 | Jrd::ContextPoolHolder context(tdbb, request->req_pool); |
| 1392 | |
| 1393 | fb_assert(request->req_caller == NULL); |
| 1394 | request->req_caller = exeState.oldRequest; |
| 1395 | |
| 1396 | tdbb->tdbb_flags &= ~(TDBB_stack_trace_done | TDBB_sys_error); |
| 1397 | |
| 1398 | // Execute stuff until we drop |
| 1399 | |
| 1400 | ProfilerManager* profilerManager; |
| 1401 | SINT64 profilerInitialTicks, profilerInitialAccumulatedOverhead, profilerLastTicks, profilerLastAccumulatedOverhead; |
| 1402 | |
| 1403 | if (attachment->isProfilerActive() && !request->hasInternalStatement()) |
| 1404 | { |
| 1405 | profilerManager = attachment->getProfilerManager(tdbb); |
| 1406 | profilerInitialTicks = profilerLastTicks = profilerManager->queryTicks(); |
| 1407 | profilerInitialAccumulatedOverhead = profilerLastAccumulatedOverhead = |
| 1408 | profilerManager->getAccumulatedOverhead(); |
| 1409 | } |
| 1410 | else |
| 1411 | { |
| 1412 | profilerManager = nullptr; |
| 1413 | profilerInitialTicks = 0; |
| 1414 | profilerLastTicks = 0; |
| 1415 | profilerInitialAccumulatedOverhead = 0; |
| 1416 | profilerLastAccumulatedOverhead = 0; |
| 1417 | } |
| 1418 | |
| 1419 | const StmtNode* profileNode = nullptr; |
| 1420 | |
| 1421 | const auto profilerCallAfterPsqlLineColumn = [&] { |
| 1422 | const SINT64 currentProfilerTicks = profilerManager->queryTicks(); |
| 1423 |
no test coverage detected