~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_open.cc

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
33
33
{
34
 
  HP_INFO *info;
 
34
  HP_INFO *info= new HP_INFO;
35
35
 
36
 
  if (!(info= (HP_INFO*) malloc(sizeof(HP_INFO) + 2 * share->max_key_length)))
37
 
  {
38
 
    return(0);
39
 
  }
40
 
  memset(info, 0, sizeof(HP_INFO) + 2 * share->max_key_length);
41
36
  share->open_count++;
42
37
  info->lock.init(&share->lock);
43
 
  info->s= share;
44
 
  info->lastkey= (unsigned char*) (info + 1);
45
 
  info->recbuf= (unsigned char*) (info->lastkey + share->max_key_length);
 
38
  info->setShare(share);
 
39
  info->lastkey= new unsigned char[share->max_key_length];
 
40
  info->recbuf= new unsigned char[share->max_key_length];
46
41
  info->mode= mode;
47
42
  info->current_record= UINT32_MAX;             /* No current record */
48
43
  info->lastinx= info->errkey= -1;
49
 
  return(info);
 
44
  return info;
50
45
}
51
46
 
52
47