Commit 337a20a8 authored by Jim Winstead's avatar Jim Winstead

The mysql command-line client did not properly handle MYSQL_HISTFILE being set

to an empty string, or to /dev/null, as we suggest and have suggested in the
documentation. (Bug #34224)
parent d1152362
...@@ -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)
......
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