From aaf8d30204a23b3f5437b6a0417d3470fb3878dd Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 10 Jul 2019 18:21:51 -0700 Subject: [PATCH] rdbms: avoid dbSchema() in Database::replaceLostConnection() and Database::__clone() Since dbSchema() always casts the result to a string, using this method with a call to open() is broken if the RDBMs does not support DB schemas and thus requires null Follows-up 7911da9c6f (last week), which added the check in DatabaseMysqlBase::open() check. Also follows fe0af6cad (last year), which made dbSchema() consistently return string. Before that, an implicit null was passed in from Database::factory for mysql, which hid the class default of empty string. Bug: T227708 Change-Id: I67207fbaa39c5cc3fe062077cc654f048090e009 --- includes/libs/rdbms/database/Database.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 894a262306..91dc069be8 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -4290,8 +4290,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware $this->server, $this->user, $this->password, - $this->getDBname(), - $this->dbSchema(), + $this->currentDomain->getDatabase(), + $this->currentDomain->getSchema(), $this->tablePrefix() ); $this->lastPing = microtime( true ); @@ -4868,8 +4868,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware $this->server, $this->user, $this->password, - $this->getDBname(), - $this->dbSchema(), + $this->currentDomain->getDatabase(), + $this->currentDomain->getSchema(), $this->tablePrefix() ); $this->lastPing = microtime( true ); -- 2.20.1