Skip to content

Commit b664dd0

Browse files
committed
Fix bug in compileInsert with empty values with SQLite.
1 parent 698a635 commit b664dd0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ public function compileInsert(Builder $query, array $values)
153153
// grammar insert builder because no special syntax is needed for the single
154154
// row inserts in SQLite. However, if there are multiples, we'll continue.
155155
if (count($values) == 1) {
156+
if (empty(reset($values))) {
157+
return "insert into $table default values";
158+
}
159+
156160
return parent::compileInsert($query, reset($values));
157161
}
158162

0 commit comments

Comments
 (0)