Skip to content

Commit

Permalink
Fix condition for limit (#5735) (#118)
Browse files Browse the repository at this point in the history
The limit clause should be included when the limit value is greater than or equal to zero.
  • Loading branch information
robhafner authored Oct 11, 2022
1 parent 1007940 commit 22036f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder {
if limit.Limit != nil && *limit.Limit >= 0 {
lmt = *limit.Limit
}
if lmt > 0 || limit.Offset > 0 {
if lmt >= 0 || limit.Offset > 0 {
builder.WriteString("LIMIT ")
builder.WriteString(strconv.Itoa(lmt))
}
Expand Down

0 comments on commit 22036f5

Please sign in to comment.