diff options
author | Jim Winstead <jimw@mysql.com> | 2009-05-07 17:48:20 -0700 |
---|---|---|
committer | Jim Winstead <jimw@mysql.com> | 2009-05-07 17:48:20 -0700 |
commit | 337a20a800d98672ce3693e3ab52d578b95b8bdb (patch) | |
tree | 7312cd3657fd7031bed9d6eb1c5ba40eab7aa317 | |
parent | d11523624832dc4dc802e412bc4e933a1c99453d (diff) | |
download | mariadb-git-337a20a800d98672ce3693e3ab52d578b95b8bdb.tar.gz |
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)
-rw-r--r-- | client/mysql.cc | 10 |
1 files 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) |