Commit 7ce47024 by Scott Tester

Allow null values for fields in batchInsert

parent 3a6b9341
...@@ -177,7 +177,8 @@ class QueryBuilder extends \yii\base\Object ...@@ -177,7 +177,8 @@ class QueryBuilder extends \yii\base\Object
if (!is_array($value) && isset($columnSchemas[$columns[$i]])) { if (!is_array($value) && isset($columnSchemas[$columns[$i]])) {
$value = $columnSchemas[$columns[$i]]->typecast($value); $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) . ')'; $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