File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -651,6 +651,13 @@ def parseTargetDirect():
651651 if dbmsName == "Microsoft SQL Server" :
652652 import _mssql
653653 import pymssql
654+
655+ if not hasattr (pymssql , "__version__" ) or pymssql .__version__ < "1.0.2" :
656+ errMsg = "pymssql library on your system must be "
657+ errMsg += "version 1.0.2 to work, get it from "
658+ errMsg += "http://sourceforge.net/projects/pymssql/files/pymssql/1.0.2/"
659+ raise sqlmapMissingDependence , errMsg
660+
654661 elif dbmsName == "MySQL" :
655662 import MySQLdb
656663 elif dbmsName == "PostgreSQL" :
Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ class Connector(GenericConnector):
4343 License: LGPL
4444
4545 Possible connectors: http://wiki.python.org/moin/SQL%20Server
46+
47+ Important note: pymssql library on your system MUST be version 1.0.2
48+ to work, get it from http://sourceforge.net/projects/pymssql/files/pymssql/1.0.2/
4649 """
4750
4851 def __init__ (self ):
@@ -79,6 +82,10 @@ def execute(self, query):
7982 def select (self , query ):
8083 self .execute (query )
8184 value = self .fetchall ()
82- self .connector .commit ()
85+
86+ try :
87+ self .connector .commit ()
88+ except pymssql .OperationalError :
89+ pass
8390
8491 return value
You can’t perform that action at this time.
0 commit comments