proper fix for #8844, convert array before using it

fixes #9415
This commit is contained in:
Carsten Brandt
2015-08-14 12:26:36 +02:00
parent 3dd298b548
commit 34d5b45b35
2 changed files with 4 additions and 3 deletions

View File

@ -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 #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 #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) - Chg #9411: `DetailView` now automatically sets container tag ID in case it's not specified (samdark)

View File

@ -280,14 +280,14 @@ SQL;
]); ]);
$constraints = []; $constraints = [];
foreach ($command->queryAll() as $row) { 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') { if ($row['CONSTRAINT_TYPE'] !== 'R') {
// this condition is not checked in SQL WHERE because of an Oracle Bug: // this condition is not checked in SQL WHERE because of an Oracle Bug:
// see https://github.com/yiisoft/yii2/pull/8844 // see https://github.com/yiisoft/yii2/pull/8844
continue; continue;
} }
if ($this->db->slavePdo->getAttribute(\PDO::ATTR_CASE) === \PDO::CASE_LOWER) {
$row = array_change_key_case($row, CASE_UPPER);
}
$name = $row['CONSTRAINT_NAME']; $name = $row['CONSTRAINT_NAME'];
if (!isset($constraints[$name])) { if (!isset($constraints[$name])) {
$constraints[$name] = [ $constraints[$name] = [