You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This CI run fails every once in a while in the same way. Not sure what's happening but it would be nice if we could track down the flakiness at some point.
The text was updated successfully, but these errors were encountered:
… performed (#9658)
This PR attempts to address flaky behavior of MS SQL observed in CI.
It seems like calling `commit()`/`rollback()` with a `SELECT` statement,
AKA autocommit behavior
can cause this issue.
The origin is not 100% clear to me, but there are a number of places
where the
same problem (function sequence error) with the same solution show up
(disabling autocommit or not calling commit with a `SELECT` statement):
-
https://stackoverflow.com/questions/25769043/function-sequence-error-in-pyodbc
- ansible-collections/community.general#1137
-
https://www.reddit.com/r/learnpython/comments/x8568m/function_sequence_error_in_sqlalchemy/
- explorerhq/sql-explorer#423
Here I avoid calling `cur.commit()` unless a DDL statement is being
executed.
The remaining case is `raw_sql()`, which I opted to avoid calling
`commit` in
since that would have this problem when calling it with a `SELECT`
statement.
Users of `raw_sql` are therefore responsible for handling
commit/rollback when
invoking it for DDL statements.
Closes#9654.
This CI run fails every once in a while in the same way. Not sure what's happening but it would be nice if we could track down the flakiness at some point.
The text was updated successfully, but these errors were encountered: