Merge mysql.com:/home/stewart/Documents/MySQL/5.0/bug17411-thisisaverylongnamethatshouldbewaylongerthanthe128limitthatweprivouslyhadbutireallywantotestitandseethatitdoesreallywork.nowitshouldbeabout160charslongnonow.iwonderifanythingwillchokeornotwiththisoutrageouslylongpathname

into  mysql.com:/home/stewart/Documents/MySQL/5.1/new
This commit is contained in:
stewart@mysql.com 2006-02-16 15:51:37 +11:00
commit 05696de46f
3 changed files with 20 additions and 22 deletions

View file

@ -191,10 +191,8 @@ public:
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);

View file

@ -64,11 +64,11 @@ NdbConfig_NdbCfgName(int with_ndb_home){
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 *get_prefix_buf(int len, int node_id)
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;
}

View file

@ -67,7 +67,7 @@ File_class::File_class(const char* aFileName, const char* mode) :
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 @@ File_class::open(const char* aFileName, const char* mode)
/**
* 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;