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

Method register_blr_statement

src/utilities/ntrace/TracePluginImpl.cpp:1980–2019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1978
1979
1980void TracePluginImpl::register_blr_statement(ITraceBLRStatement* statement)
1981{
1982 string* description = FB_NEW_POOL(*getDefaultMemoryPool()) string(*getDefaultMemoryPool());
1983
1984 if (statement->getStmtID()) {
1985 description->printf(NEWLINE "Statement %" SQUADFORMAT":" NEWLINE, statement->getStmtID());
1986 }
1987
1988 if (config.print_blr)
1989 {
1990 const char *text_blr = statement->getText();
1991 size_t text_blr_length = text_blr ? strlen(text_blr) : 0;
1992 if (!text_blr)
1993 text_blr = "";
1994
1995 if (config.max_blr_length && text_blr_length > config.max_blr_length)
1996 {
1997 // Truncate too long BLR printing it out with ellipsis
1998 text_blr_length = config.max_blr_length < 3 ? 0 : config.max_blr_length - 3;
1999 description->printf(
2000 "-------------------------------------------------------------------------------" NEWLINE
2001 "%.*s..." NEWLINE,
2002 text_blr_length, text_blr);
2003 }
2004 else
2005 {
2006 description->printf(
2007 "-------------------------------------------------------------------------------" NEWLINE
2008 "%.*s" NEWLINE,
2009 text_blr_length, text_blr);
2010 }
2011 }
2012
2013 StatementData stmt_data;
2014 stmt_data.id = statement->getStmtID();
2015 stmt_data.description = description;
2016 WriteLockGuard lock(statementsLock, FB_FUNCTION);
2017
2018 statements.add(stmt_data);
2019}
2020
2021void TracePluginImpl::log_event_blr_compile(ITraceDatabaseConnection* connection,
2022 ITraceTransaction* transaction, ITraceBLRStatement* statement,

Callers

nothing calls this directly

Calls 5

getDefaultMemoryPoolFunction · 0.85
getStmtIDMethod · 0.45
printfMethod · 0.45
getTextMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected