~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_open.c

  • Committer: Paul McCullagh
  • Date: 2008-10-10 12:42:11 UTC
  • mfrom: (499 drizzle)
  • mto: (499.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 505.
  • Revision ID: paul.mccullagh@primebase.org-20081010124211-hxs9ny96auxpq2ag
Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include "myisamdef.h"
19
19
#include <mystrings/m_ctype.h>
 
20
#include <drizzled/util/test.h>
20
21
 
21
22
static void setup_key_functions(MI_KEYDEF *keyinfo);
22
23
#define get_next_element(to,pos,size) \
96
97
    share_buff.key_cache= multi_key_cache_search((unsigned char*) name_buff,
97
98
                                                 strlen(name_buff));
98
99
 
99
 
    if ((kfile=my_open(name_buff,(open_mode=O_RDWR) | O_SHARE,MYF(0))) < 0)
 
100
    if ((kfile=my_open(name_buff,(open_mode=O_RDWR),MYF(0))) < 0)
100
101
    {
101
102
      if ((errno != EROFS && errno != EACCES) ||
102
103
          mode != O_RDONLY ||
103
 
          (kfile=my_open(name_buff,(open_mode=O_RDONLY) | O_SHARE,MYF(0))) < 0)
 
104
          (kfile=my_open(name_buff,(open_mode=O_RDONLY),MYF(0))) < 0)
104
105
        goto err;
105
106
    }
106
107
    share->mode=open_mode;
1050
1051
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share,
1051
1052
                     File file_to_dup __attribute__((unused)))
1052
1053
{
1053
 
    info->dfile=my_open(share->data_file_name, share->mode | O_SHARE,
 
1054
    info->dfile=my_open(share->data_file_name, share->mode,
1054
1055
                        MYF(MY_WME));
1055
1056
  return info->dfile >= 0 ? 0 : 1;
1056
1057
}
1058
1059
 
1059
1060
int mi_open_keyfile(MYISAM_SHARE *share)
1060
1061
{
1061
 
  if ((share->kfile=my_open(share->unique_file_name, share->mode | O_SHARE,
 
1062
  if ((share->kfile=my_open(share->unique_file_name, share->mode,
1062
1063
                            MYF(MY_WME))) < 0)
1063
1064
    return 1;
1064
1065
  return 0;