dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3494f65
)
Add query count to $wgDebugDumpSql output
author
Aryeh Gregor
<simetrical@users.mediawiki.org>
Mon, 16 Aug 2010 22:29:27 +0000
(22:29 +0000)
committer
Aryeh Gregor
<simetrical@users.mediawiki.org>
Mon, 16 Aug 2010 22:29:27 +0000
(22:29 +0000)
This makes it easy to see how many queries are being run on each view.
Also rephrased the message a bit.
includes/db/Database.php
patch
|
blob
|
history
diff --git
a/includes/db/Database.php
b/includes/db/Database.php
index
4770293
..
250844b
100644
(file)
--- a/
includes/db/Database.php
+++ b/
includes/db/Database.php
@@
-493,12
+493,14
@@
abstract class DatabaseBase {
}
if ( $this->debug() ) {
+ static $cnt = 0;
+ $cnt++;
$sqlx = substr( $commentedSql, 0, 500 );
$sqlx = strtr( $sqlx, "\t\n", ' ' );
if ( $isMaster ) {
- wfDebug( "
SQL-master
: $sqlx\n" );
+ wfDebug( "
Query $cnt (master)
: $sqlx\n" );
} else {
- wfDebug( "
SQL
: $sqlx\n" );
+ wfDebug( "
Query $cnt (slave)
: $sqlx\n" );
}
}