Skip to content

Commit bdff50f

Browse files
committed
Fixed batch insert with empty rows;
1 parent 4bc3a7c commit bdff50f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/QueryBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ public function update($table, $columns, $condition, &$params)
282282
*/
283283
public function batchInsert($table, $columns, $rows)
284284
{
285+
if (empty($rows)) {
286+
return '';
287+
}
288+
285289
$schema = $this->db->getSchema();
286290
if (($tableSchema = $schema->getTableSchema($table)) !== null) {
287291
$columnSchemas = $tableSchema->columns;

0 commit comments

Comments
 (0)