mysql事务不加锁一致性读:当事务隔离级别为可重复读时,事务A进行查询,事务B进行改、删除、插入时,进行查询的事务A不受事务B的影响,仍然为原始数据库中的数据,即使事务A内对数据做了更改会提交,事务A查询到的仍然为事务开始之前数据库中的数据;当事务隔离级别为读提交时,事务A会读取事务A内的最新提交的数据,如果事务B对事务有更改或提交新数据,不会影响事务A的查询数据。
mysql说明文档:
With READ COMMITTED isolation level, each consistent read within a transaction sets and reads its own fresh snapshot.
Consistent read is the default mode in which InnoDB processesSELECT statements in READ COMMITTED and REPEATABLE READ isolation levels. A consistent read does not set any locks on the tables it accesses, and therefore other sessions are free to modify those tables at the same time a consistent read is being performed on the table.
Suppose that you are running in the default REPEATABLE READ isolation level. When you issue a consistent read (that is, an ordinarySELECT statement), InnoDB gives your transaction a timepoint accord