From: Date: October 31 2006 11:20am Subject: bk commit into 5.0 tree (lzhou:1.2258) BUG#21052 List-Archive: http://lists.mysql.com/commits/14586 X-Bug: 21052 Message-Id: <200610311020.k9VAKrTT015063@dev3-138.dev.cn.tlan> Below is the list of changes that have just been committed into a local 5.0 repository of root. When root 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@stripped, 2006-10-31 10:20:50+00:00, lzhou@stripped +3 -0 BUG#21052 Modify the overflow error existed in last patch ndb/include/ndbapi/ndberror.h@stripped, 2006-10-31 10:20:47+00:00, lzhou@stripped +1 -1 Change unsigned int to int ndb/src/mgmsrv/Services.cpp@stripped, 2006-10-31 10:20:47+00:00, lzhou@stripped +6 -3 Modify the overflow error existed in last patch. Change the length of m_text to 512. ndb/src/ndbapi/ndberror.c@stripped, 2006-10-31 10:20:47+00:00, lzhou@stripped +5 -2 Change the parameter of ndb_error_string from unsigned int to int. # 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: lzhou # Host: dev3-138.dev.cn.tlan # Root: /home/zhl/mysql/mysql-5.0/bug21052 --- 1.70/ndb/src/mgmsrv/Services.cpp 2006-10-31 10:20:54 +00:00 +++ 1.71/ndb/src/mgmsrv/Services.cpp 2006-10-31 10:20:54 +00:00 @@ -1337,7 +1337,7 @@ if (EventLoggerBase::event_lookup(eventType,cat,threshold,severity,textF)) DBUG_VOID_RETURN; - char m_text[256]; + char m_text[512]; EventLogger::getText(m_text, sizeof(m_text), textF, theData, nodeId); @@ -1356,8 +1356,11 @@ if(strcmp(ndb_logevent_body[i].token,"error") == 0) { int m_text_len= strlen(m_text); - snprintf(m_text+m_text_len, 4 , " - "); - ndb_error_string(theData[3], m_text+(m_text_len+3), sizeof(m_text)-m_text_len-3); + if(sizeof(m_text)-m_text_len-3 > 0) + { + BaseString::snprintf(m_text+m_text_len, 4 , " - "); + ndb_error_string(val, m_text+(m_text_len+3), sizeof(m_text)-m_text_len-3); + } } } --- 1.8/ndb/include/ndbapi/ndberror.h 2006-10-31 10:20:54 +00:00 +++ 1.9/ndb/include/ndbapi/ndberror.h 2006-10-31 10:20:54 +00:00 @@ -93,7 +93,7 @@ const char *ndberror_status_message(ndberror_status); const char *ndberror_classification_message(ndberror_classification); void ndberror_update(ndberror_struct *); -int ndb_error_string(int err_no, char *str, unsigned int size); +int ndb_error_string(int err_no, char *str, int size); #endif /* doxygen skip internal*/ --- 1.50/ndb/src/ndbapi/ndberror.c 2006-10-31 10:20:54 +00:00 +++ 1.51/ndb/src/ndbapi/ndberror.c 2006-10-31 10:20:54 +00:00 @@ -680,11 +680,14 @@ return empty_string; } -int ndb_error_string(int err_no, char *str, unsigned int size) +int ndb_error_string(int err_no, char *str, int size) { ndberror_struct error; - unsigned int len; + int len; + assert(size > 1); + if(size <= 1) + return 0; error.code = err_no; ndberror_update(&error);