fix(mssql): avoid trying to return a resultset for DML queries with not resultset (#24999)

This commit is contained in:
Yuval Moshe
2023-08-21 14:33:26 +03:00
committed by GitHub
parent 357986103b
commit 66eabc253f
2 changed files with 12 additions and 1 deletions

View File

@@ -141,6 +141,8 @@ class MssqlEngineSpec(BaseEngineSpec):
def fetch_data(
cls, cursor: Any, limit: Optional[int] = None
) -> list[tuple[Any, ...]]:
if not cursor.description:
return []
data = super().fetch_data(cursor, limit)
# Lists of `pyodbc.Row` need to be unpacked further
return cls.pyodbc_rows_to_tuples(data)