Skip to content
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

Using only offset instead of limit #7302

Open
Rankgice opened this issue Dec 5, 2024 · 0 comments
Open

Using only offset instead of limit #7302

Rankgice opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
type:question general questions

Comments

@Rankgice
Copy link

Rankgice commented Dec 5, 2024

Your Question

When I use offset but not limit, the SQL executed by Gorm only includes offset and not limit. Unfortunately, not all databases support using only offset without limit. In MySQL, limit and offset need to appear in pairs, and MySQL will report an error at this time. So I think this may be a problem, and I think setting the limit to "math. MaxInt" when the user only specifies offset can solve this problem.

The document you expected this should be explained

I want to know if this error was tacitly approved by the developer

Expected answer

If it is an unexpected bug for the developer, I can submit a PR.

@Rankgice Rankgice added the type:question general questions label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question general questions
Projects
None yet
Development

No branches or pull requests

2 participants