summaryrefslogtreecommitdiff
path: root/mysys/my_delete.c
diff options
context:
space:
mode:
authorunknown <istruewing@stella.local>2007-11-22 21:39:28 +0100
committerunknown <istruewing@stella.local>2007-11-22 21:39:28 +0100
commit68321feb177131dcd6571c0132808f3841c9635d (patch)
treec57e3538fba40d5bdc94480cf30d559480bc6753 /mysys/my_delete.c
parent864216747d1adc6cba7d91a1d9f487b9d44957b2 (diff)
downloadmariadb-git-68321feb177131dcd6571c0132808f3841c9635d.tar.gz
Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE
corrupts a MERGE table Post-pushbuild fix. The merge test failed on Windows. The MoveFile() function returned the error code ERROR_ACCESS_DENIED. The fix is to use a different name for the file to be deleted. This is the same trick as we use for the error code ERROR_ALREADY_EXISTS. Added ERROR_ACCESS_DENIED to the list of error codes that require to change the name of the file to be deleted. mysys/my_delete.c: Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts a MERGE table Added ERROR_ACCESS_DENIED to the list of error codes that require to change the name of the file to be deleted.
Diffstat (limited to 'mysys/my_delete.c')
-rw-r--r--mysys/my_delete.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index bac3e2513e1..cff00bf7e08 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -56,16 +56,20 @@ int nt_share_delete(const char *name, myf MyFlags)
ulong cnt;
DBUG_ENTER("nt_share_delete");
DBUG_PRINT("my",("name %s MyFlags %d", name, MyFlags));
-
+
for (cnt= GetTickCount(); cnt; cnt--)
{
sprintf(buf, "%s.%08X.deleted", name, cnt);
if (MoveFile(name, buf))
break;
-
+
if ((errno= GetLastError()) == ERROR_ALREADY_EXISTS)
continue;
-
+
+ /* This happened during tests with MERGE tables. */
+ if (errno == ERROR_ACCESS_DENIED)
+ continue;
+
DBUG_PRINT("warning", ("Failed to rename %s to %s, errno: %d",
name, buf, errno));
break;