Page MenuHomePhabricator

Comments in wrong spot in SQL logs
Closed, ResolvedPublic

Description

The function Database->limitResult adds a blank space to the beginning of SQL queries for some reason. When logging SQL, this space causes comments to be added to the beginning of the SQL instead of after the command in Database->query.

Expected result in log:
SQL: SELECT /* SiteStatsUpdate::doUpdate UserName */ * FROM site_stats LIMIT 1

Actual Result in log:
SQL : /* SiteStatsUpdate::doUpdate UserName */ SELECT * FROM site_stats LIMIT 1


Version: 1.13.x
Severity: trivial
URL: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/Database.php?view=markup

Details

Reference
bz14042

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:11 PM
bzimport set Reference to bz14042.
bzimport added a subscriber: Unknown Object (MLST).

By the way, this can be fixed by deleting the extra space in front of the $sql variable in Database->limitResult. About as easy as they come.