~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleslap.cc

  • Committer: lbieber
  • Date: 2010-09-07 22:29:56 UTC
  • mfrom: (1747.1.3 build)
  • Revision ID: lbieber@orisndriz03-20100907222956-d60u695b7hx3zs0d
Merge Andrew - bug 597778 - Timestamp cannot reliably store leap seconds, so don't try. Leave that to datetime only
Merge Andrew - bug 621862 - Add / clean-up error messages for unireg_abort
Merge Andrew - bug 629563 - Drop the broken --mysql options and Change the --protocol option to accept 'mysql' or 'drizzle' ('mysql' currently default)

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
 
136
136
static vector<string> user_supplied_queries;
137
137
static string opt_verbose;
 
138
std::string opt_protocol;
138
139
string delimiter;
139
140
 
140
141
string create_schema_string;
141
142
 
142
 
static bool opt_mysql;
 
143
static bool use_drizzle_protocol= false;
143
144
static bool opt_preserve= true;
144
145
static bool opt_only_print;
145
146
static bool opt_burnin;
925
926
 
926
927
    po::options_description client_options("Options specific to the client");
927
928
    client_options.add_options()
928
 
      ("mysql,m", po::value<bool>(&opt_mysql)->default_value(true)->zero_tokens(),
929
 
       N_("Use MySQL Protocol."))
930
929
      ("host,h",po::value<string>(&host)->default_value("localhost"),"Connect to the host")
931
930
      ("password,P",po::value<char *>(&password),
932
931
       "Password to use when connecting to server. If password is not given it's asked from the tty")
933
932
      ("port,p",po::value<uint32_t>(), "Port number to use for connection")
934
 
      ("protocol",po::value<string>(),
935
 
       "The protocol of connection (tcp,socket,pipe,memory).")
 
933
      ("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
 
934
       "The protocol of connection (mysql or drizzle).")
936
935
      ("user,u",po::value<string>(&user)->default_value(""),
937
936
       "User for login if not current user")  
938
937
      ;
993
992
      exit(0);
994
993
    }   
995
994
 
 
995
    if (vm.count("protocol"))
 
996
    {
 
997
      std::transform(opt_protocol.begin(), opt_protocol.end(),
 
998
        opt_protocol.begin(), ::tolower);
 
999
 
 
1000
      if (not opt_protocol.compare("mysql"))
 
1001
        use_drizzle_protocol=false;
 
1002
      else if (not opt_protocol.compare("drizzle"))
 
1003
        use_drizzle_protocol=true;
 
1004
      else
 
1005
      {
 
1006
        cout << _("Error: Unknown protocol") << " '" << opt_protocol << "'" << endl;
 
1007
        exit(-1);
 
1008
      }
 
1009
    }
996
1010
    if (vm.count("port")) 
997
1011
    {
998
1012
      temp_drizzle_port= vm["port"].as<uint32_t>();
2969
2983
    usleep(random()%opt_delayed_start);
2970
2984
 
2971
2985
  if ((drizzle= drizzle_create(NULL)) == NULL ||
2972
 
      drizzle_con_add_tcp(drizzle, con, host.c_str(), opt_drizzle_port, user.c_str(),
2973
 
                          opt_password.c_str(),
2974
 
                          connect_to_schema ? create_schema_string.c_str() : NULL,
2975
 
                          opt_mysql ? DRIZZLE_CON_MYSQL : DRIZZLE_CON_NONE) == NULL)
 
2986
      drizzle_con_add_tcp(drizzle, con, host.c_str(), opt_drizzle_port,
 
2987
        user.c_str(),
 
2988
        opt_password.c_str(),
 
2989
        connect_to_schema ? create_schema_string.c_str() : NULL,
 
2990
        use_drizzle_protocol ? DRIZZLE_CON_EXPERIMENTAL : DRIZZLE_CON_MYSQL) == NULL)
2976
2991
  {
2977
2992
    fprintf(stderr,"%s: Error creating drizzle object\n", internal::my_progname);
2978
2993
    exit(1);