Commit 4b930e1d by Qiang Xue

Merge pull request #2526 from skotos/master

nulls in batchInsert. Patch available.
parents 3dead338 6526f0cb
......@@ -122,6 +122,7 @@ Yii Framework 2 Change Log
- Enh #2490: `yii\db\Query::count()` and other query scalar methods now properly handle queries with GROUP BY clause (qiangxue)
- Enh #2491: Added support for using the same base class name of search model and data model in Gii (qiangxue)
- Enh #2499: Added ability to downgrade migrations by their absolute apply time (resurtm, gorcer)
- Enh #2526: Allow for null values in batchInsert (skotos)
- Enh: Added support for using arrays as option values for console commands (qiangxue)
- Enh: Added `favicon.ico` and `robots.txt` to default application templates (samdark)
- Enh: Added `Widget::autoIdPrefix` to support prefixing automatically generated widget IDs (qiangxue)
......
......@@ -177,7 +177,8 @@ class QueryBuilder extends \yii\base\Object
if (!is_array($value) && isset($columnSchemas[$columns[$i]])) {
$value = $columnSchemas[$columns[$i]]->typecast($value);
}
$vs[] = is_string($value) ? $this->db->quoteValue($value) : $value;
$vs[] = is_string($value) ? $this->db->quoteValue($value)
: ( is_null($value) ? 'null' : $value );
}
$values[] = '(' . implode(', ', $vs) . ')';
}
......
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