Commit 7b20bdee by Alexander Makarov

Fixes #6279: `yii\db\Schema::getLastInsertID()` was passing wrong default schema name to PDO

parent e41d670a
...@@ -39,6 +39,7 @@ Yii Framework 2 Change Log ...@@ -39,6 +39,7 @@ Yii Framework 2 Change Log
- Bug #6150: `yii\bootstrap\Tabs` dropdown IDs were generated incorrectly (samdark) - Bug #6150: `yii\bootstrap\Tabs` dropdown IDs were generated incorrectly (samdark)
- Bug #6266: Clicking on reset button does not hide error summary when using `ActiveForm` (InteLigent, qiangxue) - Bug #6266: Clicking on reset button does not hide error summary when using `ActiveForm` (InteLigent, qiangxue)
- Bug #6271: Query caching returns the same data when running the same SQL with different fetch modes (grachov) - Bug #6271: Query caching returns the same data when running the same SQL with different fetch modes (grachov)
- Bug #6279: `yii\db\Schema::getLastInsertID()` was passing wrong default schema name to PDO (samdark)
- Bug: Gii console command help information does not contain global options (qiangxue) - Bug: Gii console command help information does not contain global options (qiangxue)
- Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark) - Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark)
- Bug: `yii\web\AssetManager` should not publish disabled asset bundles (qiangxue) - Bug: `yii\web\AssetManager` should not publish disabled asset bundles (qiangxue)
......
...@@ -312,7 +312,7 @@ abstract class Schema extends Object ...@@ -312,7 +312,7 @@ abstract class Schema extends Object
public function getLastInsertID($sequenceName = '') public function getLastInsertID($sequenceName = '')
{ {
if ($this->db->isActive) { if ($this->db->isActive) {
return $this->db->pdo->lastInsertId($sequenceName); return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $sequenceName);
} else { } else {
throw new InvalidCallException('DB Connection is not active.'); throw new InvalidCallException('DB Connection is not active.');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment