0

What does the bold text refer to? The "SELECT part acts like READ COMMITTED" part I already understand with this sql

SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION; -- snapshot 1 for this transaction is created
SELECT * FROM t1; -- result is 1 row, snapshot 1 is used

-- another transaction (different session) inserts and commits new row into t1 table

SELECT * FROM t1; -- result is still 1 row, because its REPEATABLE READ, still using snapshot 1
INSERT INTO t2 SELECT * FROM t1; -- this SELECT creates new snapshot 2
SELECT * FROM t2; -- result are 2 rows
SELECT * FROM t1; -- result is still 1 row, using snapshot 1

Here: https://dev.mysql.com/doc/refman/8.0/en/innodb-consistent-read.html

The type of read varies for selects in clauses like INSERT INTO ... SELECT, UPDATE ... (SELECT), and CREATE TABLE ... SELECT that do not specify FOR UPDATE or FOR SHARE:

By default, InnoDB uses stronger locks for those statements and the SELECT part acts like READ COMMITTED, where each consistent read, even within the same transaction, sets and reads its own fresh snapshot.

I do not understand THIS, what does a stronger block mean?

InnoDB uses stronger locks for those statements

This question helped me, but I still don't understand that part of the sentence.

Prevent INSERT INTO ... SELECT statement from creating its own fresh snapshot

0 Answers0