~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_open.c

  • Committer: Monty Taylor
  • Date: 2009-01-30 21:02:37 UTC
  • mto: (779.7.3 devel)
  • mto: This revision was merged to the branch mainline in revision 823.
  • Revision ID: mordred@inaugust.com-20090130210237-3n6ld8a9jc084jko
Commented out a test in subselect_sj - I think it might be a regression. Jay?

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
/* open a heap-database */
17
17
 
18
18
#include "heapdef.h"
19
 
#ifdef VMS
20
 
#include "hp_static.c"                  /* Stupid vms-linker */
21
 
#endif
22
19
 
23
 
#include <mysys/my_sys.h>
 
20
#include <string.h>
24
21
 
25
22
/*
26
23
  Open heap table based on HP_SHARE structure
27
 
  
 
24
 
28
25
  NOTE
29
26
    This doesn't register the table in the open table list.
30
27
*/
33
30
{
34
31
  HP_INFO *info;
35
32
 
36
 
  if (!(info= (HP_INFO*) my_malloc((uint) sizeof(HP_INFO) +
37
 
                                  2 * share->max_key_length,
38
 
                                  MYF(MY_ZEROFILL))))
 
33
  if (!(info= (HP_INFO*) malloc(sizeof(HP_INFO) + 2 * share->max_key_length)))
39
34
  {
40
35
    return(0);
41
36
  }
42
 
  share->open_count++; 
 
37
  memset(info, 0, sizeof(HP_INFO) + 2 * share->max_key_length);
 
38
  share->open_count++;
43
39
  thr_lock_data_init(&share->lock,&info->lock,NULL);
44
40
  info->s= share;
45
 
  info->lastkey= (uchar*) (info + 1);
46
 
  info->recbuf= (uchar*) (info->lastkey + share->max_key_length);
 
41
  info->lastkey= (unsigned char*) (info + 1);
 
42
  info->recbuf= (unsigned char*) (info->lastkey + share->max_key_length);
47
43
  info->mode= mode;
48
 
  info->current_record= (uint32_t) ~0L;         /* No current record */
 
44
  info->current_record= UINT32_MAX;             /* No current record */
49
45
  info->lastinx= info->errkey= -1;
50
46
  return(info);
51
47
}