Commit 10611fe6 authored by Jim Winstead's avatar Jim Winstead

Merge in approved bug-fixes

parents bd596287 d0a1de80
...@@ -1183,7 +1183,12 @@ int main(int argc,char *argv[]) ...@@ -1183,7 +1183,12 @@ int main(int argc,char *argv[])
histfile= 0; histfile= 0;
} }
} }
if (histfile)
/* We used to suggest setting MYSQL_HISTFILE=/dev/null. */
if (histfile && strncmp(histfile, "/dev/null", 10) == 0)
histfile= NULL;
if (histfile && histfile[0])
{ {
if (verbose) if (verbose)
tee_fprintf(stdout, "Reading history-file %s\n",histfile); tee_fprintf(stdout, "Reading history-file %s\n",histfile);
...@@ -1218,7 +1223,8 @@ sig_handler mysql_end(int sig) ...@@ -1218,7 +1223,8 @@ sig_handler mysql_end(int sig)
{ {
mysql_close(&mysql); mysql_close(&mysql);
#ifdef HAVE_READLINE #ifdef HAVE_READLINE
if (!status.batch && !quick && !opt_html && !opt_xml && histfile) if (!status.batch && !quick && !opt_html && !opt_xml &&
histfile && histfile[0])
{ {
/* write-history */ /* write-history */
if (verbose) if (verbose)
......
...@@ -231,6 +231,8 @@ get_one_option(int optid, const struct my_option *opt, ...@@ -231,6 +231,8 @@ get_one_option(int optid, const struct my_option *opt,
break; break;
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
tty_password= 1; tty_password= 1;
add_option= FALSE; add_option= FALSE;
if (argument) if (argument)
......
...@@ -232,6 +232,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -232,6 +232,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_count_iterations= 1; opt_count_iterations= 1;
break; break;
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
char *start=argument; char *start=argument;
...@@ -677,10 +679,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -677,10 +679,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
pos=argv[1]; pos=argv[1];
for (;;) for (;;)
{ {
if (mysql_kill(mysql,(ulong) atol(pos))) /* We don't use mysql_kill(), since it only handles 32-bit IDs. */
char buff[26], *out; /* "KILL " + max 20 digs + NUL */
out= strxmov(buff, "KILL ", NullS);
ullstr(strtoull(pos, NULL, 0), out);
if (mysql_query(mysql, buff))
{ {
my_printf_error(0, "kill failed on %ld; error: '%s'", error_flags, /* out still points to just the number */
atol(pos), mysql_error(mysql)); my_printf_error(0, "kill failed on %s; error: '%s'", error_flags,
out, mysql_error(mysql));
error=1; error=1;
} }
if (!(pos=strchr(pos,','))) if (!(pos=strchr(pos,',')))
......
...@@ -1226,6 +1226,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -1226,6 +1226,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
one_database = 1; one_database = 1;
break; break;
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
my_free(pass,MYF(MY_ALLOW_ZERO_PTR)); my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
......
...@@ -286,6 +286,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -286,6 +286,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
what_to_do= DO_UPGRADE; what_to_do= DO_UPGRADE;
break; break;
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
char *start = argument; char *start = argument;
......
...@@ -702,6 +702,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -702,6 +702,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
#endif #endif
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
char *start=argument; char *start=argument;
......
...@@ -221,6 +221,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -221,6 +221,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
#endif #endif
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
char *start=argument; char *start=argument;
......
...@@ -281,6 +281,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -281,6 +281,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_verbose++; opt_verbose++;
break; break;
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
char *start=argument; char *start=argument;
......
...@@ -712,6 +712,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -712,6 +712,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
verbose++; verbose++;
break; break;
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
char *start= argument; char *start= argument;
......
...@@ -5803,6 +5803,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -5803,6 +5803,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
} }
case 'p': case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; // Don't require password
if (argument) if (argument)
{ {
my_free(opt_pass, MYF(MY_ALLOW_ZERO_PTR)); my_free(opt_pass, MYF(MY_ALLOW_ZERO_PTR));
......
...@@ -224,7 +224,7 @@ int main(int argc, char **argv) ...@@ -224,7 +224,7 @@ int main(int argc, char **argv)
} }
else if (verbose) else if (verbose)
{ {
printf("file %s= %llu bytes (%lu pages)...\n", argv[1], size, pages); printf("file %s = %llu bytes (%lu pages)...\n", argv[optind], size, pages);
printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1)); printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1));
} }
......
...@@ -27,8 +27,8 @@ $opt_f= 0; ...@@ -27,8 +27,8 @@ $opt_f= 0;
$opt_t= 0; $opt_t= 0;
$opt_a = ""; $opt_a = "";
$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin'; $BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4";
$LINUX = $^O eq 'linux'; $LINUX = $^O eq 'linux' || $^O eq 'darwin';
$pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; $pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef";
open(TTYIN, "</dev/tty") || die "can't read /dev/tty: $!"; open(TTYIN, "</dev/tty") || die "can't read /dev/tty: $!";
......
...@@ -391,8 +391,8 @@ then ...@@ -391,8 +391,8 @@ then
fi fi
# Change the err log to the right user, if it is in use # Change the err log to the right user, if it is in use
if [ $want_syslog -eq 0 ]; then if [ $want_syslog -eq 0 ]; then
touch $err_log touch "$err_log"
chown $user $err_log chown $user "$err_log"
fi fi
if test -n "$open_files" if test -n "$open_files"
then then
...@@ -509,9 +509,9 @@ fi ...@@ -509,9 +509,9 @@ fi
# #
# If there exists an old pid file, check if the daemon is already running # If there exists an old pid file, check if the daemon is already running
# Note: The switches to 'ps' may depend on your operating system # Note: The switches to 'ps' may depend on your operating system
if test -f $pid_file if test -f "$pid_file"
then then
PID=`cat $pid_file` PID=`cat "$pid_file"`
if @CHECK_PID@ if @CHECK_PID@
then then
if @FIND_PROC@ if @FIND_PROC@
...@@ -520,8 +520,8 @@ then ...@@ -520,8 +520,8 @@ then
exit 1 exit 1
fi fi
fi fi
rm -f $pid_file rm -f "$pid_file"
if test -f $pid_file if test -f "$pid_file"
then then
log_error "Fatal error: Can't remove the pid file: log_error "Fatal error: Can't remove the pid file:
$pid_file $pid_file
...@@ -563,11 +563,11 @@ test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" ...@@ -563,11 +563,11 @@ test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null"
log_notice "Starting $MYSQLD daemon with databases from $DATADIR" log_notice "Starting $MYSQLD daemon with databases from $DATADIR"
while true while true
do do
rm -f $safe_mysql_unix_port $pid_file # Some extra safety rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety
eval_log_error "$cmd" eval_log_error "$cmd"
if test ! -f $pid_file # This is removed if normal shutdown if test ! -f "$pid_file" # This is removed if normal shutdown
then then
break break
fi fi
......
...@@ -163,7 +163,14 @@ Parse and summarize the MySQL slow query log. Options are ...@@ -163,7 +163,14 @@ Parse and summarize the MySQL slow query log. Options are
-v verbose -v verbose
-d debug -d debug
-s ORDER what to sort by (al, at, ar, c, t, l, r), 'at' is default -s ORDER what to sort by (al, at, ar, c, l, r, t), 'at' is default
al: average lock time
ar: average rows sent
at: average query time
c: count
l: lock time
r: rows sent
t: query time
-r reverse the sort order (largest last instead of first) -r reverse the sort order (largest last instead of first)
-t NUM just show the top n queries -t NUM just show the top n queries
-a don't abstract all numbers to N and strings to 'S' -a don't abstract all numbers to N and strings to 'S'
......
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