MySQL Forums
Forum List  »  General

Bug with autocommit=0 and SET TRANSACTION?
Posted by: Johnny The Frog
Date: July 12, 2014 02:19AM

I am currently reading up about MySQL locking and transaction isolation levels and doing some very basic tests in this field to get a full understanding about how it all works. Using MySQL 5.5 and the InnoDB engine, I have found the following problem:

Citing from section 14.5.2 of the manual: "If autocommit mode is disabled within a session with SET autocommit = 0, the session always has a transaction open."; citing from section 13.3.6 of the manual: "SET TRANSACTION ISOLATION LEVEL without GLOBAL or SESSION is not permitted while there is an active transaction:".

Thus, the following should NOT work:

mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)

mysql> set transaction isolation level serializable;
Query OK, 0 rows affected (0.01 sec)

But it DOES work. This is probably a bug because (according to the manual) an unfinished transaction is active as soon as you disable autocommit, but the second statement should fail if a transaction is active.

Unfortunately, I don't have the means to test this for 5.6 or 5.7.

I would be very interested into thorough explanations.

Thank you very much in advance for your time and effort,

JohnnyTheFrog

Options: ReplyQuote


Subject
Written By
Posted
Bug with autocommit=0 and SET TRANSACTION?
July 12, 2014 02:19AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.