~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rename.cc

  • Committer: Brian Aker
  • Date: 2010-01-27 18:58:12 UTC
  • Revision ID: brian@gaz-20100127185812-n62n0vwetnx8jrjy
Remove dead code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
  Rename a table
18
18
*/
19
19
 
20
 
#include "heapdef.h"
 
20
#include "heap_priv.h"
 
21
#include <string.h>
 
22
#include <cstdlib>
21
23
 
22
24
int heap_rename(const char *old_name, const char *new_name)
23
25
{
27
29
  pthread_mutex_lock(&THR_LOCK_heap);
28
30
  if ((info = hp_find_named_heap(old_name)))
29
31
  {
30
 
    if (!(name_buff=(char*) my_strdup(new_name,MYF(MY_WME))))
 
32
    if (!(name_buff=(char*) strdup(new_name)))
31
33
    {
32
34
      pthread_mutex_unlock(&THR_LOCK_heap);
33
 
      return(my_errno);
 
35
      return(errno);
34
36
    }
35
 
    my_free(info->name,MYF(0));
 
37
    free(info->name);
36
38
    info->name=name_buff;
37
39
  }
38
40
  pthread_mutex_unlock(&THR_LOCK_heap);