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

fix(mssql): incorrect sql deparse for limit and offset clause #267

Merged
merged 2 commits into from
May 20, 2024

Conversation

burmecia
Copy link
Member

What kind of change does this PR introduce?

This PR is to fix #262 , which is caused by incorrect translation from PG sql dialect to T-SQL syntax when using LIMIT..OFFSET clause.

What is the current behavior?

The SQL with LIMIT..OFFSET clause will be deparsed to offset 0 rows fetch next .. rows only, but it needs ORDER BY clause to be presented in T-SQL while it is not necessary in Postgres.

What is the new behavior?

An error will happen when LIMIT..OFFSET clause is not with an ORDER BY clause.

Additional context

N/A

@burmecia burmecia added bug Something isn't working mssql SQL Server related issues labels May 18, 2024
@burmecia burmecia requested a review from imor May 18, 2024 04:03
@burmecia burmecia merged commit cbcf27b into main May 20, 2024
2 checks passed
@burmecia burmecia deleted the bo/fix/mssql-limit-offset branch May 20, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mssql SQL Server related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL Server Wrapper HV000: Token error: 'Incorrect syntax near 'offset'
2 participants