Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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-27 18:14:35+05:00, holyfoot@stripped +1 -0
Bug $28477 innodb assertion and crash during alter table to add/drop partition.
The bug was repeated on MyISAM tables, so isn't InnoDB specific.
The reason is that open_ltable() called in mysql_alter_table
doesn't check if the opened table was modified by other thread
before it was locked by mysql_lock_tables().
mysql_lock_tables() can signal that case by setting it's 'need_reopen'
parameter to TRUE. So check for that parameter added.
sql/sql_base.cc@stripped, 2007-05-27 18:14:32+05:00, holyfoot@stripped +8 -1
Bug $28477 innodb assertion and crash during alter table to add/drop partition.
added check for the 'refresh' hint returned from mysql_lock_tables.
Try to reopen tables if it's TRUE
# 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: holyfoot
# Host: hfmain.(none)
# Root: /home/hf/work/28477/my51-28477
--- 1.403/sql/sql_base.cc 2007-05-27 18:14:40 +05:00
+++ 1.404/sql/sql_base.cc 2007-05-27 18:14:40 +05:00
@@ -3744,6 +3744,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST
bool refresh;
DBUG_ENTER("open_ltable");
+reopen_tables:
thd->proc_info="Opening table";
thd->current_tablenr= 0;
/* open_ltable can be used only for BASIC TABLEs */
@@ -3773,9 +3774,15 @@ TABLE *open_ltable(THD *thd, TABLE_LIST
{
DBUG_ASSERT(thd->lock == 0); // You must lock everything at once
if ((table->reginfo.lock_type= lock_type) != TL_UNLOCK)
- if (! (thd->lock= mysql_lock_tables(thd, &table_list->table, 1, 0,
+ if (! (thd->lock= mysql_lock_tables(thd, &table_list->table, 1,
+ MYSQL_LOCK_NOTIFY_IF_NEED_REOPEN,
&refresh)))
table= 0;
+ if (refresh)
+ {
+ close_tables_for_reopen(thd, &table_list);
+ goto reopen_tables;
+ }
}
}
thd->proc_info=0;
| Thread |
|---|
| • bk commit into 5.1 tree (holyfoot:1.2535) | holyfoot | 27 May |