summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.(none)>2006-05-11 09:14:09 -0400
committerunknown <cmiller@zippy.(none)>2006-05-11 09:14:09 -0400
commit60bb69aa04a1795d6c1156e9814ce446662a8967 (patch)
treebd6adbb86293489e00b457b1829b23e730ba1c81 /client
parente42692c0a9e100595c5937b8516c05b2fd50ab54 (diff)
parent3923cfd98aa9f5e42e2ab870d6f2b63c1321370f (diff)
downloadmariadb-git-60bb69aa04a1795d6c1156e9814ce446662a8967.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into zippy.(none):/home/cmiller/work/mysql/mysql-5.0-maint client/mysql.cc: Auto merged
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 50e5569a0ec..900df825b25 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)