Commits

shaib  committed ba06f6d Merge

Merge SqlServer, Oracle and Django 1.2 fixes with MySql-for-Django-1.3 fixes

  • Participants
  • Parent commits b0c7189, 126a1ad

Comments (0)

Files changed (1)

File south/db/generic.py

 
     @cached_property
     def has_ddl_transactions(self):
+        "Tests the database using feature detection to see if it has DDL transactional support"
         self._possibly_initialise()
         connection = self._get_connection()
+        # Django 1.3's MySQLdb backend doesn't raise DatabaseError
+        exceptions = (DatabaseError, )
+        try:
+            from MySQLdb import OperationalError
+            exceptions += (OperationalError, )
+        except ImportError:
+            pass
+        # Now do the test
         if getattr(connection.features, 'supports_transactions', True):
             cursor = connection.cursor()
             self.start_transaction()
             self.rollback_transaction()
             try:
                 cursor.execute('CREATE TABLE DDL_TRANSACTION_TEST (X INT)')
-            except DatabaseError:
+            except exceptions:
                 return False
             else:
                 return True