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

Function trace_failed_attach

src/jrd/jrd.cpp:1564–1592  ·  view source on GitHub ↗

Report to Trace API that attachment has not been created

Source from the content-addressed store, hash-verified

1562
1563// Report to Trace API that attachment has not been created
1564static void trace_failed_attach(const char* filename, const DatabaseOptions& options,
1565 unsigned flags, FbStatusVector* status, ICryptKeyCallback* callback)
1566{
1567 // Avoid uncontrolled recursion
1568 if (options.dpb_map_attach)
1569 return;
1570
1571 const char* origFilename = filename;
1572 if (options.dpb_org_filename.hasData())
1573 origFilename = options.dpb_org_filename.c_str();
1574
1575 // Create trivial trace object for connection
1576 TraceFailedConnection conn(origFilename, &options);
1577 TraceStatusVectorImpl traceStatus(status, TraceStatusVectorImpl::TS_ERRORS);
1578
1579 ISC_STATUS s = status->getErrors()[1];
1580 const ntrace_result_t result = (s == isc_login || s == isc_no_priv) ?
1581 ITracePlugin::RESULT_UNAUTHORIZED : ITracePlugin::RESULT_FAILED;
1582 const char* func = flags & UNWIND_CREATE ? "JProvider::createDatabase" : "JProvider::attachDatabase";
1583
1584 // Perform actual trace
1585 TraceManager tempMgr(origFilename, callback, flags & UNWIND_NEW);
1586
1587 if (tempMgr.needs(ITraceFactory::TRACE_EVENT_ATTACH))
1588 tempMgr.event_attach(&conn, flags & UNWIND_CREATE, result);
1589
1590 if (tempMgr.needs(ITraceFactory::TRACE_EVENT_ERROR))
1591 tempMgr.event_error(&conn, &traceStatus, func);
1592}
1593
1594
1595namespace Jrd {

Callers 3

internalAttachMethod · 0.85
createDatabaseMethod · 0.85
unwindAttachFunction · 0.85

Calls 6

needsMethod · 0.80
event_attachMethod · 0.80
event_errorMethod · 0.80
hasDataMethod · 0.45
c_strMethod · 0.45
getErrorsMethod · 0.45

Tested by

no test coverage detected