~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rename.c

  • Committer: Monty Taylor
  • Date: 2009-02-05 21:07:57 UTC
  • mto: This revision was merged to the branch mainline in revision 840.
  • Revision ID: mordred@inaugust.com-20090205210757-6487lf69y3mndcds
Fixed warnings badness in csv_alter_table test.

Show diffs side-by-side

added added

removed removed

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