From 34d5b45b35c73e05b590a6343f01b51e77c426e6 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Fri, 14 Aug 2015 12:26:36 +0200 Subject: [PATCH] proper fix for #8844, convert array before using it fixes #9415 --- framework/CHANGELOG.md | 1 + framework/db/oci/Schema.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 1ab0b68d4f..99b98bc74c 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -5,6 +5,7 @@ Yii Framework 2 Change Log ----------------------- - Bug #8723: Fixed `yii\helpers\VarDumper::export()` unable to export circle referenced objects with `Closure` (klimov-paul) +- Bug #9415: Fixed regression in 2.0.6 where on Oracle DB `PDO::ATTR_CASE = PDO::CASE_UPPER` did not work anymore (cebe) - Chg #9369: `Yii::$app->user->can()` now returns `false` instead of erroring in case `authManager` component is not configured (creocoder) - Chg #9411: `DetailView` now automatically sets container tag ID in case it's not specified (samdark) diff --git a/framework/db/oci/Schema.php b/framework/db/oci/Schema.php index 5fcd419759..e35f4edb5f 100644 --- a/framework/db/oci/Schema.php +++ b/framework/db/oci/Schema.php @@ -280,14 +280,14 @@ SQL; ]); $constraints = []; foreach ($command->queryAll() as $row) { + if ($this->db->slavePdo->getAttribute(\PDO::ATTR_CASE) === \PDO::CASE_LOWER) { + $row = array_change_key_case($row, CASE_UPPER); + } if ($row['CONSTRAINT_TYPE'] !== 'R') { // this condition is not checked in SQL WHERE because of an Oracle Bug: // see https://github.com/yiisoft/yii2/pull/8844 continue; } - if ($this->db->slavePdo->getAttribute(\PDO::ATTR_CASE) === \PDO::CASE_LOWER) { - $row = array_change_key_case($row, CASE_UPPER); - } $name = $row['CONSTRAINT_NAME']; if (!isset($constraints[$name])) { $constraints[$name] = [