| Bug #70545 | Missing support for read-only transactions | ||
|---|---|---|---|
| Submitted: | 7 Oct 2013 20:13 | Modified: | 14 Jan 2014 16:26 |
| Reporter: | Mats Kindahl | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | Connector / Python | Severity: | S3 (Non-critical) |
| Version: | OS: | Any | |
| Assigned to: | CPU Architecture: | Any | |
[8 Oct 2013 9:22]
MySQL Verification Team
Hello Mats, Thank you for the bug report/feature request!. Verified as described. Thanks, Umesh
[14 Jan 2014 16:26]
Paul DuBois
Noted in 1.1.5 changelog. The start_transaction() method now supports a readonly argument. This argument can be True to start the transaction in READ ONLY mode or False to start it in READ WRITE mode. If readonly is omitted, the server's default access mode is used. For details about transaction access mode, see the description for the START TRANSACTION statement. If the server is older than MySQL 5.6.5, it does not support setting the access mode and Connector/Python raises a ValueError.

Description: With MySQL 5.6, support for read-only transactions were added so that a read-only transaction can be started with: START TRANSACTION READ ONLY ... COMMIT; In Connector/Python 1.1.0, the start_transaction() function was added, and it has support for consistent snapshot as well as setting the isolation level, but not for setting a transaction as read-only. How to repeat: Read the code for start_transaction(), or the documentation at http://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-start-tr... Suggested fix: Add support for READ ONLY (and READ WRITE).