~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Brian Aker
  • Date: 2008-12-09 17:33:02 UTC
  • mfrom: (656.1.54 devel)
  • Revision ID: brian@tangent.org-20081209173302-aptngvc7efxnatnt
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
619
619
    if (argument)
620
620
    {
621
621
      char *start=argument;
622
 
      free(opt_password);
623
 
      opt_password=my_strdup(argument,MYF(MY_FAE));
 
622
      if (opt_password)
 
623
        free(opt_password);
 
624
      opt_password=strdup(argument);
 
625
      if (opt_password == NULL)
 
626
      {
 
627
        fprintf(stderr, "Memory allocation error while copying password. "
 
628
                        "Aborting.\n");
 
629
        exit(ENOMEM);
 
630
      }
624
631
      while (*argument) *argument++= 'x';               /* Destroy argument */
625
632
      if (*start)
626
633
        start[1]=0;                             /* Cut length of argument */
694
701
      fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
695
702
      exit(1);
696
703
    }
697
 
    if (my_hash_insert(&ignore_table, (unsigned char*)my_strdup(argument, MYF(0))))
 
704
    char * tmpptr= strdup(argument);
 
705
    if (!(tmpptr) || my_hash_insert(&ignore_table, (unsigned char*)tmpptr))
698
706
      exit(EX_EOM);
699
707
    break;
700
708
  }
758
766
                (hash_get_key) get_table_key,
759
767
                (hash_free_key) free_table_ent, 0))
760
768
    return(EX_EOM);
761
 
  /* Don't copy internal log tables */
762
 
  if (my_hash_insert(&ignore_table,
763
 
                     (unsigned char*) my_strdup("mysql.apply_status", MYF(MY_WME))) ||
764
 
      my_hash_insert(&ignore_table,
765
 
                     (unsigned char*) my_strdup("mysql.schema", MYF(MY_WME))) ||
766
 
      my_hash_insert(&ignore_table,
767
 
                     (unsigned char*) my_strdup("mysql.general_log", MYF(MY_WME))) ||
768
 
      my_hash_insert(&ignore_table,
769
 
                     (unsigned char*) my_strdup("mysql.slow_log", MYF(MY_WME))) ||
770
 
      my_hash_insert(&ignore_table,
771
 
                     (unsigned char*) my_strdup("mysql.online_backup", MYF(MY_WME))) ||
772
 
      my_hash_insert(&ignore_table,
773
 
                     (unsigned char*) my_strdup("mysql.online_backup_progress", MYF(MY_WME))))
774
 
    return(EX_EOM);
775
769
 
776
770
  if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
777
771
    return(ho_error);
1063
1057
{
1064
1058
  char *tmp;
1065
1059
 
1066
 
  if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME))))
 
1060
  if (!(tmp=(char*) malloc(length*2+1)))
1067
1061
    die(EX_DRIZZLEERR, "Couldn't allocate memory");
1068
1062
 
1069
1063
  drizzle_escape_string(tmp, pos, length);
1487
1481
        verbose_msg("-- It's a view, create dummy table for view\n");
1488
1482
 
1489
1483
        /* save "show create" statement for later */
 
1484
        /* It's ok for scv_buff to be NULL here */
1490
1485
        if ((row= drizzle_fetch_row(result)) && (scv_buff=row[1]))
1491
 
          scv_buff= my_strdup(scv_buff, MYF(0));
 
1486
          scv_buff= strdup(scv_buff);
1492
1487
 
1493
1488
        drizzle_free_result(result);
1494
1489
 
3243
3238
  {
3244
3239
    char *end;
3245
3240
    /* result (terminating \0 is already in result_length) */
3246
 
    result= (char *)my_malloc(result_length + 10, MYF(MY_WME));
 
3241
    result= (char *)malloc(result_length + 10);
3247
3242
    if (!result)
3248
3243
    {
3249
3244
      fprintf(stderr, "Error: Not enough memory to store ORDER BY clause\n");