~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Stewart Smith
  • Date: 2010-12-29 00:10:33 UTC
  • mfrom: (2037 clean)
  • mto: (2099.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2100.
  • Revision ID: stewart@flamingspork.com-20101229001033-ef5dixj4fq4x64fr
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
      opt_destination_port, opt_destination_user, opt_destination_password,
201
201
      false);
202
202
  }
203
 
  catch (...)
 
203
  catch (std::exception&)
204
204
  {
205
205
    cerr << "Could not connect to destination database server" << endl;
206
206
    maybe_exit(EX_DRIZZLEERR);
225
225
      DrizzleDumpDatabase *database= *i;
226
226
      sout << *database;
227
227
    }
228
 
    catch (...)
 
228
    catch (std::exception&)
229
229
    {
230
230
      std::cout << _("Error inserting into destination database") << std::endl;
231
231
      if (not ignore_errors)
575
575
 
576
576
  std::string user_config_dir((getenv("XDG_CONFIG_HOME")? getenv("XDG_CONFIG_HOME"):"~/.config"));
577
577
 
 
578
  if (user_config_dir.compare(0, 2, "~/") == 0)
 
579
  {
 
580
    char *homedir;
 
581
    homedir= getenv("HOME");
 
582
    if (homedir != NULL)
 
583
      user_config_dir.replace(0, 1, homedir);
 
584
  }
 
585
 
578
586
  po::positional_options_description p;
579
587
  p.add("database-used", 1);
580
588
  p.add("Table-used",-1);
746
754
    db_connection = new DrizzleDumpConnection(current_host, opt_drizzle_port,
747
755
      current_user, opt_password, use_drizzle_protocol);
748
756
  }
749
 
  catch (...)
 
757
  catch (std::exception&)
750
758
  {
751
759
    maybe_exit(EX_DRIZZLEERR);
752
760
  }
793
801
    dump_selected_tables(database_used, vm["Table-used"].as< vector<string> >());
794
802
  }
795
803
 
796
 
  if (vm.count("Table-used") && opt_databases)
 
804
  if (vm.count("Table-used") and opt_databases)
797
805
  {
798
 
/*
799
 
 * This is not valid!
800
806
    vector<string> database_used= vm["database-used"].as< vector<string> >();
801
807
    vector<string> table_used= vm["Table-used"].as< vector<string> >();
802
808
 
806
812
    {
807
813
      database_used.insert(database_used.end(), *it);
808
814
    }
 
815
 
809
816
    dump_databases(database_used);
810
 
    dump_tables();
811
 
*/
 
817
    dump_all_tables();
812
818
  }
813
 
  
 
819
 
814
820
  if (vm.count("database-used") && ! vm.count("Table-used"))
815
821
  {
816
822
    dump_databases(vm["database-used"].as< vector<string> >());
817
823
    dump_all_tables();
818
824
  }
 
825
 
819
826
  if (opt_destination == DESTINATION_STDOUT)
820
827
    generate_dump();
821
828
  else