dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
e3ca1ae
)
Merge "(bug 42598) Database: fname was not logged for BEGIN/COMMIT."
author
Nikerabbit
<niklas.laxstrom@gmail.com>
Sun, 2 Dec 2012 08:45:00 +0000
(08:45 +0000)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Sun, 2 Dec 2012 08:45:00 +0000
(08:45 +0000)
includes/db/Database.php
patch
|
blob
|
history
diff --git
a/includes/db/Database.php
b/includes/db/Database.php
index
dfb3469
..
a638540
100644
(file)
--- a/
includes/db/Database.php
+++ b/
includes/db/Database.php
@@
-904,7
+904,10
@@
abstract class DatabaseBase implements DatabaseType {
} else {
$userName = '';
}
- $commentedSql = preg_replace( '/\s/', " /* $fname $userName */ ", $sql, 1 );
+
+ // Add trace comment to the begin of the sql string, right after the operator.
+ // Or, for one-word queries (like "BEGIN" or COMMIT") add it to the end (bug 42598)
+ $commentedSql = preg_replace( '/\s|$/', " /* $fname $userName */ ", $sql, 1 );
# If DBO_TRX is set, start a transaction
if ( ( $this->mFlags & DBO_TRX ) && !$this->mTrxLevel &&