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
offset and limit working unexpectedly, resulting limit 0 in compiled SQL #6188
Comments
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
Yes, case mentioned by this issue (#5735 (comment) ) is :
When I execute I can try to make a pr to fix it. |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
|
|
Thanks for attaching the related issue. Do you mean that you will try to solve the difference between |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
Environment
Problem
We've been using gorm in our production environment. Recently, I noticed a bad case when setting
limit(0)
.limit 0
limit 0
to the compiled SQL if we set the query condition todb.Offset(0).Limit(0)
Below are some cases I use to explain to problem.
Which change caused the problem
This commit changed the behavior in
clause/limit.go
, resulting in the problem.Possible solution
Since I'm not familiar with the design priciples of gorm, I decide to report an issue instead of submitting a pull request.
I believe the expected behavior of
offset
andlimit
would be:To conclude:
The text was updated successfully, but these errors were encountered: