mariadb/mysys
Dmitry Lenev dfa2acb141 Fix for bug #45143 "All connections hang on concurrent ALTER TABLE".
Concurrent execution of statements which require non-table-level
write locks on several instances of the same table (such as
SELECT ... FOR UPDATE which uses same InnoDB table twice or a DML
statement which invokes trigger which tries to update same InnoDB
table directly and through stored function) and statements which
required table-level locks on this table (e.g. LOCK TABLE ... WRITE,
ALTER TABLE, ...) might have resulted in a deadlock.

The problem occured when a thread tried to acquire write lock
(TL_WRITE_ALLOW_WRITE) on the table but had to wait since there was
a pending write lock (TL_WRITE, TL_WRITE_ALLOW_READ) on this table
and we failed to detect that this thread already had another instance
of write lock on it (so in fact we were trying to acquire recursive
lock) because there was also another thread holding write lock on the
table (also TL_WRITE_ALLOW_WRITE). When the latter thread released
its lock neither the first thread nor the thread trying to acquire
TL_WRITE/TL_WRITE_ALLOW_READ were woken up (as table was still write
locked by the first thread) so we ended up with a deadlock.

This patch solves this problem by ensuring that thread which
already has write lock on the table won't wait when it tries
to acquire second write lock on the same table.
2009-10-26 22:38:03 +03:00
..
.cvsignore
array.c Fix for a few assorted compiler warnings. 2009-08-28 12:06:59 -03:00
base64.c fixed compilation warnings. addendum to the fix for bug 29125 2009-03-20 16:27:53 +02:00
ChangeLog
charset-def.c Bsckporting WL#3764 Sinhala Collation 2009-10-06 15:34:49 +05:00
charset.c Backporting WL#4164 Two-byte collation IDs 2009-10-15 15:17:32 +05:00
checksum.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
CMakeLists.txt Merge from mysql-trunk-merge. 2009-10-19 17:36:19 +04:00
default.c merged 5.0-bugteam -> 5.1-bugteam 2009-03-24 15:58:52 +02:00
default_modify.c This is the downport of 2009-09-11 22:26:35 +02:00
errors.c WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
hash.c Merge from 5.0 2009-09-17 17:25:52 +02:00
list.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
make-ccc
make-conf.c
Makefile.am Merge from mysql-trunk-merge. 2009-10-19 17:36:19 +04:00
md5.c Bug #42434: license of mysys MD5 implementation is not GPL-compatible 2009-03-09 20:57:03 +02:00
mf_arr_appstr.c Bug #20748: Configuration files should not be read more than once 2007-11-07 15:23:50 -07:00
mf_brkhant.c
mf_cache.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_dirname.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_fn_ext.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_format.c BUG#43949 Initialization of slave produces a warning message in Valgrind 2009-04-19 02:21:33 +01:00
mf_getdate.c Merge from 5.0-bugteam 2009-05-13 08:48:00 -07:00
mf_iocache.c Manual merge. 2009-09-02 09:12:18 -03:00
mf_iocache2.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-10 17:47:54 -05:00
mf_keycache.c Merge from mysql-5.1. 2009-10-19 17:28:31 +04:00
mf_keycaches.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_loadpath.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_pack.c Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
mf_path.c Slow query log to file now displays queries with microsecond precission 2007-07-30 11:33:50 +03:00
mf_qsort.c Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
mf_qsort2.c
mf_radix.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_same.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_sort.c Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maint 2007-10-18 14:32:43 +04:00
mf_soundex.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_tempdir.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
mf_tempfile.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
mf_unixpath.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_util.c
mf_wcomp.c
mf_wfile.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mulalloc.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_access.c
my_aes.c
my_alarm.c
my_alloc.c Bug#38296 (low memory crash with many conditions in a query) 2008-08-11 10:10:00 -06:00
my_append.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_atomic.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_bit.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_bitmap.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_chsize.c This is the downport of 2009-09-11 22:26:35 +02:00
my_clock.c
my_compress.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_conio.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_copy.c merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-09-03 17:59:25 +05:30
my_crc32.c
my_create.c This is the downport of 2009-09-11 22:26:35 +02:00
my_delete.c backport of 2009-09-30 22:10:22 +02:00
my_div.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_dup.c This is the downport of 2009-09-11 22:26:35 +02:00
my_error.c WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
my_file.c This is the downport of 2009-09-11 22:26:35 +02:00
my_fopen.c This is the downport of 2009-09-11 22:26:35 +02:00
my_fstream.c This is the downport of 2009-09-11 22:26:35 +02:00
my_gethostbyname.c
my_gethwaddr.c fix compile error. definition of VOID in trunk still conflicts with windows headers. that was fixed in 6.0 2009-09-13 19:38:06 +02:00
my_getncpus.c
my_getopt.c Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
my_getpagesize.c
my_getsystime.c Reverted wrong patch, fix for Windows 32bit build. 2008-02-26 18:44:04 +02:00
my_getwd.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_handler.c Fixed problem with non-synchronous error lists 2008-03-28 18:45:03 +02:00
my_handler_errors.h merge 5.0-bugteam to 5.1-bugteam 2009-07-24 12:15:06 +05:30
my_init.c Backport of the patch 2009-09-30 03:39:37 +02:00
my_largepage.c Bug #43606: 4GB Limit on huge_pages shared memory set-up 2009-09-18 11:19:02 +04:00
my_lib.c This is the downport of 2009-09-11 22:26:35 +02:00
my_libwrap.c
my_lock.c This is the downport of 2009-09-11 22:26:35 +02:00
my_lockmem.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_malloc.c Backport of my_malloc() changes from 5.1 to make it 64-bit safe on Unix platforms. 2007-08-29 19:20:18 +04:00
my_memmem.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_messnc.c WL#2110 (SIGNAL) 2009-09-10 03:18:29 -06:00
my_mkdir.c
my_mmap.c This is the downport of 2009-09-11 22:26:35 +02:00
my_net.c
my_netware.c
my_new.cc Bug#43461: invalid comparison with string literal in default.c 2009-03-19 17:20:15 -03:00
my_once.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_open.c This is the downport of 2009-09-11 22:26:35 +02:00
my_port.c
my_pread.c This is the downport of 2009-09-11 22:26:35 +02:00
my_pthread.c my_pthread.c: 2007-07-30 20:40:49 +02:00
my_quick.c This is the downport of 2009-09-11 22:26:35 +02:00
my_read.c This is the downport of 2009-09-11 22:26:35 +02:00
my_realloc.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_redel.c merge 2009-09-02 15:33:18 +03:00
my_rename.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_seek.c This is the downport of 2009-09-11 22:26:35 +02:00
my_sleep.c
my_static.c Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
my_static.h Bug#35616: memory overrun on 64-bit linux on setting large values for keybuffer-size 2008-08-19 15:56:41 +02:00
my_symlink.c Bug#39102 valgrind build does not compile in realpath, which make DATA/INDEX DIR fail 2008-10-27 19:25:11 +04:00
my_symlink2.c Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines 2007-11-12 15:26:37 +04:00
my_sync.c This is the downport of 2009-09-11 22:26:35 +02:00
my_thr_init.c Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
my_vle.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_wincond.c Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
my_windac.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_winerr.c This is the downport of 2009-09-11 22:26:35 +02:00
my_winfile.c backport of 2009-09-30 22:10:22 +02:00
my_winthread.c Backport of this changeset 2009-09-30 17:40:12 +02:00
my_write.c This is the downport of 2009-09-11 22:26:35 +02:00
mysys_priv.h This is the downport of 2009-09-11 22:26:35 +02:00
ptr_cmp.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
queues.c Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
rijndael.c
safemalloc.c Bug#43932 myisam index corruption with large index and large 2009-04-29 13:51:10 +02:00
sha1.c Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2007-01-22 14:04:40 +02:00
stacktrace.c merge fix from 5.0-bugteam 2008-09-16 15:23:07 +02:00
string.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
test_charset.c Fix doxygen warnings. 2007-08-15 17:43:08 +04:00
test_dir.c
test_fn.c
test_xml.c
testhash.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
thr_alarm.c Avoid compilation problem on AIX. 2008-04-28 13:41:12 -04:00
thr_lock.c Fix for bug #45143 "All connections hang on concurrent ALTER TABLE". 2009-10-26 22:38:03 +03:00
thr_mutex.c Bug#38941: fast mutexes in MySQL 5.1 have mutex contention when calling random() 2008-10-15 19:21:00 -03:00
thr_rwlock.c
tree.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
trie.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
typelib.c Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00