From 337a20a800d98672ce3693e3ab52d578b95b8bdb Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Thu, 7 May 2009 17:48:20 -0700 Subject: [PATCH] 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) --- client/mysql.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index d29bd8571c9..8de3cfee041 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1183,7 +1183,12 @@ int main(int argc,char *argv[]) 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) tee_fprintf(stdout, "Reading history-file %s\n",histfile); @@ -1218,7 +1223,8 @@ sig_handler mysql_end(int sig) { mysql_close(&mysql); #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 */ if (verbose)