Commit graph

3 commits

Author SHA1 Message Date
Konstantin Osipov
1b34d593b5 Backport of:
------------------------------------------------------------
revno: 2476.784.3
committer: davi@moksha.local
timestamp: Tue 2007-10-02 21:27:31 -0300
message:
Bug#25858 Some DROP TABLE under LOCK TABLES can cause deadlocks
        
When a client (connection) holds a lock on a table and attempts to
drop (obtain a exclusive lock) on a second table that is already
held by a second client and the second client then attempts to
drop the table that is held by the first client, leads to a
circular wait deadlock. This scenario is very similar to trying to
drop (or rename) a table while holding read locks and are
correctly forbidden.
        
The solution is to allow a drop table operation to continue only
if the table being dropped is write (exclusively) locked, or if
the table is temporary, or if the client is not holding any
locks. Using this scheme prevents the creation of a circular
chain in which each client is waiting for one table that the
next client in the chain is holding.
            
This is incompatible change, as can be seen by number of tests
cases that needed to be fixed, but is consistent with respect to
behavior of the different scenarios in which the circular wait
might happen.

mysql-test/r/drop.result:
  Test case result for Bug#25858
mysql-test/r/group_by.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/insert_notembedded.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table
mysql-test/r/lock.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/lock_multi.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/myisam.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/r/view.result:
  Fix test case result wrt drop table under lock tables -- unlock tables
  before dropping table.
mysql-test/t/drop.test:
  Add test case for Bug#25858
mysql-test/t/group_by.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/insert_notembedded.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/lock.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/lock_multi.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/myisam.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/query_cache_notembedded.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
mysql-test/t/view.test:
  Fix test case: unlock tables in preparation for a drop table. In some
  circumstances, dropping tables while holding locks leads to a deadlock.
sql/lock.cc:
  When trying to obtain a name lock under lock tables, ensure that the table is properly exclusively locked and fail otherwise.
2009-11-20 22:51:12 +03:00
unknown
16c328056c The test case for bug 28587 doesn't work with the embedded version,
the first query is not running while we are doing wait queries on
a second connection.


mysql-test/r/insert_notembedded.result:
  Test case result for bug 28587 moved from insert_update.result
mysql-test/r/insert_update.result:
  Remove test case result for bug 28587, moving to insert_notembedded.result
mysql-test/t/insert_notembedded.test:
  Test case result for bug 28587, moved from insert_update.test
mysql-test/t/insert_update.test:
  Remove test case for bug 28587, moving to insert_notembedded.test
2007-09-06 13:22:34 -03:00
unknown
ea1f7e4b56 several fixes to make tests pass in embedded-server mode
libmysqld/lib_sql.cc:
  check for bootstrap added
mysql-test/include/federated.inc:
  disabled in embedded
mysql-test/mysql-test-run.pl:
  we disable ssh in embedded server
mysql-test/r/bdb.result:
  part moved to bdb_notembedded as it uses binlog
mysql-test/r/flush_block_commit.result:
  part moved to flush_block_commit_notembedded
mysql-test/r/insert.result:
  part moved to insert_notembedded as delayed works differently in embedded server
mysql-test/r/insert_select.result:
  part moved to insert_notembedded as GRANTS usually disabled in embedded server
mysql-test/r/join.result:
  access rights hidden in result
mysql-test/t/backup.test:
  now available in embedded server
mysql-test/t/bdb.test:
  part moved to bdb_notembedded as it uses binlog
mysql-test/t/delayed.test:
  code trimmed
mysql-test/t/execution_constants.test:
  skipped in embedded-server mode
mysql-test/t/flush_block_commit.test:
  moved to flush_block_commit_notembedded
mysql-test/t/information_schema_db.test:
  skipped in embedded-server
mysql-test/t/innodb.test:
  directories replaced to be embedded-server compliant
mysql-test/t/insert.test:
  part moved to insert_notembedded
mysql-test/t/insert_select.test:
  part moved to insert_notembedded
mysql-test/t/join.test:
  access rights hidden
mysql-test/t/status.test:
  skipped in embedded server
mysql-test/t/trigger.test:
  directories replaced to be embedded-server compliant
sql/item_strfunc.cc:
  extra contexts not needed whan access checks disabled
sql/share/errmsg.txt:
  bigger paths reserved to prevent test's fails
mysql-test/r/bdb_notembedded.result:
  ***MISSING WEAVE***
mysql-test/r/flush_block_commit_notembedded.result:
  added
mysql-test/r/insert_notembedded.result:
  added
mysql-test/t/bdb_notembedded.test:
  ***MISSING WEAVE***
mysql-test/t/flush_block_commit_notembedded.test:
  added
mysql-test/t/insert_notembedded.test:
  added
2006-11-13 20:06:45 +04:00