Skip to content

Commit

Permalink
Finish addition of TDS protver 7.3 ID support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiro committed Aug 27, 2016
1 parent 215088b commit 0079360
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions ChangeLog
Expand Up @@ -21,8 +21,7 @@ General
* A ``freetds.conf`` file (see FreeTDS documentation)

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

Features
--------
Expand Down
6 changes: 6 additions & 0 deletions docs/ref/_mssql.rst
Expand Up @@ -134,6 +134,12 @@ Functions
to set the TDS protocol version to ask for when connecting to the server
but version 7.1 was used if not specified.

.. warning::
FreeTDS added sopport for TDS protocol version 7.3 in version 0.95. You
need to be careful of not asking for TDS 7.3 if you know the undelying
FreeTDS used by pymssql is version 0.91 as it won't raise any error nor
keep you from passing such an invalid value.

``MSSQLConnection`` object properties
-------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions docs/ref/pymssql.rst
Expand Up @@ -116,6 +116,12 @@ Functions
version, and in version 2.1.2 it was possible to set it but version 7.1 was
used if not specified.

.. warning::
FreeTDS added sopport for TDS protocol version 7.3 in version 0.95. You
need to be careful of not asking for TDS 7.3 if you know the undelying
FreeTDS used by pymssql is version 0.91 as it won't raise any error nor
keep you from passing such an invalid value.

.. function:: get_dbversion()

TBD
Expand Down
5 changes: 5 additions & 0 deletions src/_mssql.pyx
Expand Up @@ -31,6 +31,9 @@ DEF MSSQLDB_MSGSIZE = 1024
DEF PYMSSQL_MSGSIZE = (MSSQLDB_MSGSIZE * 8)
DEF EXCOMM = 9

# Provide constant missing from FreeTDS 0.91 so that we can build against it
DEF DBVERSION_73 = 7

ROW_FORMAT_TUPLE = 1
ROW_FORMAT_DICT = 2

Expand Down Expand Up @@ -1722,6 +1725,8 @@ cdef int _tds_ver_str_to_constant(verstr) except -1:
return DBVERSION_71
if verstr == u'7.2':
return DBVERSION_72
if verstr == u'7.3':
return DBVERSION_73
raise MSSQLException('unrecognized tds version: %s' % verstr)

#######################
Expand Down

0 comments on commit 0079360

Please sign in to comment.