--- /dev/null
+.. change::
+ :tags: mssql, bug
+ :tickets: 4057
+
+ Fixed the pymssql dialect so that percent signs in SQL text, such
+ as used in modulus expressions or literal textual values, are
+ **not** doubled up, as seems to be what pymssql expects. This is
+ despite the fact that the pymssql DBAPI uses the "pyformat" parameter
+ style which itself considers the percent sign to be significant.
Linux, MacOSX and Windows platforms.
"""
-from .base import MSDialect
+from .base import MSDialect, MSIdentifierPreparer
from ... import types as sqltypes, util, processors
import re
return sqltypes.Numeric.result_processor(self, dialect, type_)
+class MSIdentifierPreparer_pymssql(MSIdentifierPreparer):
+
+ def __init__(self, dialect):
+ super(MSIdentifierPreparer_pymssql, self).__init__(dialect)
+ # pymssql has the very unusual behavior that it uses pyformat
+ # yet does not require that percent signs be doubled
+ self._double_percents = False
+
+
class MSDialect_pymssql(MSDialect):
supports_sane_rowcount = False
driver = 'pymssql'
+ preparer = MSIdentifierPreparer_pymssql
+
colspecs = util.update_copy(
MSDialect.colspecs,
{