Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changed MySQL backend so that it fails silently if rollback() isn't s…

…upported (the code catches NotSupportedError exception)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@459 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 024e68e260a70281d6f07e3a562e24140d3ecc2f 1 parent 0660203
Adrian Holovaty adrianholovaty authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/core/db/backends/mysql.py
6 django/core/db/backends/mysql.py
View
@@ -9,6 +9,7 @@
import MySQLdb as Database
from MySQLdb.converters import conversions
from MySQLdb.constants import FIELD_TYPE
+from _mysql_exceptions import NotSupportedError
import types
DatabaseError = Database.DatabaseError
@@ -40,7 +41,10 @@ def commit(self):
def rollback(self):
if self.connection:
- self.connection.rollback()
+ try:
+ self.connection.rollback()
+ except NotSupportedError:
+ pass
def close(self):
if self.connection is not None:
Please sign in to comment.
Something went wrong with that request. Please try again.