~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Brian Aker
  • Date: 2010-12-07 09:12:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1985.
  • Revision ID: brian@tangent.org-20101207091212-1m0w20tck6z7632m
This is a fix for bug lp:686197

Show diffs side-by-side

added added

removed removed

Lines of Context:
1386
1386
  N_("Password to use when connecting to server. If password is not given it's asked from the tty."))
1387
1387
  ("port,p", po::value<uint32_t>()->default_value(0),
1388
1388
  N_("Port number to use for connection or 0 for default to, in order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, built-in default"))
1389
 
#ifdef DRIZZLE_ADMIN_TOOL
1390
 
  ("user,u", po::value<string>(&current_user)->default_value("root"),
1391
 
#else
1392
1389
  ("user,u", po::value<string>(&current_user)->default_value(""),
1393
 
#endif
1394
1390
  N_("User for login if not current user."))
1395
1391
  ("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
1396
1392
  N_("The protocol of connection (mysql or drizzle)."))
1450
1446
 
1451
1447
  po::notify(vm);
1452
1448
 
1453
 
#ifdef DRIZZLE_ADMIN_TOOL
1454
 
  default_prompt= strdup(getenv("DRIZZLE_PS1") ?
1455
 
                         getenv("DRIZZLE_PS1") :
1456
 
                         "drizzleadmin> ");
1457
 
#else
1458
1449
  default_prompt= strdup(getenv("DRIZZLE_PS1") ?
1459
1450
                         getenv("DRIZZLE_PS1") :
1460
1451
                         "drizzle> ");
1461
 
#endif
1462
1452
  if (default_prompt == NULL)
1463
1453
  {
1464
1454
    fprintf(stderr, _("Memory allocation error while constructing initial "
4045
4035
    drizzle_free(&drizzle);
4046
4036
  }
4047
4037
  drizzle_create(&drizzle);
4048
 
 
4049
 
#ifdef DRIZZLE_ADMIN_TOOL
4050
 
  drizzle_con_options_t options= (drizzle_con_options_t) (DRIZZLE_CON_ADMIN | (use_drizzle_protocol ? DRIZZLE_CON_EXPERIMENTAL : DRIZZLE_CON_MYSQL));
4051
 
#else
4052
 
  drizzle_con_options_t options= (drizzle_con_options_t) (use_drizzle_protocol ? DRIZZLE_CON_EXPERIMENTAL : DRIZZLE_CON_MYSQL);
4053
 
#endif
4054
 
 
4055
4038
  if (drizzle_con_add_tcp(&drizzle, &con, (char *)host.c_str(),
4056
4039
    opt_drizzle_port, (char *)user.c_str(),
4057
4040
    (char *)password.c_str(), (char *)database.c_str(),
4058
 
    options) == NULL)
 
4041
    use_drizzle_protocol ? DRIZZLE_CON_EXPERIMENTAL : DRIZZLE_CON_MYSQL) == NULL)
4059
4042
  {
4060
4043
    (void) put_error(&con, NULL);
4061
4044
    (void) fflush(stdout);