MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:msvensson Date:May 9 2006 9:01am
Subject:bk commit into 5.0 tree (msvensson:1.2113) BUG#16803
View as plain text  
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.2113 06/05/09 11:01:50 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.204 06/05/09 11:01:46 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 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/my50-maint-bug16803

--- 1.203/client/mysql.cc	2006-04-28 08:33:36 +02:00
+++ 1.204/client/mysql.cc	2006-05-09 11:01:46 +02:00
@@ -448,6 +448,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)
     {
@@ -484,7 +492,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)
Thread
bk commit into 5.0 tree (msvensson:1.2113) BUG#16803msvensson9 May