summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
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 /sql/unireg.cc
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 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index c01e6a0f00c..d8e63bb78e1 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -285,6 +285,8 @@ int rea_create_table(THD *thd, my_string file_name,
if (mysql_create_frm(thd, file_name, db, table, create_info,
create_fields, keys, key_info, NULL))
DBUG_RETURN(1);
+ if (thd->variables.keep_files_on_create)
+ create_info->options|= HA_CREATE_KEEP_FILES;
if (!create_info->frm_only && ha_create_table(file_name,create_info,0))
{
my_delete(file_name,MYF(0));