Skip to content

Commit

Permalink
Fix bug in compileInsert with empty values with SQLite.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieutu committed Aug 5, 2017
1 parent 698a635 commit b664dd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Database/Query/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ public function compileInsert(Builder $query, array $values)
// grammar insert builder because no special syntax is needed for the single
// row inserts in SQLite. However, if there are multiples, we'll continue.
if (count($values) == 1) {
if (empty(reset($values))) {
return "insert into $table default values";
}

return parent::compileInsert($query, reset($values));
}

Expand Down

0 comments on commit b664dd0

Please sign in to comment.