Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1102192
D359.id897.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 18, 4:44 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Tue, Aug 19, 4:44 AM (2 h, 44 m)
Engine
blob
Format
Raw Data
Handle
713985
Attached To
D359: INP-1762 - Destroy query object before logging
D359.id897.diff
View Options
Index: core/kernel/db/db_connection.php
===================================================================
--- core/kernel/db/db_connection.php
+++ core/kernel/db/db_connection.php
@@ -506,7 +506,10 @@
*/
public function Query($sql, $key_field = null, $no_debug = false)
{
- $this->_queryCount++;
+ if ( !$no_debug ) {
+ $this->_queryCount++;
+ }
+
$this->lastQuery = $sql;
// set 1st checkpoint: begin
@@ -530,11 +533,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 +547,6 @@
}
// set 2nd checkpoint: end
- $this->Destroy();
-
return $ret;
}
else {
@@ -572,7 +575,10 @@
*/
public function GetIterator($sql, $key_field = null, $no_debug = false, $iterator_class = 'kMySQLQuery')
{
- $this->_queryCount++;
+ if ( !$no_debug ) {
+ $this->_queryCount++;
+ }
+
$this->lastQuery = $sql;
// set 1st checkpoint: begin
@@ -590,7 +596,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);
}
@@ -1058,7 +1064,7 @@
public function GetIterator($sql, $key_field = null, $no_debug = false, $iterator_class = 'kMySQLQuery')
{
if ( $no_debug ) {
- return parent::Query($sql, $key_field, $no_debug, $iterator_class);
+ return parent::GetIterator($sql, $key_field, $no_debug, $iterator_class);
}
global $debugger;
Event Timeline
Log In to Comment