Code cleanup and hardening (see also: T234014) of Database-related
lib code in MediaWiki core.
Bug: T233342
Change-Id: I3c968f4f5300374253dc80d99596cac50fbeb59e
if ( preg_match( '/(^|\s)(DISTINCT|JOIN|ON|AS)(\s|$)/i', $name ) !== 0 ) {
$this->queryLogger->warning(
__METHOD__ . ": use of subqueries is not supported this way.",
if ( preg_match( '/(^|\s)(DISTINCT|JOIN|ON|AS)(\s|$)/i', $name ) !== 0 ) {
$this->queryLogger->warning(
__METHOD__ . ": use of subqueries is not supported this way.",
- [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
+ [ 'exception' => new RuntimeException() ]
$fname . ': lost connection to {dbserver}; reconnected',
[
'dbserver' => $this->getServer(),
$fname . ': lost connection to {dbserver}; reconnected',
[
'dbserver' => $this->getServer(),
- 'trace' => ( new RuntimeException() )->getTraceAsString()
+ 'exception' => new RuntimeException()
]
);
} catch ( DBConnectionError $e ) {
]
);
} catch ( DBConnectionError $e ) {
*/
public function __clone() {
$this->connLogger->warning(
*/
public function __clone() {
$this->connLogger->warning(
- "Cloning " . static::class . " is not recomended; forking connection:\n" .
- ( new RuntimeException() )->getTraceAsString()
+ "Cloning " . static::class . " is not recommended; forking connection",
+ [ 'exception' => new RuntimeException() ]
);
if ( $this->isOpen() ) {
);
if ( $this->isOpen() ) {