~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Monty Taylor
  • Date: 2009-06-30 18:09:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1083.
  • Revision ID: mordred@inaugust.com-20090630180907-r24363hlhgxg4cbw
Whole boat-load of build fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
FILE *md_result_file= 0;
116
116
FILE *stderror_file= 0;
117
117
 
118
 
/*
119
 
  Constant for detection of default value of default_charset.
120
 
  If default_charset is equal to drizzle_universal_client_charset, then
121
 
  it is the default value which assigned at the very beginning of main().
122
 
*/
123
 
static const char *drizzle_universal_client_charset=
124
 
  DRIZZLE_UNIVERSAL_CLIENT_CHARSET;
125
 
static char *default_charset;
126
118
static const CHARSET_INFO *charset_info= &my_charset_utf8_general_ci;
127
119
 
128
120
const char *compatible_mode_names[]=
199
191
  {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
200
192
   (char**) &debug_info_flag, (char**) &debug_info_flag,
201
193
   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
202
 
  {"default-character-set", OPT_DEFAULT_CHARSET,
203
 
   "Set the default character set.", (char**) &default_charset,
204
 
   (char**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
205
194
  {"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED; ",
206
195
   (char**) &opt_delayed, (char**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
207
196
   0, 0},
402
391
 
403
392
static void print_version(void)
404
393
{
405
 
  printf(_("%s  Ver %s Distrib %s, for %s (%s)\n"),my_progname,DUMP_VERSION,
406
 
         drizzle_version(),SYSTEM_TYPE,MACHINE_TYPE);
 
394
  printf(_("%s  Ver %s Distrib %s, for %s-%s (%s)\n"),my_progname,DUMP_VERSION,
 
395
         drizzle_version(),HOST_VENDOR,HOST_OS,HOST_CPU);
407
396
} /* print_version */
408
397
 
409
398
 
455
444
    if (opt_comments)
456
445
    {
457
446
      fprintf(sql_file,
458
 
              "-- DRIZZLE dump %s  Distrib %s, for %s (%s)\n--\n",
459
 
              DUMP_VERSION, drizzle_version(), SYSTEM_TYPE, MACHINE_TYPE);
 
447
              "-- DRIZZLE dump %s  Distrib %s, for %s-%s (%s)\n--\n",
 
448
              DUMP_VERSION, drizzle_version(), HOST_VENDOR, HOST_OS, HOST_CPU);
460
449
      fprintf(sql_file, "-- Host: %s    Database: %s\n",
461
450
              current_host ? current_host : "localhost", db_name ? db_name :
462
451
              "");
467
456
    }
468
457
    if (opt_set_charset)
469
458
      fprintf(sql_file,
470
 
"\nSET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;"
471
 
"\nSET NAMES %s;\n",default_charset);
 
459
"\nSET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;\n");
472
460
 
473
461
    if (!path)
474
462
    {
680
668
      }
681
669
      if (end!=compatible_mode_normal_str)
682
670
        end[-1]= 0;
683
 
      /*
684
 
        Set charset to the default compiled value if it hasn't
685
 
        been reset yet by --default-character-set=xxx.
686
 
      */
687
 
      if (default_charset == drizzle_universal_client_charset)
688
 
        default_charset= (char*) DRIZZLE_DEFAULT_CHARSET_NAME;
689
 
      break;
690
671
    }
691
672
  }
692
673
  return 0;
739
720
            my_progname);
740
721
    return(EX_USAGE);
741
722
  }
742
 
  if (strcmp(default_charset, charset_info->csname) &&
743
 
      !(charset_info= get_charset_by_csname(default_charset, MY_CS_PRIMARY)))
744
 
    exit(1);
745
723
  if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs))
746
724
  {
747
725
    short_usage();
2858
2836
  drizzle_result_st result;
2859
2837
 
2860
2838
  compatible_mode_normal_str[0]= 0;
2861
 
  default_charset= (char *)drizzle_universal_client_charset;
2862
2839
  memset(&ignore_table, 0, sizeof(ignore_table));
2863
2840
 
2864
2841
  exit_code= get_options(&argc, &argv);