Skip to content

Commit 4150a80

Browse files
dominikbraunkyleconroy
authored andcommitted
check if LimitCount and LimitOffset exist in query (#209)
1 parent f88ddd5 commit 4150a80

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/dinosql/parser.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,12 @@ func (p *paramSearch) Visit(node nodes.Node) Visitor {
990990
p.parent = node
991991

992992
case nodes.SelectStmt:
993-
p.limitCount = n.LimitCount
994-
p.limitOffset = n.LimitOffset
993+
if n.LimitCount != nil {
994+
p.limitCount = n.LimitCount
995+
}
996+
if n.LimitOffset != nil {
997+
p.limitOffset = n.LimitOffset
998+
}
995999

9961000
case nodes.TypeCast:
9971001
p.parent = node

0 commit comments

Comments
 (0)