Commit 645f1110 authored by marko's avatar marko

Merge a change from MySQL AB:

ChangeSet@1.1810.3176.1  2007-07-20 14:17:15+03:00  gkodinov@magare.gmz

Bug #29644: alter table hangs if records locked in share mode 
by long running transaction

On Windows opened files can't be deleted. There was a special
upgraded lock mode (TL_WRITE instead of TL_WRITE_ALLOW_READ) 
in ALTER TABLE to make sure nobody has the table opened
when deleting the old table in ALTER TABLE. This special mode
was causing ALTER TABLE to hang waiting on a lock inside InnoDB.
This special lock is no longer necessary as the server is 
closing the tables it needs to delete in ALTER TABLE.
Fixed by removing the special lock.
Note that this also reverses the fix for bug 17264 that deals with
another consequence of this special lock mode being used.

ha_innodb.cc@1.202.46.1  2007-07-20 14:17:14+03:00  gkodinov@magare.gmz

Bug #29644: reverse the (now excessive) fix
for bug 17264 (but leave the test case).
parent 31ed35c0
......@@ -7172,18 +7172,6 @@ ha_innobase::store_lock(
&& !thd_tablespace_op(thd)
&& sql_command != SQLCOM_TRUNCATE
&& sql_command != SQLCOM_OPTIMIZE
#ifdef __WIN__
/* For alter table on win32 for successful
operation completion it is used TL_WRITE(=10) lock
instead of TL_WRITE_ALLOW_READ(=6), however here
in innodb handler TL_WRITE is lifted to
TL_WRITE_ALLOW_WRITE, which causes race condition
when several clients do alter table simultaneously
(bug #17264). This fix avoids the problem. */
&& sql_command != SQLCOM_ALTER_TABLE
#endif
&& sql_command != SQLCOM_CREATE_TABLE) {
lock_type = TL_WRITE_ALLOW_WRITE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment