~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_open.c

  • Committer: Toru Maesaka
  • Date: 2008-12-17 07:16:37 UTC
  • mto: (685.1.40 devel) (713.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 713.
  • Revision ID: dev@torum.net-20081217071637-7j9040w7lpms77r2
Removed my_time() and added error checking

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
41
  info->lastkey= (unsigned char*) (info + 1);