Child pages
  • [database] Fatal error after logging a slow query [5.2.2-B2]
Skip to end of metadata
Go to start of metadata

The In-Portal has built-in ability to track slow database queries on the Front-End. This functionality can be enabled by defining these constants in "/system/debug.php" file:

define('DBG_CAPTURE_STATISTICS', 1);	// Capture performance statistics
define('DBG_MAX_SQL_TIME', 2);			// Maximal allowed sql execution time in seconds, all sqls above this become slow sqls

Once enabled all slow queries from Front-End would be logged into "SlowSqlCapture" database table. The functionality is in beta stage and therefore doesn't have any UI in Admin Console.

A bug was discovered recently, that once enabled a fatal error happens on each slow query logging attempt:

Call to a member function free() on boolean

Solution

When logging is enabled the "\kDBConnection::Destroy" method should be called prior to "\kApplication::logSlowQuery".

Related Discussions

Related Tasks

INP-1762 - Getting issue details... STATUS