]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Disable MSSQL unicode statements on UCS-4 platforms, ticket #731
authorPaul Johnston <paj@pajhome.org.uk>
Fri, 17 Aug 2007 15:10:46 +0000 (15:10 +0000)
committerPaul Johnston <paj@pajhome.org.uk>
Fri, 17 Aug 2007 15:10:46 +0000 (15:10 +0000)
lib/sqlalchemy/databases/mssql.py

index 97343d6c843a0a1a934cb1a9f6b0cb585c65ab11..bef3eb54190124d059ffb31127ef5ba0b413fc31 100644 (file)
@@ -44,7 +44,7 @@ import datetime, random, warnings, re
 from sqlalchemy import sql, schema, ansisql, exceptions
 import sqlalchemy.types as sqltypes
 from sqlalchemy.engine import default
-import operator
+import operator, sys
     
 class MSNumeric(sqltypes.Numeric):
     def result_processor(self, dialect):
@@ -767,7 +767,7 @@ class MSSQLDialect_pyodbc(MSSQLDialect):
 
     def supports_unicode_statements(self):
         """indicate whether the DBAPI can receive SQL statements as Python unicode strings"""
-        return True
+        return sys.maxunicode == 65535
 
     def make_connect_string(self, keys):
         connectors = ["Driver={SQL Server}"]