According to the MySQL documentation, if any session holds a Read lock for a table, then another session requests a Write lock for the same table, the Write lock must be given and the Read lock waits.
I tried it, connected to the MySQL server from two consoles (Windows 7). Locked the table A from the first console (read lock), then tried to lock the same table from the second console (write lock), but the second console just waits till the first lock releases.
Who is wrong: me or the documentation? (MySQL Server version 5.5.27)
The citation from the MySQL official documentation:
"WRITE locks normally have higher priority than READ locks to ensure that updates are processed as soon as possible. This means that if one session obtains a READ lock and then another session requests a WRITE lock, subsequent READ lock requests wait until the session that requested the WRITE lock has obtained the lock and released it."