For web requests, this was attempting to inject the current client's
session user name or XFF-resolved IP address to the SQL query.
However, this has been broken for five years (since around
commit 16b4e3a9f1 / Ibb4f1c0dafea071a) because the relevant objects
are already constructed by the time MediaWiki::main() runs, and so
MediaWiki::setDBProfilingAgent isn't doing much other then changing
the LBFactory state, which rarely gets another chance to pass it down
after that.
This breakage is actually a good thing as otherwise Tendril and
performance_schema tools would not have been able to aggregate slow
queries very well due to being too dynamic/variable (these tools
can't ignore comments per T291420 and T291419, and the comments we
do have for fname are actually useful to aggregate.)
As of I6e9939e34287d27430, this lack of dynamic variability (apart
from standard SQL syntax conditions that can vary) is now documented
as desirable for wikimedia/rdbms. To avoid confusion or from this
code accidentally becoming undead, let's remove it.
While at it, remove it for CLI in MWLBFactory as well. This one did
work currently, but as I understand it was not very useful on its
own but rather filling in data to keep a consistant shape with the
web format, which is broken. In particular, afaik dbuser and
sender webserver hostname are already known to MySQL for all queries
and present in processlist and other tooling.
Bug: T193050
Change-Id: I033140ddbb04df97de3391a247d1ca937b3bc918