Below is the list of changes that have just been committed into a local
5.1 repository of istruewing. When istruewing 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-12-02 20:36:46+01:00, istruewing@stripped +1 -0
Bug#30273 - merge tables: Can't lock file (errno: 155)
The patch for Bug#26379 (Combination of FLUSH TABLE and
REPAIR TABLE corrupts a MERGE table) fixed this bug too.
However it revealed a new bug that crashed the server.
Flushing a merge table at the moment when it is between open
and attach of children crashed the server.
The flushing thread wants to abort locks on the flushed table.
It calls ha_myisammrg::lock_count() and ha_myisammrg::store_lock()
on the TABLE object of the other thread.
Changed ha_myisammrg::lock_count() and ha_myisammrg::store_lock()
to accept non-attached children.
The test case follows in another changeset. It requires some
effort to make the problem repeatable.
storage/myisammrg/ha_myisammrg.cc@stripped, 2007-12-02 20:36:44+01:00,
istruewing@stripped +18 -2
Bug#30273 - merge tables: Can't lock file (errno: 155)
Changed ha_myisammrg::lock_count() and ha_myisammrg::store_lock()
to accept non-attached children.
diff -Nrup a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
--- a/storage/myisammrg/ha_myisammrg.cc 2007-11-15 20:25:41 +01:00
+++ b/storage/myisammrg/ha_myisammrg.cc 2007-12-02 20:36:44 +01:00
@@ -901,7 +901,15 @@ int ha_myisammrg::external_lock(THD *thd
uint ha_myisammrg::lock_count(void) const
{
- DBUG_ASSERT(this->file->children_attached);
+ /*
+ When MERGE table is open, but not yet attached, other threads
+ could flush it, which means call mysql_lock_abort_for_thread()
+ on this threads TABLE. 'children_attached' is FALSE in this
+ situaton. Since the table is not locked, return zero lock count.
+ */
+ if (!this->file->children_attached)
+ return 0;
+
return file->tables;
}
@@ -911,7 +919,15 @@ THR_LOCK_DATA **ha_myisammrg::store_lock
enum thr_lock_type lock_type)
{
MYRG_TABLE *open_table;
- DBUG_ASSERT(this->file->children_attached);
+
+ /*
+ When MERGE table is open, but not yet attached, other threads
+ could flush it, which means call mysql_lock_abort_for_thread()
+ on this threads TABLE. 'children_attached' is FALSE in this
+ situaton. Since the table is not locked, return no lock data.
+ */
+ if (!this->file->children_attached)
+ return to;
for (open_table=file->open_tables ;
open_table != file->end_table ;
| Thread |
|---|
| • bk commit into 5.1 tree (istruewing:1.2623) BUG#30273 | Ingo Struewing | 2 Dec |