This is the
The idea with handler::store_lock() is the following:
The statement decided which locks we should need for the table for updates/deletes/inserts we get WRITE locks, for SELECT... we get read locks.
Before adding the lock into the table lock handler mysqld calls store lock with the requested locks. Store lock can modify the lock level, for example, change blocking write lock to non-blocking, ignore the lock (if we don't want to use MySQL table locks at all), or add locks for many tables (like we do when we are using a MERGE handler).
When releasing locks, store_lock() are also called. In this case one usually doesn't have to do anything.
If the argument of store_lock is TL_IGNORE, it means that MySQL requests the handler to store the same lock level as the last time.
Called from lock.cc by get_lock_data().