Browse Source

Fixed test breaks.

tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
1f5d77790f
  1. 4
      framework/yii/db/QueryBuilder.php
  2. 2
      framework/yii/db/mysql/QueryBuilder.php

4
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;
}
}

2
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;

Loading…
Cancel
Save