From: Date: January 23 2006 4:39pm Subject: bk commit into 4.0 tree (ingo:1.2169) BUG#5390 List-Archive: http://lists.mysql.com/commits/1507 X-Bug: 5390 Message-Id: Below is the list of changes that have just been committed into a local 4.0 repository of mydev. When mydev 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 1.2169 06/01/23 16:39:54 ingo@stripped +1 -0 BUG#5390 - problems with merge tables Additional precaution. Ignore temporary tables in mysql_lock_have_duplicate() like they are ignored in get_lock_data(). Otherwise we could stumble over invalid lock positions in the temporary table. sql/lock.cc 1.57 06/01/23 16:39:53 ingo@stripped +11 -0 BUG#5390 - problems with merge tables Additional precaution. Ignore temporary tables in mysql_lock_have_duplicate() like they are ignored in get_lock_data(). Otherwise we could stumble over invalid lock positions in the temporary table. # 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: ingo # Host: chilla.local # Root: /home/mydev/mysql-4.0-bug5390 --- 1.56/sql/lock.cc 2006-01-18 15:42:42 +01:00 +++ 1.57/sql/lock.cc 2006-01-23 16:39:53 +01:00 @@ -460,6 +460,10 @@ the MERGE tables are opened. This function assumes that the tables are already locked. + Temporary tables are ignored here like they are ignored in + get_lock_data(). If we allow two opens on temporary tables later, + both functions should be checked. + RETURN 1 A table from 'tables' matches a lock on 'table'. 0 No duplicate lock found. @@ -476,6 +480,10 @@ THR_LOCK_DATA **end_data2; DBUG_ENTER("mysql_lock_have_duplicate"); + /* A temporary table does not have locks. */ + if (table->tmp_table == TMP_TABLE) + goto end; + /* Get command lock or LOCK TABLES lock. */ mylock= thd->lock ? thd->lock : thd->locked_tables; DBUG_ASSERT(mylock); @@ -495,6 +503,9 @@ for (; tables; tables= tables->next) { table2= tables->table; + if (table2->tmp_table == TMP_TABLE) + continue; + /* All tables in list must be in lock. */ DBUG_ASSERT(table2 == lock_tables[table2->lock_position]);