Skip to content

Commit f714d98

Browse files
authored
Fix the bug of limit (#603)
1 parent 736bb80 commit f714d98

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

pkg/sql/compile/limit.go

+6-13
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,12 @@ func pushLimit(s *Scope, arg *vlimit.Argument) *Scope {
6868
for i := range s.Ss {
6969
s.Ss[i] = pushLimit(s.Ss[i], arg)
7070
}
71-
s.Ins[len(s.Ins)-1] = vm.Instruction{
72-
Op: vm.Limit,
73-
Arg: &vlimit.Argument{
74-
Limit: arg.Limit,
75-
},
76-
}
77-
} else {
78-
n := len(s.Ins) - 1
79-
s.Ins = append(s.Ins, vm.Instruction{
80-
Arg: arg,
81-
Op: vm.Limit,
82-
})
83-
s.Ins[n], s.Ins[n+1] = s.Ins[n+1], s.Ins[n]
8471
}
72+
n := len(s.Ins) - 1
73+
s.Ins = append(s.Ins, vm.Instruction{
74+
Arg: arg,
75+
Op: vm.Limit,
76+
})
77+
s.Ins[n], s.Ins[n+1] = s.Ins[n+1], s.Ins[n]
8578
return s
8679
}

0 commit comments

Comments
 (0)