mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fix #19816: Explicitly pass $fallbackToMaster as true to getSlavePdo() to ensure it is not affected by child class with changed defaults
This commit is contained in:
@ -410,7 +410,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
|
||||
}
|
||||
$version = $cache ? $cache->get($key) : null;
|
||||
if (!$version) {
|
||||
$version = $this->db->getSlavePdo()->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||
$version = $this->db->getSlavePdo(true)->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||
if ($cache) {
|
||||
$cache->set($key, $version, $this->db->schemaCacheDuration);
|
||||
}
|
||||
|
||||
@ -484,7 +484,7 @@ SQL;
|
||||
protected function isOldMysql()
|
||||
{
|
||||
if ($this->_oldMysql === null) {
|
||||
$version = $this->db->getSlavePdo()->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||
$version = $this->db->getSlavePdo(true)->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||
$this->_oldMysql = version_compare($version, '5.1', '<=');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user