summaryrefslogtreecommitdiff
path: root/MySQLdb
diff options
context:
space:
mode:
Diffstat (limited to 'MySQLdb')
-rw-r--r--MySQLdb/connections.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py
index 6bc1613..aeac731 100644
--- a/MySQLdb/connections.py
+++ b/MySQLdb/connections.py
@@ -139,6 +139,9 @@ class Connection(_mysql.connection):
local_infile
integer, non-zero enables LOAD LOCAL INFILE; zero disables
+ autocommit
+ If True, autocommit is enabled.
+
There are a number of undocumented, non-standard methods. See the
documentation for the MySQL C API for some hints on what they do.
@@ -224,7 +227,7 @@ class Connection(_mysql.connection):
self.encoders[types.StringType] = string_literal
self.encoders[types.UnicodeType] = unicode_literal
self._transactional = self.server_capabilities & CLIENT.TRANSACTIONS
- if self._transactional:
+ if self._transactional and not kwargs2.pop('autocommit', False):
# PEP-249 requires autocommit to be initially off
self.autocommit(False)
self.messages = []