1234
1233
if (ret == DRIZZLE_RETURN_ERROR_CODE)
1236
fprintf(stderr, "shutdown failed; error: '%s'",
1235
fprintf(stderr, _("shutdown failed; error: '%s'"),
1237
1236
drizzle_result_error(&result));
1238
1237
drizzle_result_free(&result);
1242
fprintf(stderr, "shutdown failed; error: '%s'",
1241
fprintf(stderr, _("shutdown failed; error: '%s'"),
1243
1242
drizzle_con_error(&con));
1269
1268
if (drizzle_ping(&con, &result, &ret) != NULL && ret == DRIZZLE_RETURN_OK)
1271
1270
if (opt_silent < 2)
1272
printf("drizzled is alive\n");
1271
printf(_("drizzled is alive\n"));
1276
1275
if (ret == DRIZZLE_RETURN_ERROR_CODE)
1278
fprintf(stderr, "ping failed; error: '%s'",
1277
fprintf(stderr, _("ping failed; error: '%s'"),
1279
1278
drizzle_result_error(&result));
1280
1279
drizzle_result_free(&result);
1284
fprintf(stderr, "drizzled won't answer to ping, error: '%s'",
1283
fprintf(stderr, _("drizzled won't answer to ping, error: '%s'"),
1285
1284
drizzle_con_error(&con));
1708
if (vm.count("version"))
1710
printf(_("drizzle Ver %s Distrib %s, for %s-%s (%s) using readline %s\n"),
1711
VER.c_str(), drizzle_version(),
1712
HOST_VENDOR, HOST_OS, HOST_CPU,
1713
rl_library_version);
1718
if (vm.count("help"))
1709
if (vm.count("help") || vm.count("version"))
1720
printf(_("drizzle Ver %s Distrib %s, for %s-%s (%s) using readline %s\n"),
1721
VER.c_str(), drizzle_version(),
1711
printf(_("Drizzle client %s build %s, for %s-%s (%s) using readline %s\n"),
1712
drizzle_version(), VERSION,
1722
1713
HOST_VENDOR, HOST_OS, HOST_CPU,
1723
1714
rl_library_version);
1715
if (vm.count("version"))
1724
1717
printf(_("Copyright (C) 2008 Sun Microsystems\n"
1725
1718
"This software comes with ABSOLUTELY NO WARRANTY. "
1726
1719
"This is free software,\n"
1727
1720
"and you are welcome to modify and redistribute it "
1728
1721
"under the GPL license\n"));
1729
1722
printf(_("Usage: drizzle [OPTIONS] [database]\n"));
1723
cout << long_options;
3766
sprintf(buff,"Connection id: %u",drizzle_con_thread_id(&con));
3759
sprintf(buff, _("Connection id: %u"), drizzle_con_thread_id(&con));
3767
3760
put_info(buff,INFO_INFO,0,0);
3768
sprintf(buff,"Current database: %.128s\n",
3769
!current_db.empty() ? current_db.c_str() : "*** NONE ***");
3761
sprintf(buff, _("Current database: %.128s\n"),
3762
!current_db.empty() ? current_db.c_str() : _("*** NONE ***"));
3770
3763
put_info(buff,INFO_INFO,0,0);
4097
4090
drizzle_return_t ret;
4099
4092
tee_puts("--------------", stdout);
4100
printf(_("drizzle Ver %s Distrib %s, for %s-%s (%s) using readline %s\n"),
4101
VER.c_str(), drizzle_version(),
4102
HOST_VENDOR, HOST_OS, HOST_CPU,
4103
rl_library_version); /* Print version */
4093
printf(_("Drizzle client %s build %s, for %s-%s (%s) using readline %s\n"),
4094
drizzle_version(), VERSION,
4095
HOST_VENDOR, HOST_OS,
4096
rl_library_version);
4108
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",drizzle_con_thread_id(&con));
4100
tee_fprintf(stdout, _("\nConnection id:\t\t%lu\n"),drizzle_con_thread_id(&con));
4110
4102
Don't remove "limit 1",
4111
4103
it is protection againts SQL_SELECT_LIMIT=0
4117
4109
drizzle_row_t cur=drizzle_row_next(&result);
4120
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
4121
tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
4112
tee_fprintf(stdout, _("Current database:\t%s\n"), cur[0] ? cur[0] : "");
4113
tee_fprintf(stdout, _("Current user:\t\t%s\n"), cur[1]);
4123
4115
drizzle_result_free(&result);
4125
4117
else if (ret == DRIZZLE_RETURN_ERROR_CODE)
4126
4118
drizzle_result_free(&result);
4127
tee_puts("SSL:\t\t\tNot in use", stdout);
4119
tee_puts(_("SSL:\t\t\tNot in use"), stdout);
4131
4123
vidattr(A_BOLD);
4132
tee_fprintf(stdout, "\nNo connection\n");
4124
tee_fprintf(stdout, _("\nNo connection\n"));
4133
4125
vidattr(A_NORMAL);
4136
4128
if (skip_updates)
4138
4130
vidattr(A_BOLD);
4139
tee_fprintf(stdout, "\nAll updates ignored to this database\n");
4131
tee_fprintf(stdout, _("\nAll updates ignored to this database\n"));
4140
4132
vidattr(A_NORMAL);
4142
tee_fprintf(stdout, "Current pager:\t\t%s\n", pager.c_str());
4143
tee_fprintf(stdout, "Using outfile:\t\t'%s'\n", opt_outfile ? outfile.c_str() : "");
4144
tee_fprintf(stdout, "Using delimiter:\t%s\n", delimiter);
4145
tee_fprintf(stdout, "Server version:\t\t%s\n", server_version_string(&con));
4146
tee_fprintf(stdout, "Protocol version:\t%d\n", drizzle_con_protocol_version(&con));
4147
tee_fprintf(stdout, "Connection:\t\t%s\n", drizzle_con_host(&con));
4134
tee_fprintf(stdout, _("Current pager:\t\t%s\n"), pager.c_str());
4135
tee_fprintf(stdout, _("Using outfile:\t\t'%s'\n"), opt_outfile ? outfile.c_str() : "");
4136
tee_fprintf(stdout, _("Using delimiter:\t%s\n"), delimiter);
4137
tee_fprintf(stdout, _("Server version:\t\t%s\n"), server_version_string(&con));
4138
tee_fprintf(stdout, _("Protocol version:\t%d\n"), drizzle_con_protocol_version(&con));
4139
tee_fprintf(stdout, _("Connection:\t\t%s\n"), drizzle_con_host(&con));
4148
4140
/* XXX need to save this from result
4149
4141
if ((id= drizzleclient_insert_id(&drizzle)))
4150
4142
tee_fprintf(stdout, "Insert id:\t\t%s\n", internal::llstr(id, buff));
4153
4145
if (drizzle_con_uds(&con))
4154
tee_fprintf(stdout, "UNIX socket:\t\t%s\n", drizzle_con_uds(&con));
4146
tee_fprintf(stdout, _("UNIX socket:\t\t%s\n"), drizzle_con_uds(&con));
4156
tee_fprintf(stdout, "TCP port:\t\t%d\n", drizzle_con_port(&con));
4148
tee_fprintf(stdout, _("TCP port:\t\t%d\n"), drizzle_con_port(&con));
4158
4150
if (safe_updates)
4160
4152
vidattr(A_BOLD);
4161
tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n");
4153
tee_fprintf(stdout, _("\nNote that you are running in safe_update_mode:\n"));
4162
4154
vidattr(A_NORMAL);
4163
tee_fprintf(stdout, "\
4155
tee_fprintf(stdout, _("\
4164
4156
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\
4165
4157
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n \
4166
4158
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used.\n \
4167
Max number of examined row combination in a join is set to: %lu\n\n",
4159
Max number of examined row combination in a join is set to: %lu\n\n"),
4168
4160
select_limit, max_join_size);
4170
4162
tee_puts("--------------\n", stdout);
4268
(void) tee_fprintf(file, "ERROR %d (%s): ", error, sqlstate);
4260
(void) tee_fprintf(file, _("ERROR %d (%s): "), error, sqlstate);
4270
(void) tee_fprintf(file, "ERROR %d: ", error);
4262
(void) tee_fprintf(file, _("ERROR %d: "), error);
4273
tee_puts("ERROR: ", file);
4265
tee_puts(_("ERROR: "), file);
4276
4268
vidattr(A_BOLD);
4403
4395
tmp_buff_str << tmp;
4406
tmp_buff_str << " hours ";
4398
tmp_buff_str << _(" hours ");
4408
tmp_buff_str << " hour ";
4400
tmp_buff_str << _(" hour ");
4410
4402
if (sec >= 60.0)
4412
4404
tmp=(uint32_t) floor(sec/60.0);
4414
tmp_buff_str << tmp << " min ";
4406
tmp_buff_str << tmp << _(" min ");
4416
4408
if (part_second)
4417
4409
tmp_buff_str.precision(2);
4419
4411
tmp_buff_str.precision(0);
4420
tmp_buff_str << sec << " sec";
4412
tmp_buff_str << sec << _(" sec");
4421
4413
strcpy(buff, tmp_buff_str.str().c_str());
4639
4631
const char *ptr=strchr(line, ' ');
4640
4632
if (ptr == NULL)
4641
tee_fprintf(stdout, "Returning to default PROMPT of %s\n",
4633
tee_fprintf(stdout, _("Returning to default PROMPT of %s\n"),
4642
4634
default_prompt);
4643
4635
prompt_counter = 0;
4644
4636
char * tmpptr= strdup(ptr ? ptr+1 : default_prompt);
4645
4637
if (tmpptr == NULL)
4646
tee_fprintf(stdout, "Memory allocation error. Not changing prompt\n");
4638
tee_fprintf(stdout, _("Memory allocation error. Not changing prompt\n"));
4649
4641
current_prompt.erase();
4650
4642
current_prompt= tmpptr;
4651
tee_fprintf(stdout, "PROMPT set to '%s'\n", current_prompt.c_str());
4643
tee_fprintf(stdout, _("PROMPT set to '%s'\n"), current_prompt.c_str());