~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Monty Taylor
  • Date: 2011-03-11 23:40:27 UTC
  • mfrom: (2230.1.3 build)
  • Revision ID: mordred@inaugust.com-20110311234027-0zjpw2l4ivqfluwr
Merged Brian: New 5.5 auth support.
Merged Dave: Slave admin docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
/* Buffer to hold 'version' and 'version_comment' */
165
165
const int MAX_SERVER_VERSION_LENGTH= 128;
166
166
 
 
167
/* Options used during connect */
 
168
drizzle_con_options_t global_con_options= DRIZZLE_CON_NONE;
 
169
 
167
170
#define PROMPT_CHAR '\\'
168
171
 
169
172
class Status
1488
1491
#endif
1489
1492
  _("User for login if not current user."))
1490
1493
  ("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
1491
 
  _("The protocol of connection (mysql or drizzle)."))
 
1494
  _("The protocol of connection (mysql, mysql-plugin-auth, or drizzle)."))
1492
1495
  ;
1493
1496
 
1494
1497
  po::options_description long_options(_("Allowed Options"));
1704
1707
      opt_protocol.begin(), ::tolower);
1705
1708
 
1706
1709
    if (not opt_protocol.compare("mysql"))
1707
 
      use_drizzle_protocol=false;
 
1710
    {
 
1711
 
 
1712
      global_con_options= (drizzle_con_options_t)(DRIZZLE_CON_MYSQL|DRIZZLE_CON_INTERACTIVE);
 
1713
      use_drizzle_protocol= false;
 
1714
    }
 
1715
    else if (not opt_protocol.compare("mysql-plugin-auth"))
 
1716
    {
 
1717
      global_con_options= (drizzle_con_options_t)(DRIZZLE_CON_MYSQL|DRIZZLE_CON_INTERACTIVE|DRIZZLE_CON_AUTH_PLUGIN);
 
1718
      use_drizzle_protocol= false;
 
1719
    }
1708
1720
    else if (not opt_protocol.compare("drizzle"))
1709
 
      use_drizzle_protocol=true;
 
1721
    {
 
1722
      global_con_options= (drizzle_con_options_t)(DRIZZLE_CON_EXPERIMENTAL);
 
1723
      use_drizzle_protocol= true;
 
1724
    }
1710
1725
    else
1711
1726
    {
1712
1727
      cout << _("Error: Unknown protocol") << " '" << opt_protocol << "'" << endl;
1950
1965
  drizzle_return_t ret;
1951
1966
 
1952
1967
  /* terminate if no query being executed, or we already tried interrupting */
1953
 
  if (!executing_query || interrupted_query) {
 
1968
  if (!executing_query || interrupted_query)
 
1969
  {
1954
1970
    goto err;
1955
1971
  }
1956
1972
 
4224
4240
  drizzle_create(&drizzle);
4225
4241
 
4226
4242
#ifdef DRIZZLE_ADMIN_TOOL
4227
 
  drizzle_con_options_t options= (drizzle_con_options_t) (DRIZZLE_CON_ADMIN | (use_drizzle_protocol ? DRIZZLE_CON_EXPERIMENTAL : DRIZZLE_CON_MYSQL|DRIZZLE_CON_INTERACTIVE));
4228
 
#else
4229
 
  drizzle_con_options_t options= (drizzle_con_options_t) (use_drizzle_protocol ? DRIZZLE_CON_EXPERIMENTAL : DRIZZLE_CON_MYSQL|DRIZZLE_CON_INTERACTIVE);
 
4243
  global_con_options= (drizzle_con_options_t) (DRIZZLE_CON_ADMIN | global_con_options);
4230
4244
#endif
4231
4245
 
4232
4246
  if (drizzle_con_add_tcp(&drizzle, &con, (char *)host.c_str(),
4233
4247
                          opt_drizzle_port, (char *)user.c_str(),
4234
4248
                          (char *)password.c_str(), (char *)database.c_str(),
4235
 
                          options) == NULL)
 
4249
                          global_con_options) == NULL)
4236
4250
  {
4237
4251
    (void) put_error(&con, NULL);
4238
4252
    (void) fflush(stdout);