While debugging a problem with uncommitted queries in a maintenance script I noticed that the /* $fname .. */ comments are not added to these queries.
the Database::begin, Database::doBegin methods do pass it around, and callers also provide it. However Database::query messes up by relying on the presence of whitespace in the sql string:
$commentedSql = preg_replace( '/\s/', " /* $fname $userName */ ", $sql, 1 );
Version: unspecified
Severity: normal