MySQL as of 5.5 has added metadata locks and the following behaviors:
- The concept of an open transaction is extended so that ANY select statement execution causes a transaction to “open”.
- The execution of a DDL statement on a table with an open transaction will wait forever (or until a SQL timeout occurs).
This behavior is not matched in other DBMS's like Oracle or MS SQL Server. I suspect that MySQL is the first DBMS ever to implement this behavior.
A transaction should not be opened until a "select ... for update" is done and/or an INSERT/UPDATE/DELETE operation is started.
The behavior causes existing applications to fail by hanging forever in ddl statements because a metadata lock was obtained by a simple select statement.
I think this is a bug.
- The concept of an open transaction is extended so that ANY select statement execution causes a transaction to “open”.
- The execution of a DDL statement on a table with an open transaction will wait forever (or until a SQL timeout occurs).
This behavior is not matched in other DBMS's like Oracle or MS SQL Server. I suspect that MySQL is the first DBMS ever to implement this behavior.
A transaction should not be opened until a "select ... for update" is done and/or an INSERT/UPDATE/DELETE operation is started.
The behavior causes existing applications to fail by hanging forever in ddl statements because a metadata lock was obtained by a simple select statement.
I think this is a bug.