MySQL supports table-level locking of tables in the MyISAM and memory storage engines, and row-set locking of tables in the InnoDB storage engine. It is automatically obtained by default.
The lock TABLES can be used to lock the table obtained by the current thread, and if the table is locked by another thread, the current thread waits until the existing lock can be acquired.
UNLOCK TABLES can release any locks that the current thread obtains, when the current thread executes another lock TABLES, or when the connection to the server is closed, all tables locked by the current thread are implicitly unlocked.
The start transaction can open a transaction and commit to Autocommit mode, and commit and chain commit the transaction and open a new transaction at the same isolation level.
V. Opening a new transaction using the start Transaction command during the table will cause an implicit unlock tables to be executed.
Vi. in the same transaction, do not use tables of different storage engines, especially tables that do not support transactions. Typically, only committed transactions are logged to the binary log, but if a transaction contains a non-transactional type of table, the rollback operation is also logged to the binary log to ensure that updates to non-transaction-type tables can be replicated to the database.
VII. All DDL statements cannot be rolled back, and some DDL statements cause implicit commits.
MySQL things control and lock statements