2848
static void do_change_user(struct st_command *command)
2848
static void do_change_user(struct st_command *)
2850
DRIZZLE *drizzle= &cur_con->drizzle;
2851
/* static keyword to make the NetWare compiler happy. */
2852
string ds_user, ds_passwd, ds_db;
2853
const struct command_arg change_user_args[] = {
2854
{ "user", ARG_STRING, false, &ds_user, "User to connect as" },
2855
{ "password", ARG_STRING, false, &ds_passwd, "Password used when connecting" },
2856
{ "database", ARG_STRING, false, &ds_db, "Database to select after connect" },
2861
check_command_args(command, command->first_argument,
2863
sizeof(change_user_args)/sizeof(struct command_arg),
2866
if (!ds_user.length())
2867
ds_user.append(drizzle->user);
2869
if (!ds_passwd.length())
2870
ds_passwd.append(drizzle->passwd);
2872
if (!ds_db.length())
2873
ds_db.append(drizzle->db);
2875
if (drizzleclient_change_user(drizzle, ds_user.c_str(),
2876
ds_passwd.c_str(), ds_db.c_str()))
2877
die("change user failed: %s", drizzleclient_error(drizzle));