summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <aivanov@mysql.com>2006-06-28 10:21:01 +0400
committerunknown <aivanov@mysql.com>2006-06-28 10:21:01 +0400
commit39defccfd4ebe99c9c827ef07cdf7514e52f5951 (patch)
treea5aaebddd57384d10e4d79dbbdbc2976733af0ed /sql/log.cc
parentac67bfd7f7500569fe4adeaf67c7ac5cfd7c1727 (diff)
downloadmariadb-git-39defccfd4ebe99c9c827ef07cdf7514e52f5951.tar.gz
Fixing BUG#17719 "Delete of binlog files fails on Windows"
and BUG#19208 "Test 'rpl000017' hangs on Windows". Both bugs are caused by attempting to delete an opened file and to create immediatedly a new one with the same name. On Windows it can be supported only on NT-platforms (by using FILE_SHARE_DELETE mode and with renaming the file before deletion). Because deleting not-closed files is not supported on all platforms (e.g. Win 98|ME) this is to be considered harmful and should be eliminated by a "code redesign". VC++Files/mysys/mysys.vcproj: To be sure that __NT__ is defined for Win configurations. Temporary, to be changed in more appropriate way. include/my_sys.h: Adding my_delete_allow_opened to be invoked to delete a (possibly) not closed file on Windows NT-platforms. mysys/my_delete.c: Adding nt_share_delete() function implementing a (possibly) not closed file deletion on Windows NT. sql/log.cc: MYSQL_LOG::reset_logs(): Deleting usually not closed binlog files.
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/log.cc b/sql/log.cc
index ba02c9ba082..baa92f748ab 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -959,14 +959,14 @@ bool MYSQL_LOG::reset_logs(THD* thd)
for (;;)
{
- my_delete(linfo.log_file_name, MYF(MY_WME));
+ my_delete_allow_opened(linfo.log_file_name, MYF(MY_WME));
if (find_next_log(&linfo, 0))
break;
}
/* Start logging with a new file */
close(LOG_CLOSE_INDEX);
- my_delete(index_file_name, MYF(MY_WME)); // Reset (open will update)
+ my_delete_allow_opened(index_file_name, MYF(MY_WME)); // Reset (open will update)
if (!thd->slave_thread)
need_start_event=1;
if (!open_index_file(index_file_name, 0))