diff options
author | davi@moksha.local <> | 2007-10-09 12:02:59 -0300 |
---|---|---|
committer | davi@moksha.local <> | 2007-10-09 12:02:59 -0300 |
commit | 7252cbe1e0e48c8497fac35c99b113294095217e (patch) | |
tree | 0835f378696cf849d94b0cd5caf70249743eba5e /sql/sp_head.h | |
parent | a8f2ba0f80b13c3d45b4f500f10391dd84439da0 (diff) | |
download | mariadb-git-7252cbe1e0e48c8497fac35c99b113294095217e.tar.gz |
Bug#31409 RENAME TABLE causes server crash or deadlock when used with HANDLER statements
This deadlock occurs when a client issues a HANDLER ... OPEN statement
that tries to open a table that has a pending name-lock on it by another
client that also needs a name-lock on some other table which is already
open and associated to a HANDLER instance owned by the first client.
The deadlock happens because the open_table() function will back-off
and wait until the name-lock goes away, causing a circular wait if some
other name-lock is also pending for one of the open HANDLER tables.
Such situation, for example, can be easily repeated by issuing a RENAME
TABLE command in such a way that the existing table is already open
as a HANDLER table by another client and this client tries to open
a HANDLER to the new table name.
The solution is to allow handler tables with older versions (marked for
flush) to be closed before waiting for the name-lock completion. This is
safe because no other name-lock can be issued between the flush and the
check for pending name-locks.
The test case for this bug is going to be committed into 5.1 because it
requires a test feature only avaiable in 5.1 (wait_condition).
Diffstat (limited to 'sql/sp_head.h')
0 files changed, 0 insertions, 0 deletions