Cleanups...

parent db56853b
......@@ -2212,14 +2212,14 @@ com_status(String *buffer __attribute__((unused)),
if (safe_updates)
{
vidattr(A_BOLD);
tee_fprintf(stdout, "\nNote that we are running in safe_update_mode:\n");
tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n");
vidattr(A_NORMAL);
tee_fprintf(stdout, "\
UPDATE and DELETE that doesn't use a key in the WHERE clause are not allowed\n\
(One can force UPDATE/DELETE by adding LIMIT # at the end of the command)\n\
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used\n\
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n\
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used.\n\
Max number of examined row combination in a join is set to: %lu\n\n",
select_limit,max_join_size);
select_limit, max_join_size);
}
tee_puts("--------------\n", stdout);
return 0;
......
......@@ -145,19 +145,36 @@ struct st_query
uint expected_errno[MAX_EXPECTED_ERRORS];
char record_file[FN_REFLEN];
/* Add new commands before Q_UNKNOWN */
enum { Q_CONNECTION=1, Q_QUERY, Q_CONNECT,
Q_SLEEP, Q_INC, Q_DEC,Q_SOURCE,
Q_DISCONNECT,Q_LET, Q_ECHO, Q_WHILE, Q_END_BLOCK,
Q_SYSTEM, Q_RESULT, Q_REQUIRE, Q_SAVE_MASTER_POS,
Q_SYNC_WITH_MASTER, Q_ERROR, Q_SEND, Q_REAP, Q_DIRTY_CLOSE,
Q_REPLACE,
Q_UNKNOWN, Q_COMMENT, Q_COMMENT_WITH_COMMAND} type;
enum { Q_CONNECTION=1, Q_QUERY,
Q_CONNECT, Q_SLEEP,
Q_INC, Q_DEC,
Q_SOURCE, Q_DISCONNECT,
Q_LET, Q_ECHO,
Q_WHILE, Q_END_BLOCK,
Q_SYSTEM, Q_RESULT,
Q_REQUIRE, Q_SAVE_MASTER_POS,
Q_SYNC_WITH_MASTER, Q_ERROR,
Q_SEND, Q_REAP,
Q_DIRTY_CLOSE, Q_REPLACE,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
} type;
};
const char *command_names[] = {
"connection", "query","connect","sleep","inc","dec","source","disconnect",
"let","echo","while","end","system","result", "require", "save_master_pos",
"sync_with_master", "error", "send", "reap", "dirty_close", "replace_result", 0
"connection", "query",
"connect", "sleep",
"inc", "dec",
"source", "disconnect",
"let", "echo",
"while", "end",
"system", "result",
"require", "save_master_pos",
"sync_with_master", "error",
"send", "reap",
"dirty_close", "replace_result",
0
};
TYPELIB command_typelib= {array_elements(command_names),"",
......@@ -873,9 +890,9 @@ int do_connect(struct st_query* q)
p = safe_get_param(p, &con_pass, "missing connection password");
p = safe_get_param(p, &con_db, "missing connection db");
p = safe_get_param(p, &con_port_str, "missing connection port");
p = safe_get_param(p, &con_sock, "missing connection scoket");
p = safe_get_param(p, &con_sock, "missing connection socket");
if (next_con == cons_end)
die("Connection limit exhausted - incread MAX_CONS in mysqltest.c");
die("Connection limit exhausted - increase MAX_CONS in mysqltest.c");
if (!mysql_init(&next_con->mysql))
die("Failed on mysql_init()");
......@@ -914,7 +931,7 @@ int do_while(struct st_query* q)
char* expr_start, *expr_end;
VAR v;
if (cur_block == block_stack_end)
die("Nesting too deep");
die("Nesting too deeply");
if (!block_ok)
{
++false_block_depth;
......@@ -1204,23 +1221,23 @@ int read_query(struct st_query** q_ptr)
struct option long_options[] =
{
{"debug", optional_argument, 0, '#'},
{"database", required_argument, 0, 'D'},
{"help", no_argument, 0, '?'},
{"host", required_argument, 0, 'h'},
{"password", optional_argument, 0, 'p'},
{"port", required_argument, 0, 'P'},
{"quiet", no_argument, 0, 'q'},
{"record", no_argument, 0, 'r'},
{"debug", optional_argument, 0, '#'},
{"database", required_argument, 0, 'D'},
{"help", no_argument, 0, '?'},
{"host", required_argument, 0, 'h'},
{"password", optional_argument, 0, 'p'},
{"port", required_argument, 0, 'P'},
{"quiet", no_argument, 0, 'q'},
{"record", no_argument, 0, 'r'},
{"result-file", required_argument, 0, 'R'},
{"silent", no_argument, 0, 'q'},
{"sleep", required_argument, 0, 'T'},
{"socket", required_argument, 0, 'S'},
{"tmpdir", required_argument, 0, 't'},
{"user", required_argument, 0, 'u'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{0, 0,0,0}
{"silent", no_argument, 0, 'q'},
{"sleep", required_argument, 0, 'T'},
{"socket", required_argument, 0, 'S'},
{"tmpdir", required_argument, 0, 't'},
{"user", required_argument, 0, 'u'},
{"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'},
{0, 0, 0, 0}
};
......
......@@ -369,7 +369,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt)
MI_NAME_DEXT, 4), MYF(MY_WME)))
{
error = HA_ADMIN_FAILED;
errmsg = "failed in my_copy( Error %d)";
errmsg = "Failed in my_copy (Error %d)";
goto err;
}
......@@ -402,7 +402,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
if (!fn_format(dst_path, table_name, backup_dir, reg_ext, 4 + 64))
{
errmsg = "failed in fn_format() for .frm file: errno=%d";
errmsg = "Failed in fn_format() for .frm file: errno = %d";
error = HA_ADMIN_INVALID;
goto err;
}
......@@ -418,7 +418,7 @@ int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt)
if (!fn_format(dst_path, table_name, backup_dir, MI_NAME_DEXT, 4 + 64))
{
errmsg = "failed in fn_format() for .MYD file: errno=%d";
errmsg = "Failed in fn_format() for .MYD file: errno = %d";
error = HA_ADMIN_INVALID;
goto err;
}
......@@ -470,7 +470,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
if (param.retry_without_quick && param.opt_rep_quick)
{
param.opt_rep_quick=0;
sql_print_error("Warning: Retrying repair of: '%s' without quick",
sql_print_error("Warning: Retrying repair of: '%s' without quick",
table->path);
continue;
}
......@@ -478,7 +478,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
if ((param.testflag & T_REP_BY_SORT))
{
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
sql_print_error("Warning: Retrying repair of: '%s' with keycache",
sql_print_error("Warning: Retrying repair of: '%s' with keycache",
table->path);
continue;
}
......@@ -579,7 +579,7 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool optimize)
error = chk_key(&param, file);
}
}
thd->proc_info="saving state";
thd->proc_info="Saving state";
if (!error)
{
if ((share->state.changed & STATE_CHANGED) || mi_is_crashed(file))
......@@ -636,7 +636,7 @@ bool ha_myisam::activate_all_index(THD *thd)
if (share->state.key_map != ((ulonglong) 1L << share->base.keys)-1)
{
const char *save_proc_info=thd->proc_info;
thd->proc_info="creating index";
thd->proc_info="Creating index";
myisamchk_init(&param);
param.op_name = (char*) "recreating_index";
param.testflag = (T_SILENT | T_REP_BY_SORT |
......
This diff is collapsed.
......@@ -379,7 +379,7 @@ static int create_table_from_dump(THD* thd, NET* net, const char* db,
check_opt.init();
check_opt.flags|= T_VERY_SILENT;
check_opt.quick = 1;
thd->proc_info = "rebuilding the index on master dump table";
thd->proc_info = "Rebuilding the index on master dump table";
Vio* save_vio = thd->net.vio;
// we do not want repair() to spam us with messages
// just send them to the error log, and report the failure in case of
......@@ -1027,7 +1027,7 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
if(!sql_error)
sql_error = ER_UNKNOWN_ERROR;
sql_print_error("Slave: error '%s' running load data infile ",
sql_print_error("Slave: Error '%s' running load data infile ",
ER(sql_error));
delete ev;
free_root(&thd->mem_root,0);
......@@ -1106,8 +1106,10 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
}
else
{
sql_print_error("Could not parse log event entry, check the master for binlog corruption\n\
This may also be a network problem, or just a bug in the master or slave code");
sql_print_error("\
Could not parse log event entry, check the master for binlog corruption\n\
This may also be a network problem, or just a bug in the master or slave code.\
");
return 1;
}
return 0;
......@@ -1173,7 +1175,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
goto err;
}
thd->proc_info = "connecting to master";
thd->proc_info = "Connecting to master";
#ifndef DBUG_OFF
sql_print_error("Slave thread initialized");
#endif
......@@ -1189,14 +1191,14 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
while (!slave_killed(thd))
{
thd->proc_info = "requesting binlog dump";
thd->proc_info = "Requesting binlog dump";
if(request_dump(mysql, &glob_mi))
{
sql_print_error("Failed on request_dump()");
if(slave_killed(thd))
goto err;
thd->proc_info = "waiting to reconnect after a failed dump request";
thd->proc_info = "Waiting to reconnect after a failed dump request";
if(mysql->net.vio)
vio_close(mysql->net.vio);
// first time retry immediately, assuming that we can recover
......@@ -1210,7 +1212,7 @@ pthread_handler_decl(handle_slave,arg __attribute__((unused)))
if(slave_killed(thd))
goto err;
thd->proc_info = "reconnecting after a failed dump request";
thd->proc_info = "Reconnecting after a failed dump request";
sql_print_error("Slave: failed dump request, reconnecting to \
try again, log '%s' at postion %ld", RPL_LOG_NAME,
last_failed_pos = glob_mi.pos );
......@@ -1223,14 +1225,14 @@ try again, log '%s' at postion %ld", RPL_LOG_NAME,
while(!slave_killed(thd))
{
thd->proc_info = "reading master update";
thd->proc_info = "Reading master update";
uint event_len = read_event(mysql, &glob_mi);
if(slave_killed(thd))
goto err;
if (event_len == packet_error)
{
thd->proc_info = "waiting to reconnect after a failed read";
thd->proc_info = "Waiting to reconnect after a failed read";
if(mysql->net.vio)
vio_close(mysql->net.vio);
if(retried_once) // punish repeat offender with sleep
......@@ -1240,7 +1242,7 @@ try again, log '%s' at postion %ld", RPL_LOG_NAME,
if(slave_killed(thd))
goto err;
thd->proc_info = "reconnecting after a failed read";
thd->proc_info = "Reconnecting after a failed read";
sql_print_error("Slave: Failed reading log event, \
reconnecting to retry, log '%s' position %ld", RPL_LOG_NAME,
last_failed_pos = glob_mi.pos);
......@@ -1249,7 +1251,7 @@ reconnecting to retry, log '%s' position %ld", RPL_LOG_NAME,
break;
}
thd->proc_info = "processing master log event";
thd->proc_info = "Processing master log event";
if(exec_event(thd, &mysql->net, &glob_mi, event_len))
{
sql_print_error("\
......@@ -1303,7 +1305,7 @@ position %ld",
thd->query = thd->db = 0; // extra safety
if(mysql)
mc_mysql_close(mysql);
thd->proc_info = "waiting for slave mutex on exit";
thd->proc_info = "Waiting for slave mutex on exit";
pthread_mutex_lock(&LOCK_slave);
slave_running = 0;
abort_slave = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment