~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_open.c

  • Committer: Brian Aker
  • Date: 2008-08-05 04:10:42 UTC
  • mfrom: (261.2.8 codestyle)
  • mto: This revision was merged to the branch mainline in revision 263.
  • Revision ID: brian@tangent.org-20080805041042-1l4893r3bwy2lxz2
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <mystrings/m_ctype.h>
20
20
 
21
21
static void setup_key_functions(MI_KEYDEF *keyinfo);
22
 
#define get_next_element(to,pos,size) { memcpy((char*) to,pos,(size_t) size); \
23
 
                                        pos+=size;}
 
22
#define get_next_element(to,pos,size) \
 
23
  do {                                \
 
24
    memcpy(to, pos, size);            \
 
25
    pos+=size;                        \
 
26
  } while (0)
24
27
 
25
28
 
26
29
#define disk_pos_assert(pos, end_pos) \
77
80
  lock_error=1;
78
81
  errpos=0;
79
82
  head_length=sizeof(share_buff.state.header);
80
 
  memset((uchar*) &info, 0, sizeof(info));
 
83
  memset(&info, 0, sizeof(info));
81
84
 
82
85
  my_realpath(name_buff, fn_format(org_name,name,"",MI_NAME_IEXT,
83
86
                                   MY_UNPACK_FILENAME),MYF(0));
85
88
  if (!(old_info=test_if_reopen(name_buff)))
86
89
  {
87
90
    share= &share_buff;
88
 
    memset((uchar*) &share_buff, 0, sizeof(share_buff));
 
91
    memset(&share_buff, 0, sizeof(share_buff));
89
92
    share_buff.state.rec_per_key_part=rec_per_key_part;
90
93
    share_buff.state.key_root=key_root;
91
94
    share_buff.state.key_del=key_del;
107
110
      my_errno= HA_ERR_NOT_A_TABLE;
108
111
      goto err;
109
112
    }
110
 
    if (memcmp((uchar*) share->state.header.file_version,
111
 
               (uchar*) myisam_file_magic, 4))
 
113
    if (memcmp(share->state.header.file_version, myisam_file_magic, 4))
112
114
    {
113
115
      my_errno=HA_ERR_NOT_A_TABLE;
114
116
      goto err;
242
244
      goto err;
243
245
    errpos=4;
244
246
    *share=share_buff;
245
 
    memcpy((char*) share->state.rec_per_key_part,
246
 
           (char*) rec_per_key_part, sizeof(long)*key_parts);
247
 
    memcpy((char*) share->state.key_root,
248
 
           (char*) key_root, sizeof(my_off_t)*keys);
249
 
    memcpy((char*) share->state.key_del,
250
 
           (char*) key_del, (sizeof(my_off_t) *
251
 
                             share->state.header.max_block_size_index));
 
247
    memcpy(share->state.rec_per_key_part, rec_per_key_part,
 
248
           sizeof(long)*key_parts);
 
249
    memcpy(share->state.key_root, key_root,
 
250
           sizeof(my_off_t)*keys);
 
251
    memcpy(share->state.key_del, key_del,
 
252
           sizeof(my_off_t) * share->state.header.max_block_size_index);
252
253
    strmov(share->unique_file_name, name_buff);
253
254
    share->unique_name_length= strlen(name_buff);
254
255
    strmov(share->index_file_name,  index_name);