~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_open.c

  • Committer: Jay Pipes
  • Date: 2008-07-16 16:14:22 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: jay@mysql.com-20080716161422-fy1bl8o5q7m8kglq
Removed all DBUG symbols from heap storage engine

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
HP_INFO *heap_open_from_share(HP_SHARE *share, int mode)
33
33
{
34
34
  HP_INFO *info;
35
 
  DBUG_ENTER("heap_open_from_share");
36
35
 
37
36
  if (!(info= (HP_INFO*) my_malloc((uint) sizeof(HP_INFO) +
38
37
                                  2 * share->max_key_length,
39
38
                                  MYF(MY_ZEROFILL))))
40
39
  {
41
 
    DBUG_RETURN(0);
 
40
    return(0);
42
41
  }
43
42
  share->open_count++; 
44
43
  thr_lock_data_init(&share->lock,&info->lock,NULL);
48
47
  info->mode= mode;
49
48
  info->current_record= (ulong) ~0L;            /* No current record */
50
49
  info->lastinx= info->errkey= -1;
51
 
#ifndef DBUG_OFF
52
 
  info->opt_flag= READ_CHECK_USED;              /* Check when changing */
53
 
#endif
54
 
  DBUG_PRINT("exit",("heap: 0x%lx  reclength: %d  records_in_block: %d",
55
 
                     (long) info, share->reclength,
56
 
                     share->block.records_in_block));
57
 
  DBUG_RETURN(info);
 
50
  return(info);
58
51
}
59
52
 
60
53
 
65
58
HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode)
66
59
{
67
60
  HP_INFO *info;
68
 
  DBUG_ENTER("heap_open_from_share_and_register");
69
61
 
70
62
  pthread_mutex_lock(&THR_LOCK_heap);
71
63
  if ((info= heap_open_from_share(share, mode)))
74
66
    heap_open_list= list_add(heap_open_list,&info->open_list);
75
67
  }
76
68
  pthread_mutex_unlock(&THR_LOCK_heap);
77
 
  DBUG_RETURN(info);
 
69
  return(info);
78
70
}
79
71
 
80
72
 
90
82
{
91
83
  HP_INFO *info;
92
84
  HP_SHARE *share;
93
 
  DBUG_ENTER("heap_open");
94
85
 
95
86
  pthread_mutex_lock(&THR_LOCK_heap);
96
87
  if (!(share= hp_find_named_heap(name)))
97
88
  {
98
89
    my_errno= ENOENT;
99
90
    pthread_mutex_unlock(&THR_LOCK_heap);
100
 
    DBUG_RETURN(0);
 
91
    return(0);
101
92
  }
102
93
  if ((info= heap_open_from_share(share, mode)))
103
94
  {
105
96
    heap_open_list= list_add(heap_open_list,&info->open_list);
106
97
  }
107
98
  pthread_mutex_unlock(&THR_LOCK_heap);
108
 
  DBUG_RETURN(info);
 
99
  return(info);
109
100
}
110
101
 
111
102
 
115
106
{
116
107
  LIST *pos;
117
108
  HP_SHARE *info;
118
 
  DBUG_ENTER("heap_find");
119
 
  DBUG_PRINT("enter",("name: %s",name));
120
109
 
121
110
  for (pos= heap_share_list; pos; pos= pos->next)
122
111
  {
123
112
    info= (HP_SHARE*) pos->data;
124
113
    if (!strcmp(name, info->name))
125
114
    {
126
 
      DBUG_PRINT("exit", ("Old heap_database: 0x%lx", (long) info));
127
 
      DBUG_RETURN(info);
 
115
      return(info);
128
116
    }
129
117
  }
130
 
  DBUG_RETURN((HP_SHARE *) 0);
 
118
  return((HP_SHARE *) 0);
131
119
}
132
120
 
133
121