File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Filter options
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)
140
140
integer, non-zero enables LOAD LOCAL INFILE; zero disables
141
141
142
142
autocommit
143
+ If False (default), autocommit is disabled.
143
144
If True, autocommit is enabled.
145
+ If None, autocommit isn't set and server default is used.
144
146
145
147
There are a number of undocumented, non-standard methods. See the
146
148
documentation for the MySQL C API for some hints on what they do.
@@ -227,9 +229,11 @@ def string_decoder(s):
227
229
self .encoders [types .StringType ] = string_literal
228
230
self .encoders [types .UnicodeType ] = unicode_literal
229
231
self ._transactional = self .server_capabilities & CLIENT .TRANSACTIONS
230
- if self ._transactional and not kwargs2 . pop ( 'autocommit' , False ) :
232
+ if self ._transactional :
231
233
# 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 ))
233
237
self .messages = []
234
238
235
239
def cursor (self , cursorclass = None ):
You can’t perform that action at this time.
0 commit comments