mirror of
https://github.com/MariaDB/server.git
synced 2026-04-22 00:05:33 +02:00
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.
This commit is contained in:
parent
ac67bfd7f7
commit
39defccfd4
4 changed files with 66 additions and 7 deletions
|
|
@ -541,6 +541,7 @@ typedef int (*Process_option_func)(void *ctx, const char *group_name,
|
|||
|
||||
#include <my_alloc.h>
|
||||
|
||||
|
||||
/* Prototypes for mysys and my_func functions */
|
||||
|
||||
extern int my_copy(const char *from,const char *to,myf MyFlags);
|
||||
|
|
@ -613,6 +614,13 @@ extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
|
|||
#endif
|
||||
extern int check_if_legal_filename(const char *path);
|
||||
|
||||
#if defined(__WIN__) && defined(__NT__)
|
||||
extern int nt_share_delete(const char *name,myf MyFlags);
|
||||
#define my_delete_allow_opened(fname,flags) nt_share_delete((fname),(flags))
|
||||
#else
|
||||
#define my_delete_allow_opened(fname,flags) my_delete((fname),(flags))
|
||||
#endif
|
||||
|
||||
#ifndef TERMINATE
|
||||
extern void TERMINATE(FILE *file);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue