Skip to content

Commit 22036f5

Browse files
authored
Fix condition for limit (#5735) (#118)
The limit clause should be included when the limit value is greater than or equal to zero.
1 parent 1007940 commit 22036f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sqlite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder {
101101
if limit.Limit != nil && *limit.Limit >= 0 {
102102
lmt = *limit.Limit
103103
}
104-
if lmt > 0 || limit.Offset > 0 {
104+
if lmt >= 0 || limit.Offset > 0 {
105105
builder.WriteString("LIMIT ")
106106
builder.WriteString(strconv.Itoa(lmt))
107107
}

0 commit comments

Comments
 (0)