~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Brian Aker
  • Date: 2011-01-02 05:13:03 UTC
  • mfrom: (2044.1.1 trunk-bug-628397)
  • Revision ID: brian@tangent.org-20110102051303-boac41qa2g1myorm
MErge in Andrew's patch for a mysql bug

Show diffs side-by-side

added added

removed removed

Lines of Context:
472
472
{
473
473
  int exit_code;
474
474
 
475
 
#if defined(ENABLE_NLS)
476
 
# if defined(HAVE_LOCALE_H)
477
 
  setlocale(LC_ALL, "");
478
 
# endif
479
 
  bindtextdomain("drizzle7", LOCALEDIR);
480
 
  textdomain("drizzle7");
481
 
#endif
482
 
 
483
 
  po::options_description commandline_options(_("Options used only in command line"));
 
475
  po::options_description commandline_options(N_("Options used only in command line"));
484
476
  commandline_options.add_options()
485
477
  ("all-databases,A", po::value<bool>(&opt_alldbs)->default_value(false)->zero_tokens(),
486
 
  _("Dump all the databases. This will be same as --databases with all databases selected."))
 
478
  N_("Dump all the databases. This will be same as --databases with all databases selected."))
487
479
  ("all-tablespaces,Y", po::value<bool>(&opt_alltspcs)->default_value(false)->zero_tokens(),
488
 
  _("Dump all the tablespaces."))
 
480
  N_("Dump all the tablespaces."))
489
481
  ("complete-insert,c", po::value<bool>(&opt_complete_insert)->default_value(false)->zero_tokens(),
490
 
  _("Use complete insert statements."))
 
482
  N_("Use complete insert statements."))
491
483
  ("flush-logs,F", po::value<bool>(&flush_logs)->default_value(false)->zero_tokens(),
492
 
  _("Flush logs file in server before starting dump. Note that if you dump many databases at once (using the option --databases= or --all-databases), the logs will be flushed for each database dumped. The exception is when using --lock-all-tables in this case the logs will be flushed only once, corresponding to the moment all tables are locked. So if you want your dump and the log flush to happen at the same exact moment you should use --lock-all-tables or --flush-logs"))
 
484
  N_("Flush logs file in server before starting dump. Note that if you dump many databases at once (using the option --databases= or --all-databases), the logs will be flushed for each database dumped. The exception is when using --lock-all-tables in this case the logs will be flushed only once, corresponding to the moment all tables are locked. So if you want your dump and the log flush to happen at the same exact moment you should use --lock-all-tables or --flush-logs"))
493
485
  ("force,f", po::value<bool>(&ignore_errors)->default_value(false)->zero_tokens(),
494
 
  _("Continue even if we get an sql-error."))
495
 
  ("help,?", _("Display this help message and exit."))
 
486
  N_("Continue even if we get an sql-error."))
 
487
  ("help,?", N_("Display this help message and exit."))
496
488
  ("lock-all-tables,x", po::value<bool>(&opt_lock_all_tables)->default_value(false)->zero_tokens(),
497
 
  _("Locks all tables across all databases. This is achieved by taking a global read lock for the duration of the whole dump. Automatically turns --single-transaction off."))
 
489
  N_("Locks all tables across all databases. This is achieved by taking a global read lock for the duration of the whole dump. Automatically turns --single-transaction off."))
498
490
  ("single-transaction", po::value<bool>(&opt_single_transaction)->default_value(false)->zero_tokens(),
499
 
  _("Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents), no other connection should use the following statements: ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not isolated from them."))
 
491
  N_("Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents), no other connection should use the following statements: ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not isolated from them."))
500
492
  ("skip-opt", 
501
 
  _("Disable --opt. Disables --add-drop-table, --add-locks, --create-options, ---extended-insert and --disable-keys."))    
502
 
  ("tables", _("Overrides option --databases (-B)."))
 
493
  N_("Disable --opt. Disables --add-drop-table, --add-locks, --create-options, ---extended-insert and --disable-keys."))    
 
494
  ("tables", N_("Overrides option --databases (-B)."))
503
495
  ("show-progress-size", po::value<uint32_t>(&show_progress_size)->default_value(10000),
504
 
  _("Number of rows before each output progress report (requires --verbose)."))
 
496
  N_("Number of rows before each output progress report (requires --verbose)."))
505
497
  ("verbose,v", po::value<bool>(&verbose)->default_value(false)->zero_tokens(),
506
 
  _("Print info about the various stages."))
507
 
  ("version,V", _("Output version information and exit."))
508
 
  ("skip-comments", _("Turn off Comments"))
509
 
  ("skip-create", _("Turn off create-options"))
510
 
  ("skip-extended-insert", _("Turn off extended-insert"))
511
 
  ("skip-dump-date", _( "Turn off dump date at the end of the output"))
512
 
  ("no-defaults", _("Do not read from the configuration files"))
 
498
  N_("Print info about the various stages."))
 
499
  ("version,V", N_("Output version information and exit."))
 
500
  ("skip-comments", N_("Turn off Comments"))
 
501
  ("skip-create", N_("Turn off create-options"))
 
502
  ("skip-extended-insert", N_("Turn off extended-insert"))
 
503
  ("skip-dump-date",N_( "Turn off dump date at the end of the output"))
 
504
  ("no-defaults", N_("Do not read from the configuration files"))
513
505
  ;
514
506
 
515
 
  po::options_description dump_options(_("Options specific to the drizzle client"));
 
507
  po::options_description dump_options(N_("Options specific to the drizzle client"));
516
508
  dump_options.add_options()
517
509
  ("add-drop-database", po::value<bool>(&opt_drop_database)->default_value(false)->zero_tokens(),
518
 
  _("Add a 'DROP DATABASE' before each create."))
519
 
  ("skip-drop-table", _("Do not add a 'drop table' before each create."))
 
510
  N_("Add a 'DROP DATABASE' before each create."))
 
511
  ("skip-drop-table", N_("Do not add a 'drop table' before each create."))
520
512
  ("compact", po::value<bool>(&opt_compact)->default_value(false)->zero_tokens(),
521
 
  _("Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs.  Enables options --skip-add-drop-table --no-set-names --skip-disable-keys"))
 
513
  N_("Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs.  Enables options --skip-add-drop-table --no-set-names --skip-disable-keys"))
522
514
  ("databases,B", po::value<bool>(&opt_databases)->default_value(false)->zero_tokens(),
523
 
  _("To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output."))
 
515
  N_("To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output."))
524
516
  ("skip-disable-keys,K",
525
 
  _("'ALTER TABLE tb_name DISABLE KEYS;' and 'ALTER TABLE tb_name ENABLE KEYS;' will not be put in the output."))
 
517
  N_("'ALTER TABLE tb_name DISABLE KEYS; and 'ALTER TABLE tb_name ENABLE KEYS; will not be put in the output."))
526
518
  ("ignore-table", po::value<string>(),
527
 
  _("Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table.  Each table must be specified with both database and table names, e.g. --ignore-table=database.table"))
 
519
  N_("Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table.  Each table must be specified with both database and table names, e.g. --ignore-table=database.table"))
528
520
  ("insert-ignore", po::value<bool>(&opt_ignore)->default_value(false)->zero_tokens(),
529
 
  _("Insert rows with INSERT IGNORE."))
 
521
  N_("Insert rows with INSERT IGNORE."))
530
522
  ("no-autocommit", po::value<bool>(&opt_autocommit)->default_value(false)->zero_tokens(),
531
 
  _("Wrap a table's data in START TRANSACTION/COMMIT statements."))
 
523
  N_("Wrap a table's data in START TRANSACTION/COMMIT statements."))
532
524
  ("no-create-db,n", po::value<bool>(&opt_create_db)->default_value(false)->zero_tokens(),
533
 
  _("'CREATE DATABASE IF NOT EXISTS db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given."))
 
525
  N_("'CREATE DATABASE IF NOT EXISTS db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given."))
534
526
  ("no-data,d", po::value<bool>(&opt_no_data)->default_value(false)->zero_tokens(),
535
 
  _("No row information."))
 
527
  N_("No row information."))
536
528
  ("replace", po::value<bool>(&opt_replace_into)->default_value(false)->zero_tokens(),
537
 
  _("Use REPLACE INTO instead of INSERT INTO."))
 
529
  N_("Use REPLACE INTO instead of INSERT INTO."))
538
530
  ("destination-type", po::value<string>()->default_value("stdout"),
539
 
  _("Where to send output to (stdout|database"))
 
531
  N_("Where to send output to (stdout|database"))
540
532
  ("destination-host", po::value<string>(&opt_destination_host)->default_value("localhost"),
541
 
  _("Hostname for destination db server (requires --destination-type=database)"))
 
533
  N_("Hostname for destination db server (requires --destination-type=database)"))
542
534
  ("destination-port", po::value<uint16_t>(&opt_destination_port)->default_value(4427),
543
 
  _("Port number for destination db server (requires --destination-type=database)"))
 
535
  N_("Port number for destination db server (requires --destination-type=database)"))
544
536
  ("destination-user", po::value<string>(&opt_destination_user),
545
 
  _("User name for destination db server (resquires --destination-type=database)"))
 
537
  N_("User name for destination db server (resquires --destination-type=database)"))
546
538
  ("destination-password", po::value<string>(&opt_destination_password),
547
 
  _("Password for destination db server (requires --destination-type=database)"))
 
539
  N_("Password for destination db server (requires --destination-type=database)"))
548
540
  ("destination-database", po::value<string>(&opt_destination_database),
549
 
  _("The database in the destination db server (requires --destination-type=database, not for use with --all-databases)"))
 
541
  N_("The database in the destination db server (requires --destination-type=database, not for use with --all-databases)"))
550
542
  ;
551
543
 
552
 
  po::options_description client_options(_("Options specific to the client"));
 
544
  po::options_description client_options(N_("Options specific to the client"));
553
545
  client_options.add_options()
554
546
  ("host,h", po::value<string>(&current_host)->default_value("localhost"),
555
 
  _("Connect to host."))
 
547
  N_("Connect to host."))
556
548
  ("password,P", po::value<string>(&password)->default_value(PASSWORD_SENTINEL),
557
 
  _("Password to use when connecting to server. If password is not given it's solicited on the tty."))
 
549
  N_("Password to use when connecting to server. If password is not given it's solicited on the tty."))
558
550
  ("port,p", po::value<uint32_t>(&opt_drizzle_port)->default_value(0),
559
 
  _("Port number to use for connection."))
 
551
  N_("Port number to use for connection."))
560
552
  ("user,u", po::value<string>(&current_user)->default_value(""),
561
 
  _("User for login if not current user."))
 
553
  N_("User for login if not current user."))
562
554
  ("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
563
 
  _("The protocol of connection (mysql or drizzle)."))
 
555
  N_("The protocol of connection (mysql or drizzle)."))
564
556
  ;
565
557
 
566
 
  po::options_description hidden_options(_("Hidden Options"));
 
558
  po::options_description hidden_options(N_("Hidden Options"));
567
559
  hidden_options.add_options()
568
 
  ("database-used", po::value<vector<string> >(), _("Used to select the database"))
569
 
  ("Table-used", po::value<vector<string> >(), _("Used to select the tables"))
 
560
  ("database-used", po::value<vector<string> >(), N_("Used to select the database"))
 
561
  ("Table-used", po::value<vector<string> >(), N_("Used to select the tables"))
570
562
  ;
571
563
 
572
 
  po::options_description all_options(_("Allowed Options + Hidden Options"));
 
564
  po::options_description all_options(N_("Allowed Options + Hidden Options"));
573
565
  all_options.add(commandline_options).add(dump_options).add(client_options).add(hidden_options);
574
566
 
575
 
  po::options_description long_options(_("Allowed Options"));
 
567
  po::options_description long_options(N_("Allowed Options"));
576
568
  long_options.add(commandline_options).add(dump_options).add(client_options);
577
569
 
578
570
  std::string system_config_dir_dump(SYSCONFDIR);