From: Date: February 13 2006 2:52pm Subject: bk commit into 5.0 tree (msvensson:1.2022) BUG#16803 List-Archive: http://lists.mysql.com/commits/2516 X-Bug: 16803 Message-Id: <20060213135206.476C5207825@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of msvensson. When msvensson does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2022 06/02/13 14:51:59 msvensson@neptunus.(none) +1 -0 Bug#16803 "ln -s /dev/null .mysql_history" doesn't work! - Add a check to see if the .mysql_history file a symlink to /dev/null and in such case, skip reading and writing to it. client/mysql.cc 1.195 06/02/13 14:51:55 msvensson@neptunus.(none) +9 -1 Add check to detect if the "mysql_history" file is a symlink to /dev/null. In that case, don't create inint histfile variable. That will make read_history and write_history to be skipped. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: msvensson # Host: neptunus.(none) # Root: /home/msvensson/mysql/bug16557/my50-bug16557 --- 1.194/client/mysql.cc 2005-12-27 14:56:46 +01:00 +++ 1.195/client/mysql.cc 2006-02-13 14:51:55 +01:00 @@ -445,6 +445,14 @@ 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) { @@ -481,7 +489,7 @@ { 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)