supabase / wrappers

Postgres Foreign Data Wrapper development framework in Rust.
http://fdw.dev
Apache License 2.0
562 stars 56 forks source link

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

Closed burmecia closed 6 months ago

burmecia commented 6 months ago

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