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

Method log_event_trigger_execute

src/utilities/ntrace/TracePluginImpl.cpp:1760–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1758}
1759
1760void TracePluginImpl::log_event_trigger_execute(ITraceDatabaseConnection* connection,
1761 ITraceTransaction* transaction, ITraceTrigger* trigger, bool started, ntrace_result_t trig_result)
1762{
1763 if (!config.log_trigger_start && started)
1764 return;
1765
1766 if (!config.log_trigger_finish && !started)
1767 return;
1768
1769 // Do not log operation if it is below time threshold
1770 const PerformanceInfo* info = started ? NULL : trigger->getPerf();
1771 if (config.time_threshold && info && info->pin_time < config.time_threshold)
1772 return;
1773
1774 if (info)
1775 {
1776 appendGlobalCounts(info);
1777 appendTableCounts(info);
1778 }
1779
1780 const char* event_type;
1781 switch (trig_result)
1782 {
1783 case ITracePlugin::RESULT_SUCCESS:
1784 event_type = started ? "EXECUTE_TRIGGER_START" :
1785 "EXECUTE_TRIGGER_FINISH";
1786 break;
1787 case ITracePlugin::RESULT_FAILED:
1788 event_type = started ? "FAILED EXECUTE_TRIGGER_START" :
1789 "FAILED EXECUTE_TRIGGER_FINISH";
1790 break;
1791 case ITracePlugin::RESULT_UNAUTHORIZED:
1792 event_type = started ? "UNAUTHORIZED EXECUTE_TRIGGER_START" :
1793 "UNAUTHORIZED EXECUTE_TRIGGER_FINISH";
1794 break;
1795 default:
1796 event_type = "Unknown event at executing trigger";
1797 break;
1798 }
1799
1800 logRecordTrig(event_type, connection, transaction, trigger);
1801}
1802
1803void TracePluginImpl::register_sql_statement(ITraceSQLStatement* statement)
1804{

Callers

nothing calls this directly

Calls 1

getPerfMethod · 0.45

Tested by

no test coverage detected