pymssql 1.0.2: No result rows are returned from queries with newer versions of FreeTDS #137

Closed
msabramo opened this Issue Oct 11, 2013 · 1 comment

Projects

None yet

1 participant

@msabramo
Member

With pymssql 1.0.2 and a newish version of FreeTDS (e.g.: 0.91), SELECT queries will return no rows.

# test_debug_queries.py

import os
import _mssql

server = os.getenv("PYMSSQL_TEST_SERVER")
user = os.getenv("PYMSSQL_TEST_USERNAME")
password = os.getenv("PYMSSQL_TEST_PASSWORD")
database = os.getenv("PYMSSQL_TEST_DATABASE")

conn = _mssql.connect(
    server=server,
    user=user,
    password=password,
    database=database,
)
conn.debug_queries = True
conn.execute_query("SELECT @@version AS version")
for row in conn:
    print(row['version'])
(py26.venv)marca@marca-mac:~/dev/git-repos/pymssql$ python test_debug_queries.py
#SELECT @@version AS version#
(py26.venv)marca@marca-mac:~/dev/git-repos/pymssql$ tsql -C | grep Version
                            Version: freetds v0.91
@msabramo msabramo was assigned Oct 11, 2013
@msabramo
Member

Fixed by 5033df5

(py26.venv)marca@marca-mac:~/dev/git-repos/pymssql$ python test_debug_queries.py
#SELECT @@version AS version#
Microsoft SQL Server 2012 - 11.0.2100.60 (X64)
    Feb 10 2012 19:39:15
    Copyright (c) Microsoft Corporation
    Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

I am planning to release a pymssql 1.0.3 with this fix.

@msabramo msabramo closed this Oct 11, 2013
@msabramo msabramo added a commit that referenced this issue Jan 15, 2014
@msabramo msabramo faq.rst: Add section: no rows with new FreeTDS
Describes this issue: #137

And how upgrading to pymssql 2.x or 1.0.3 fixes the problem.
a5cae13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment