diff options
author | unknown <davi@moksha.local> | 2007-08-27 10:13:54 -0300 |
---|---|---|
committer | unknown <davi@moksha.local> | 2007-08-27 10:13:54 -0300 |
commit | 369a5f1cdcd569a02de4a12d64faebc33e9128f0 (patch) | |
tree | 1313fec2c43e8201aa5432ef88db4b13e2b4757e /mysql-test/include/deadlock.inc | |
parent | 33e123ead93b0122a67821e4b16ef70ef2b3d3af (diff) | |
download | mariadb-git-369a5f1cdcd569a02de4a12d64faebc33e9128f0.tar.gz |
Bug#25164 create table `a` as select * from `A` hangs
The problem from a user's perspective: user creates table A, and then tries
to CREATE TABLE a SELECT from A - and this causes a deadlock error, a hang,
or fails with a debug assert, but only if the storage engine is InnoDB.
The origin of the problem: InnoDB uses case-insensitive collation
(system_charset_info) when looking up the internal table share, thus returning
the same share for 'a' and 'A'.
Cause of the user-visible behavior: since the same share is returned to SQL
locking subsystem, it assumes that the same table is first locked (within the
same session) for WRITE, and then for READ, and returns a deadlock error.
However, the code is wrong in not properly cleaning up upon an error, leaving
external locks in place, which leads to assertion failures and hangs.
Fix that has been implemented: the SQL layer should properly propagate the
deadlock error, cleaning up and freeing all resources.
Further work towards a more complete solution: InnoDB should not use case
insensitive collation for table share hash if table names on disk honor the case.
mysql-test/r/innodb-deadlock.result:
Bug#25164 test case result
mysql-test/t/innodb-deadlock.test:
Bug#25164 test case. The CREATE TABLE may fail depending on the character set
of the system and filesystem, but it should never hang.
sql/lock.cc:
Unlock the storage engine "external" table level locks, if the MySQL thr_lock
locking subsystem detects a deadlock error.
Diffstat (limited to 'mysql-test/include/deadlock.inc')
0 files changed, 0 insertions, 0 deletions