List:Commits« Previous MessageNext Message »
From:ramil Date:May 29 2007 1:36pm
Subject:bk commit into 5.0 tree (ramil:1.2504) BUG#28652
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-29 16:35:58+05:00, ramil@stripped +3 -0
  Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations
  
  Problem: we may create a deadlock committing changes in the mysql_alter_table() when 
  LOCK_open is set.
  Fix: unlock LOCK_open before commit to avoid possible deadlocks.

  mysql-test/r/innodb_mysql.result@stripped, 2007-05-29 16:35:57+05:00, ramil@stripped +8 -0
    Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations
      - test result.

  mysql-test/t/innodb_mysql.test@stripped, 2007-05-29 16:35:57+05:00, ramil@stripped +8 -0
    Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations
      - test case.

  sql/sql_table.cc@stripped, 2007-05-29 16:35:57+05:00, ramil@stripped +7 -3
    Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations
      - unlock LOCK_open before commit to avoid possible deadlock.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ramil
# Host:	ramil.myoffice.izhnet.ru
# Root:	/home/ram/work/b28652/b28652.5.0

--- 1.343/sql/sql_table.cc	2007-05-29 16:36:02 +05:00
+++ 1.344/sql/sql_table.cc	2007-05-29 16:36:02 +05:00
@@ -3946,7 +3946,13 @@ view_err:
       goto err;
     }
   }
-  /* The ALTER TABLE is always in its own transaction */
+  /*
+    The ALTER TABLE is always in its own transaction.
+    We must unlock LOCK_open before the commit as it may create a deadlock 
+    in the wait_if_global_read_lock() if called with LOCK_open.
+  */
+  broadcast_refresh(); 
+  VOID(pthread_mutex_unlock(&LOCK_open));
   error = ha_commit_stmt(thd);
   if (ha_commit(thd))
     error=1;
@@ -3963,8 +3969,6 @@ view_err:
     Query_log_event qinfo(thd, thd->query, thd->query_length, FALSE, FALSE);
     mysql_bin_log.write(&qinfo);
   }
-  broadcast_refresh();
-  VOID(pthread_mutex_unlock(&LOCK_open));
 #ifdef HAVE_BERKELEY_DB
   if (old_db_type == DB_TYPE_BERKELEY_DB)
   {

--- 1.21/mysql-test/r/innodb_mysql.result	2007-05-29 16:36:02 +05:00
+++ 1.22/mysql-test/r/innodb_mysql.result	2007-05-29 16:36:02 +05:00
@@ -617,4 +617,12 @@ EXPLAIN SELECT COUNT(*) FROM t2 WHERE st
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	range	idx1,idx2	idx1	9	NULL	2	Using where; Using index
 DROP TABLE t1,t2;
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `a` int(11) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123'
+drop table t1;
 End of 5.0 tests

--- 1.21/mysql-test/t/innodb_mysql.test	2007-05-29 16:36:02 +05:00
+++ 1.22/mysql-test/t/innodb_mysql.test	2007-05-29 16:36:02 +05:00
@@ -597,4 +597,12 @@ EXPLAIN SELECT COUNT(*) FROM t2 WHERE st
 
 DROP TABLE t1,t2; 
 
+#
+# Bug #28652: assert when alter innodb table operation
+#
+create table t1(a int) engine=innodb;
+alter table t1 comment '123';
+show create table t1;
+drop table t1;
+
 --echo End of 5.0 tests
Thread
bk commit into 5.0 tree (ramil:1.2504) BUG#28652ramil29 May