summaryrefslogtreecommitdiff
path: root/myisam/mi_create.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-03 23:07:20 +0100
committerunknown <serg@serg.mylan>2005-03-03 23:07:20 +0100
commit62debb7615f474d8840dbdd3a27f86c65e59074a (patch)
tree55707388340dadccc4056126d6e229f3d2c7791e /myisam/mi_create.c
parentce2e37221cc2ade1a39c3cbf873cf207f1c50ef6 (diff)
parenta4eb7ebbd024e096f0055ee28598ec4ac4190956 (diff)
downloadmariadb-git-62debb7615f474d8840dbdd3a27f86c65e59074a.tar.gz
merge
include/my_global.h: Auto merged mysys/mf_tempfile.c: Auto merged sql/ha_myisam.cc: Auto merged sql/share/english/errmsg.txt: Auto merged sql/table.cc: Auto merged
Diffstat (limited to 'myisam/mi_create.c')
-rw-r--r--myisam/mi_create.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/myisam/mi_create.c b/myisam/mi_create.c
index da3330627a7..e926321ded1 100644
--- a/myisam/mi_create.c
+++ b/myisam/mi_create.c
@@ -39,7 +39,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
{
register uint i,j;
File dfile,file;
- int errpos,save_errno;
+ int errpos,save_errno, create_mode= O_RDWR | O_TRUNC;
myf create_flag;
uint fields,length,max_key_length,packed,pointer,real_length_diff,
key_length,info_length,key_segs,options,min_key_length_skip,
@@ -176,7 +176,10 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
min_pack_length+=varchar_length+2*varchar_count;
}
if (flags & HA_CREATE_TMP_TABLE)
+ {
options|= HA_OPTION_TMP_TABLE;
+ create_mode|= O_EXCL | O_NOFOLLOW;
+ }
if (flags & HA_CREATE_CHECKSUM || (options & HA_OPTION_CHECKSUM))
{
options|= HA_OPTION_CHECKSUM;
@@ -548,9 +551,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
goto err;
}
- if ((file= my_create_with_symlink(linkname_ptr,
- filename,
- 0, O_RDWR | O_TRUNC,
+ if ((file= my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
MYF(MY_WME | create_flag))) < 0)
goto err;
errpos=1;
@@ -561,7 +562,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
if (share.base.raid_type)
{
(void) fn_format(filename,name,"",MI_NAME_DEXT,2+4);
- if ((dfile=my_raid_create(filename,0,O_RDWR | O_TRUNC,
+ if ((dfile=my_raid_create(filename, 0, create_mode
share.base.raid_type,
share.base.raid_chunks,
share.base.raid_chunksize,
@@ -585,8 +586,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
create_flag=MY_DELETE_OLD;
}
if ((dfile=
- my_create_with_symlink(linkname_ptr, filename,
- 0,O_RDWR | O_TRUNC,
+ my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
MYF(MY_WME | create_flag))) < 0)
goto err;
}