From: Aaron Schulz Date: Thu, 11 Jul 2019 01:21:51 +0000 (-0700) Subject: rdbms: avoid dbSchema() in Database::replaceLostConnection() and Database::__clone() X-Git-Tag: 1.34.0-rc.0~1080 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=aaf8d30204a23b3f5437b6a0417d3470fb3878dd;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 );