Skip to content

Conversation

@zhangyongding
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

coverage: 96.975% (-0.001%) from 96.976%
when pulling 81eb13e on zhangyongding:fix-oralce-limit
into 87617c3 on huandu:master.

@huandu huandu requested a review from Copilot October 20, 2025 11:40
Copy link

Copilot AI left a 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 :1 instead of BETWEEN 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.

@zhangyongding
Copy link
Contributor Author

Can this PR be merged?

@huandu
Copy link
Owner

huandu commented Oct 22, 2025

@zhangyongding I checked Oracle document. It seems that there is a new syntax since Oracle 12.1. SELECT ... OFFSET [offset] ROWS FETCH NEXT {rows} ROWS ONLY. Can we update the code to use the new syntax to replace current implementation? What do you think?

@huandu huandu added the bug label Oct 22, 2025
@zhangyongding
Copy link
Contributor Author

I think it's possible, but it's not compatible with versions before Oracle 12

@huandu
Copy link
Owner

huandu commented Oct 22, 2025

@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?

@zhangyongding
Copy link
Contributor Author

I think there should be no users using the old Oracle now

@zhangyongding
Copy link
Contributor Author

Can we merge this PR first, then change it to the new syntax?

@zhangyongding
Copy link
Contributor Author

What are the next steps?

@huandu huandu merged commit e4f129e into huandu:master Oct 24, 2025
2 checks passed
@huandu
Copy link
Owner

huandu commented Oct 24, 2025

Sorry for the delay.

Can we merge this PR first, then change it to the new syntax?

Yes.

@huandu
Copy link
Owner

huandu commented Oct 24, 2025

Released in v1.38.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants