-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
selectOne方法被加limit分页 #6260
Comments
看看日志 |
你用了pagehelper吧 |
估计是上一次查询的时候用了pagehelper,然后某种原因(比如在查sql前报错、if else中遗漏了一些情况)导致没有办法清空pagehelper的threadlocal,后续调用其他接口时刚好是原来的线程在执行,然后就被加了limit 10 |
补充一点:调用了pagehelper.startPage方法后必须对数据库进行一次操作或者手动调用clear方法才能清空threadlocal |
明白你的意思了,有可能是复用了其他带着分页信息的线程 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
baseMapper.selectOne(new QueryWrapper().lambda()
.eq(xxxx)
.eq(xxxx)
.last("LIMIT 1"));
就是简单的controller请求进来查询了这一次
报错后提示语句异常,发现打印出的语句LIMIT 1后面又加了limit 10,偶发了 一次,没再复现,想问一下,什么情况下会出现这种异常?
The text was updated successfully, but these errors were encountered: