File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,9 @@ class object, used to create cursors (keyword only)
140140 integer, non-zero enables LOAD LOCAL INFILE; zero disables
141141
142142 autocommit
143+ If False (default), autocommit is disabled.
143144 If True, autocommit is enabled.
145+ If None, autocommit isn't set and server default is used.
144146
145147 There are a number of undocumented, non-standard methods. See the
146148 documentation for the MySQL C API for some hints on what they do.
@@ -227,9 +229,11 @@ def string_decoder(s):
227229 self .encoders [types .StringType ] = string_literal
228230 self .encoders [types .UnicodeType ] = unicode_literal
229231 self ._transactional = self .server_capabilities & CLIENT .TRANSACTIONS
230- if self ._transactional and not kwargs2 . pop ( 'autocommit' , False ) :
232+ if self ._transactional :
231233 # PEP-249 requires autocommit to be initially off
232- self .autocommit (False )
234+ autocommit = kwargs2 .pop ('autocommit' , False )
235+ if autocommit is not None :
236+ self .autocommit (bool (True ))
233237 self .messages = []
234238
235239 def cursor (self , cursorclass = None ):
You can’t perform that action at this time.
0 commit comments