summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/mysql/base.py')
-rw-r--r--django/db/backends/mysql/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index 87401f2da9..ea04a5ec87 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -457,7 +457,8 @@ class DatabaseWrapper(BaseDatabaseWrapper):
pass
def _set_autocommit(self, autocommit):
- self.connection.autocommit(autocommit)
+ with self.wrap_database_errors:
+ self.connection.autocommit(autocommit)
def disable_constraint_checking(self):
"""