Bug #71931 Better explanation for start_transaction options
Submitted: 5 Mar 2014 8:29 Modified: 10 Mar 2014 16:25
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / Python Documentation Severity:S3 (Non-critical)
Version:1.0.10 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any

[5 Mar 2014 8:29] Daniël van Eeden
Description:
Page: https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-start-t...

"The default consistent_snapshot value is False."
I guess setting this to true will cause Connector/Python to use "WITH CONSISTENT SNAPSHOT" for the "START TRANSACTION" statement? 
According to https://dev.mysql.com/doc/refman/5.6/en/commit.html this is only valid for REPEATABLE_READ
Maybe link to: https://dev.mysql.com/doc/refman/5.6/en/glossary.html#glos_consistent_read

"The default isolation_level value is None, and permitted values are 'READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', and 'SERIALIZABLE'."
As None is not a valid isolation level for MySQL I guess this will cause Connector/Python to not sent the "SET TRANSACTION ISOLATION LEVEL" statement and will thus cause the default isolation level of the server to be applied?
  

How to repeat:
See description
[5 Mar 2014 9:13] MySQL Verification Team
Hello Daniel,

Thank you for the bug report.

Thanks,
Umesh
[10 Mar 2014 12:28] Geert Vanderkelen
Posted by developer:
 
1. Yes, if consistent_snapshot is True, we will sent WITH CONSISTENT SNAPSHOT anyway. Since MySQL ignores it when not supported, there should be no issue.

2. If isolation_level is None, no isolation level will be set, meaning the default will be used.
[10 Mar 2014 16:25] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.

Updated docs:

The default consistent_snapshot value is False. If the value is True,
Connector/Python sends WITH CONSISTENT SNAPSHOT with the statement.
MySQL ignores this for isolation levels for which that option does
not apply. 

The default isolation_level value is None, and permitted values are
'READ UNCOMMITTED', 'READ COMMITTED', 'REPEATABLE READ', and 
'SERIALIZABLE'. If the isolation_level value is None, no isolation
level is sent, so the default level applies.