Microsoft SQL Server miscompilation for ROWS PRECEDING/FOLLOWING #11513
Unanswered
suhas-dc
asked this question in
Usage Questions
Replies: 2 comments 2 replies
-
if it's just the parameters that need to be stated literally, rather than as binds, that can be fixed without too much problem, I would need a runnable example to work with |
Beta Was this translation helpful? Give feedback.
2 replies
-
OK i got it, will make an issue |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On Microsoft SQL Server running a query with an OVER clause containing a row range fails. For example,
fails with
ProgrammingError: ('42000', "[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Incorrect syntax near '@P1'. (102) (SQLExecDirectW)")
.The sqlalchemy query object is compiled into some thing similar to
And, pyodbc does not seem to support bind parameters for PRECEDING and FOLLOWING since running the above query as textual SQL will also fail with the same error. Compiling the query with
literal_binds
True
substitutes the bind parameters giving a query pyodbc will run.EDIT: I faced this issue on sqlalchemy 1.4 but it seems to me that the issue may also exist on sqlalchemy 2.0 after looking through the
visit_over
definition.Beta Was this translation helpful? Give feedback.
All reactions