Server Version:5.6.21-log MySQL Community Server (GPL)
Prerequisite Summary:
We know that under MySQL's RR (repeatable Read) isolation level, transactions cannot see the actions that are being made by the active firm, including post-commit.
The General command to open a transaction manually is begin or start transaction; My previous understanding is that once the execution of this statement has opened the transaction, that is, the transaction ID has been generated (available for the MVCC version comparison), and transaction A and transaction B perform the Begin, Commit TRANSACTION B for all operations of transaction A is not visible;
The facts are negative;
Environment:
Mysql>Show variables like 'tx_iso%';+---------------+-----------------+|Variable_name|Value|+---------------+-----------------+|Tx_isolation| Repeatable-READ |+---------------+-----------------+1Rowinch Set(0.00sec) MySQL>Show variables like 'auto%';+--------------------------+-------+|Variable_name|Value|+--------------------------+-------+|Auto_increment_increment| 1 ||Auto_increment_offset| 1 ||Autocommit| on ||Automatic_sp_privileges| on |+--------------------------+-------+4Rowsinch Set(0.00sec) MySQL>ShowCreate TableT12;+-------+----------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -------------+| Table | Create Table |+-------+----------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- -------------+|T12| CREATE TABLE' T12 ' (' A 'int(Ten) unsigned not NULLauto_increment, ' B 'varchar(766)DEFAULT NULL, ' C 'int( One)DEFAULT NULL, PRIMARY KEY(' A '),KEY' B ' (' B ')) ENGINE=InnoDB auto_increment= - DEFAULTCHARSET=Latin1|+-------+---------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------- --------------+1Rowinch Set(0.00Sec
The experimental result is that transaction B sees the data submitted by transaction A in the case of uncommitted and rollback;
Once a begin, the transaction is opened immediately following the SELECT statement, or the data submitted by transaction A is not visible at start transaction with consistent snapshot;
That is to achieve the non-locking consistent read;
Conclusion: Begin;start transaction; The statement actually does not really open the transaction;
Original Does MySQL's quest for begin or start transaction really open new business?