Index: core/kernel/db/db_connection.php =================================================================== --- core/kernel/db/db_connection.php +++ core/kernel/db/db_connection.php @@ -530,11 +530,13 @@ } } + $this->Destroy(); + // set 2nd checkpoint: begin if ( $this->_captureStatistics ) { $query_time = microtime(true) - $start_time; - if ( $query_time > DBG_MAX_SQL_TIME ) { + if ( $query_time > DBG_MAX_SQL_TIME && !$no_debug ) { $this->Application->logSlowQuery($sql, $query_time); } @@ -542,8 +544,6 @@ } // set 2nd checkpoint: end - $this->Destroy(); - return $ret; } else { @@ -590,7 +590,7 @@ if ( $this->_captureStatistics ) { $query_time = microtime(true) - $start_time; - if ( $query_time > DBG_MAX_SQL_TIME ) { + if ( $query_time > DBG_MAX_SQL_TIME && !$no_debug ) { $this->Application->logSlowQuery($sql, $query_time); }