Skip to content

Commit a8bc82c

Browse files
authored
Merge pull request pymssql#451 from pymssql/actually-accept-tds-73
Finish addition of TDS protver 7.3 ID support.
2 parents 215088b + 0079360 commit a8bc82c

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

ChangeLog

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ General
2121
* A ``freetds.conf`` file (see FreeTDS documentation)
2222

2323
- Drop support for versions of FreeTDS older than 0.91.
24-
- Add support for reporting TDS version 7.3 is in use via the ``tds_version``
25-
property of a ``_mssql``-level connection.
24+
- Accept 7.3 as TDS protocol version when establishing a connection.
2625

2726
Features
2827
--------

docs/ref/_mssql.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ Functions
134134
to set the TDS protocol version to ask for when connecting to the server
135135
but version 7.1 was used if not specified.
136136

137+
.. warning::
138+
FreeTDS added sopport for TDS protocol version 7.3 in version 0.95. You
139+
need to be careful of not asking for TDS 7.3 if you know the undelying
140+
FreeTDS used by pymssql is version 0.91 as it won't raise any error nor
141+
keep you from passing such an invalid value.
142+
137143
``MSSQLConnection`` object properties
138144
-------------------------------------
139145

docs/ref/pymssql.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ Functions
116116
version, and in version 2.1.2 it was possible to set it but version 7.1 was
117117
used if not specified.
118118

119+
.. warning::
120+
FreeTDS added sopport for TDS protocol version 7.3 in version 0.95. You
121+
need to be careful of not asking for TDS 7.3 if you know the undelying
122+
FreeTDS used by pymssql is version 0.91 as it won't raise any error nor
123+
keep you from passing such an invalid value.
124+
119125
.. function:: get_dbversion()
120126

121127
TBD

src/_mssql.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ DEF MSSQLDB_MSGSIZE = 1024
3131
DEF PYMSSQL_MSGSIZE = (MSSQLDB_MSGSIZE * 8)
3232
DEF EXCOMM = 9
3333

34+
# Provide constant missing from FreeTDS 0.91 so that we can build against it
35+
DEF DBVERSION_73 = 7
36+
3437
ROW_FORMAT_TUPLE = 1
3538
ROW_FORMAT_DICT = 2
3639

@@ -1722,6 +1725,8 @@ cdef int _tds_ver_str_to_constant(verstr) except -1:
17221725
return DBVERSION_71
17231726
if verstr == u'7.2':
17241727
return DBVERSION_72
1728+
if verstr == u'7.3':
1729+
return DBVERSION_73
17251730
raise MSSQLException('unrecognized tds version: %s' % verstr)
17261731

17271732
#######################

0 commit comments

Comments
 (0)