~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rename.cc

  • Committer: Brian Aker
  • Date: 2010-09-11 01:35:47 UTC
  • mto: (1759.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1762.
  • Revision ID: brian@tangent.org-20100911013547-b04k7f1qddr3ml4t
Shuffle native functions over to hash such that we have a specific container
for them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
int heap_rename(const char *old_name, const char *new_name)
25
25
{
26
 
  register HP_SHARE *info;
27
 
  char *name_buff;
 
26
  HP_SHARE *info;
28
27
 
29
 
  pthread_mutex_lock(&THR_LOCK_heap);
 
28
  THR_LOCK_heap.lock();
30
29
  if ((info = hp_find_named_heap(old_name)))
31
30
  {
32
 
    if (!(name_buff=(char*) strdup(new_name)))
33
 
    {
34
 
      pthread_mutex_unlock(&THR_LOCK_heap);
35
 
      return(errno);
36
 
    }
37
 
    free(info->name);
38
 
    info->name=name_buff;
 
31
    info->name.clear();
 
32
    info->name.append(new_name);
39
33
  }
40
 
  pthread_mutex_unlock(&THR_LOCK_heap);
 
34
  THR_LOCK_heap.unlock();
41
35
  return(0);
42
36
}