Below is the list of changes that have just been committed into a local
5.0 repository of Kristofer Pettersson. When Kristofer Pettersson 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, 2006-09-18 14:20:15+02:00, Kristofer.Pettersson@naruto. +3 -0
- When a MyISAM table which belongs to a merge table union and is
renamed the associated file descriptors are closed on windows.
This causes a server crash next time an insert or update is
performed on the merge table.
- This patch prevents the system from crashing on windows by
checking for bad file descriptors every time the MyISAM table
is locked by associated the merge table.
myisam/mi_locking.c@stripped, 2006-09-18 14:08:24+02:00, Kristofer.Pettersson@naruto. +13 -0
- Added check for bad file descriptors when table is part of merge union.
- This patch prevents the server from crash on windows.
myisam/myisamdef.h@stripped, 2006-09-18 14:08:25+02:00, Kristofer.Pettersson@naruto. +3 -0
Added boolean value to indicate that this myisam table is part of
a merge union.
myisammrg/myrg_locking.c@stripped, 2006-09-18 14:08:25+02:00, Kristofer.Pettersson@naruto. +11 -1
- When a MyISAM table which belongs to a merge table union and is
renamed the associated file descriptors are closed on windows.
This causes a server crash next time an insert or update is
performed on the merge table.
- This patch prevents the system from crashing on windows by
checking for bad file descriptors every time the MyISAM table
is locked by associated the merge 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: Kristofer.Pettersson
# Host: naruto.
# Root: C:/cpp/bug20789/my50-bug20789
--- 1.41/myisam/mi_locking.c 2006-09-18 14:20:42 +02:00
+++ 1.42/myisam/mi_locking.c 2006-09-18 14:20:42 +02:00
@@ -224,6 +224,19 @@
break; /* Impossible */
}
}
+#ifdef __WIN__
+ else
+ {
+ /*
+ Check for bad file descriptors if this table is part
+ of a merge union. This fix patches bug#20789.
+ */
+ if( info->owned_by_merge && (info->s)->kfile < 0 )
+ {
+ error = HA_ERR_NO_SUCH_TABLE;
+ }
+ }
+#endif
pthread_mutex_unlock(&share->intern_lock);
#if defined(FULL_LOG) || defined(_lint)
lock_type|=(int) (flag << 8); /* Set bit to set if real lock */
--- 1.84/myisam/myisamdef.h 2006-09-18 14:20:42 +02:00
+++ 1.85/myisam/myisamdef.h 2006-09-18 14:20:42 +02:00
@@ -278,6 +278,9 @@
my_bool page_changed; /* If info->buff can't be used for rnext */
my_bool buff_used; /* If info->buff has to be reread for rnext */
my_bool once_flags; /* For MYISAMMRG */
+#ifdef __WIN__
+ my_bool owned_by_merge; /* This MyISAM table part of a merge union */
+#endif
#ifdef THREAD
THR_LOCK_DATA lock;
#endif
--- 1.7/myisammrg/myrg_locking.c 2006-09-18 14:20:42 +02:00
+++ 1.8/myisammrg/myrg_locking.c 2006-09-18 14:20:42 +02:00
@@ -26,7 +26,17 @@
MYRG_TABLE *file;
error=0;
- for (file=info->open_tables ; file != info->end_table ; file++)
+ for (file=info->open_tables ; file != info->end_table ; file++) {
+#ifdef __WIN__
+ /*
+ Make sure this table is marked as owned by a merge table.
+ The semaphore is never released as long as table remains
+ in memory. This patches bug#20789 but should be refactored
+ into a more generic approach (observer pattern)
+ */
+ (file->table)->owned_by_merge = TRUE;
+#endif
+ }
if ((new_error=mi_lock_database(file->table,lock_type)))
error=new_error;
return(error);
| Thread |
|---|
| • bk commit into 5.0 tree (Kristofer.Pettersson:1.2250) | kpettersson | 18 Sep |