In MYSQL 5.6 you have the table t1:
CREATE TABLE t1 (
id int unsigned NOT NULL PRIMARY key) ENGINE = InnoDB;
There are two connections to the server. They execute in this order:
Connection 1> SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
Connection 1> START TRANSACTION;
Connection 1> SELECT * FROM t1 WHERE id =1;
Connection 2> TRUNCATE TABLE t1;
What happens to the TRUNCATE TABLE command in connection 2?
A.
It immediately proceeds and causes an implicit commit of the transaction in connection1.
B.
It runs concurrently with the transaction in connection 1 as each connection has its own
view of the data in the t1 table.
C.
It blocks waiting for a metadata lock until the transaction in connection 1 ends.
D.
It blocks waiting for a table lock until the transaction in connection 1 ends.
C
C
https://dev.mysql.com/doc/refman/5.6/en/metadata-locking.html
To ensure transaction serializability, the server must not permit one session to perform a data definition language (DDL) statement on a table that is used in an uncompleted explicitly or implicitly started transaction in another session.
C
C