Code

Ticket #1412: ado_mssql.diff

File ado_mssql.diff, 907 bytes (added by kent37@…, 8 years ago)

Patch

Line 
1Index: django/core/db/backends/ado_mssql.py
2===================================================================
3--- django/core/db/backends/ado_mssql.py        (revision 2415)
4+++ django/core/db/backends/ado_mssql.py        (working copy)
5@@ -27,7 +27,11 @@
6 class Connection(Database.Connection):
7     def cursor(self):
8         return Cursor(self)
9+
10+# Patch adodbapi to use our connection. It's patched two places because
11+# adodbapi.__init__ promotes adodbapi.adodbapi.Connection to package scope
12 Database.Connection = Connection
13+Database.adodbapi.Connection = Connection
14 
15 origCVtoP = Database.convertVariantToPython
16 def variantToPython(variant, adType):
17@@ -43,6 +47,7 @@
18         return int(res) # If float but int, then int.
19     return res
20 Database.convertVariantToPython = variantToPython
21+Database.adodbapi.convertVariantToPython = variantToPython
22 
23 class DatabaseWrapper:
24     def __init__(self):