summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-07-11 10:49:54 +0300
committergkodinov/kgeorge@magare.gmz <>2007-07-11 10:49:54 +0300
commit015e1290a1db21e02560447ffd72238827add8f7 (patch)
treeada188315b9dd58d074fb0ee2259aa3dd1c205d7 /myisam
parent5b1e1eeae5f0743d8f8f01010211432a17bb04b3 (diff)
downloadmariadb-git-015e1290a1db21e02560447ffd72238827add8f7.tar.gz
Bug #29325:
By default MyISAM overwrites .MYD and .MYI files no DATA DIRECTORY option is used. This can lead to two tables using the same .MYD and .MYI files (that can't be dropped). To prevent CREATE TABLE from overwriting a file a new option is introduced : keep_files_on_create When this is on the CREATE TABLE throws an error if either the .MYD or .MYI exists for a MyISAM table. The option is off by default (resulting in compatible behavior).
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_create.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/myisam/mi_create.c b/myisam/mi_create.c
index ea1d8c7b83e..dd8a5b0d525 100644
--- a/myisam/mi_create.c
+++ b/myisam/mi_create.c
@@ -586,7 +586,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
32 : 0));
linkname_ptr=0;
/* Replace the current file */
- create_flag=MY_DELETE_OLD;
+ if (!(flags & HA_CREATE_KEEP_FILES))
+ create_flag=MY_DELETE_OLD;
}
/*
@@ -647,7 +648,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
{
fn_format(filename,name,"",MI_NAME_DEXT,4);
linkname_ptr=0;
- create_flag=MY_DELETE_OLD;
+ if (!(flags & HA_CREATE_KEEP_FILES))
+ create_flag=MY_DELETE_OLD;
}
if ((dfile=
my_create_with_symlink(linkname_ptr, filename, 0, create_mode,