-
Notifications
You must be signed in to change notification settings - Fork 131
fix oracle limit bug #222
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
fix oracle limit bug #222
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in Oracle's LIMIT clause generation by removing an incorrect "+ 1" offset calculation. The fix ensures that when using LIMIT without OFFSET in Oracle queries, the upper bound of the BETWEEN clause is correctly set to the limit value itself, rather than limit + 1, which would return one extra row.
- Corrected Oracle SQL LIMIT clause to use
BETWEEN 1 AND :1instead ofBETWEEN 1 AND :1 + 1
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| select.go | Removed the erroneous "+ 1" addition to the limit variable in Oracle's LIMIT-only query generation |
| select_test.go | Updated test comment to reflect the corrected Oracle query output |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Can this PR be merged? |
|
@zhangyongding I checked Oracle document. It seems that there is a new syntax since Oracle 12.1. |
|
I think it's possible, but it's not compatible with versions before Oracle 12 |
|
@zhangyongding Is it worthy to supporting old Oracle? The 12.1 released in 2013. It seems quite a long time ago. What do you think? |
|
I think there should be no users using the old Oracle now |
|
Can we merge this PR first, then change it to the new syntax? |
|
What are the next steps? |
|
Sorry for the delay.
Yes. |
|
Released in v1.38.1. |
No description provided.