summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-05-09 13:27:57 +0200
committerunknown <msvensson@neptunus.(none)>2006-05-09 13:27:57 +0200
commit280131a052ec9c33a6b46aa49b6d9e426aee1aba (patch)
treed25c1c4866b625d433ac382ebd4c6255bdd2b72d
parent2076c7225ccd3495f04f53ba14571122d7798f43 (diff)
parent008cfe116355032ce4a3ca77e421fb948eb6c96f (diff)
downloadmariadb-git-280131a052ec9c33a6b46aa49b6d9e426aee1aba.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
-rw-r--r--client/mysql.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 7b46aaf67ce..dcf80ff2b0b 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -448,6 +448,14 @@ int main(int argc,char *argv[])
MYF(MY_WME));
if (histfile)
sprintf(histfile,"%s/.mysql_history",getenv("HOME"));
+ char link_name[FN_REFLEN];
+ if (my_readlink(link_name, histfile, 0) == 0 &&
+ strncmp(link_name, "/dev/null", 10) == 0)
+ {
+ /* The .mysql_history file is a symlink to /dev/null, don't use it */
+ my_free(histfile, MYF(MY_ALLOW_ZERO_PTR));
+ histfile= 0;
+ }
}
if (histfile)
{
@@ -484,7 +492,7 @@ sig_handler mysql_end(int sig)
{
mysql_close(&mysql);
#ifdef HAVE_READLINE
- if (!status.batch && !quick && !opt_html && !opt_xml)
+ if (!status.batch && !quick && !opt_html && !opt_xml && histfile)
{
/* write-history */
if (verbose)