MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:February 15 2006 5:37am
Subject:bk commit into 5.0 tree (stewart:1.2047) BUG#17411
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of stewart. When stewart 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.2047 06/02/15 16:37:09 stewart@stripped +3 -0
  BUG#17411 cannot have path longer than 128 characters
  
  Use the POSIX limits.h define of PATH_MAX for maximum path length.
  
  This has been being hit in pushbuild

  ndb/src/common/util/File.cpp
    1.10 06/02/15 16:37:06 stewart@stripped +2 -2
    use PATH_MAX for maximum filename length

  ndb/src/common/portlib/NdbConfig.c
    1.17 06/02/15 16:37:06 stewart@stripped +17 -17
    use PATH_MAX for max path name length instead of hardcoding 128

  ndb/include/util/File.hpp
    1.5 06/02/15 16:37:06 stewart@stripped +1 -3
    use PATH_MAX for maximum filename length

# 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:	stewart
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.0/bug17411-thisisaverylongnamethatshouldbewaylongerthanthe128limitthatweprivouslyhadbutireallywantotestitandseethatitdoesreallywork.nowitshouldbeabout160charslongnonow.iwonderifanythingwillchokeornotwiththisoutrageouslylongpathname

--- 1.4/ndb/include/util/File.hpp	2004-05-12 06:34:10 +10:00
+++ 1.5/ndb/include/util/File.hpp	2006-02-15 16:37:06 +11:00
@@ -191,10 +191,8 @@
   int flush() const;
 
 private:
-  STATIC_CONST( MAX_FILE_NAME_SIZE = 128 );
-
   FILE* m_file;
-  char m_fileName[MAX_FILE_NAME_SIZE];
+  char m_fileName[PATH_MAX];
   const char* m_fileMode;
   /* Prohibit */
   File_class (const File_class& aCopy);

--- 1.16/ndb/src/common/portlib/NdbConfig.c	2004-11-16 17:20:51 +11:00
+++ 1.17/ndb/src/common/portlib/NdbConfig.c	2006-02-15 16:37:06 +11:00
@@ -64,11 +64,11 @@
   int len= 0;
 
   if (with_ndb_home) {
-    buf= NdbConfig_AllocHomePath(128);
+    buf= NdbConfig_AllocHomePath(PATH_MAX);
     len= strlen(buf);
   } else
-    buf= NdbMem_Allocate(128);
-  basestring_snprintf(buf+len, 128, "Ndb.cfg");
+    buf= NdbMem_Allocate(PATH_MAX);
+  basestring_snprintf(buf+len, PATH_MAX, "Ndb.cfg");
   return buf;
 }
 
@@ -90,56 +90,56 @@
 
 char* 
 NdbConfig_ErrorFileName(int node_id){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, "_error.log");
+  basestring_snprintf(buf+len, PATH_MAX, "_error.log");
   return buf;
 }
 
 char*
 NdbConfig_ClusterLogFileName(int node_id){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, "_cluster.log");
+  basestring_snprintf(buf+len, PATH_MAX, "_cluster.log");
   return buf;
 }
 
 char*
 NdbConfig_SignalLogFileName(int node_id){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, "_signal.log");
+  basestring_snprintf(buf+len, PATH_MAX, "_signal.log");
   return buf;
 }
 
 char*
 NdbConfig_TraceFileName(int node_id, int file_no){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, "_trace.log.%u", file_no);
+  basestring_snprintf(buf+len, PATH_MAX, "_trace.log.%u", file_no);
   return buf;
 }
 
 char*
 NdbConfig_NextTraceFileName(int node_id){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, "_trace.log.next");
+  basestring_snprintf(buf+len, PATH_MAX, "_trace.log.next");
   return buf;
 }
 
 char*
 NdbConfig_PidFileName(int node_id){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, ".pid");
+  basestring_snprintf(buf+len, PATH_MAX, ".pid");
   return buf;
 }
 
 char*
 NdbConfig_StdoutFileName(int node_id){
-  char *buf= get_prefix_buf(128, node_id);
+  char *buf= get_prefix_buf(PATH_MAX, node_id);
   int len= strlen(buf);
-  basestring_snprintf(buf+len, 128, "_out.log");
+  basestring_snprintf(buf+len, PATH_MAX, "_out.log");
   return buf;
 }

--- 1.9/ndb/src/common/util/File.cpp	2005-05-25 15:35:44 +10:00
+++ 1.10/ndb/src/common/util/File.cpp	2006-02-15 16:37:06 +11:00
@@ -67,7 +67,7 @@
   m_file(NULL), 
   m_fileMode(mode)
 {
-  BaseString::snprintf(m_fileName, MAX_FILE_NAME_SIZE, aFileName);
+  BaseString::snprintf(m_fileName, PATH_MAX, aFileName);
 }
 
 bool
@@ -83,7 +83,7 @@
     /**
      * Only copy if it's not the same string
      */
-    BaseString::snprintf(m_fileName, MAX_FILE_NAME_SIZE, aFileName);
+    BaseString::snprintf(m_fileName, PATH_MAX, aFileName);
   }
   m_fileMode = mode;
   bool rc = true;
Thread
bk commit into 5.0 tree (stewart:1.2047) BUG#17411Stewart Smith15 Feb