From 1f5d77790ffedb17f8532513b1361017dd93d333 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Mon, 22 Jul 2013 10:54:43 -0400 Subject: [PATCH] Fixed test breaks. --- framework/yii/db/QueryBuilder.php | 4 ++-- framework/yii/db/mysql/QueryBuilder.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/yii/db/QueryBuilder.php b/framework/yii/db/QueryBuilder.php index 09d7624..5317e67 100644 --- a/framework/yii/db/QueryBuilder.php +++ b/framework/yii/db/QueryBuilder.php @@ -111,7 +111,7 @@ class QueryBuilder extends \yii\base\Object } else { $phName = self::PARAM_PREFIX . count($params); $placeholders[] = $phName; - $params[$phName] = isset($columnSchemas[$name]) ? $columnSchemas[$name]->typecast($value) : $value; + $params[$phName] = !is_array($value) && isset($columnSchemas[$name]) ? $columnSchemas[$name]->typecast($value) : $value; } } @@ -185,7 +185,7 @@ class QueryBuilder extends \yii\base\Object } else { $phName = self::PARAM_PREFIX . count($params); $lines[] = $this->db->quoteColumnName($name) . '=' . $phName; - $params[$phName] = isset($columnSchemas[$name]) ? $columnSchemas[$name]->typecast($value) : $value; + $params[$phName] = !is_array($value) && isset($columnSchemas[$name]) ? $columnSchemas[$name]->typecast($value) : $value; } } diff --git a/framework/yii/db/mysql/QueryBuilder.php b/framework/yii/db/mysql/QueryBuilder.php index a39d124..0307abd 100644 --- a/framework/yii/db/mysql/QueryBuilder.php +++ b/framework/yii/db/mysql/QueryBuilder.php @@ -175,7 +175,7 @@ class QueryBuilder extends \yii\db\QueryBuilder foreach ($rows as $row) { $vs = array(); foreach ($row as $i => $value) { - if (isset($columnSchemas[$columns[$i]])) { + if (!is_array($value) && isset($columnSchemas[$columns[$i]])) { $value = $columnSchemas[$columns[$i]]->typecast($value); } $vs[] = is_string($value) ? $this->db->quoteValue($value) : $value;