diff options
author | unknown <lzhou/root@dev3-138.dev.cn.tlan> | 2006-11-01 10:53:24 +0000 |
---|---|---|
committer | unknown <lzhou/root@dev3-138.dev.cn.tlan> | 2006-11-01 10:53:24 +0000 |
commit | ce8011429a2729597ec7ddc9372f259e4eb53d6b (patch) | |
tree | 896be89a06cd68e9eaf8c7b2ab52adaf7d60022d /storage | |
parent | 9372279460618d762a18251fe6843df24684e432 (diff) | |
parent | e997b3622ae48f5a710d5fb91b8a012ba8a35266 (diff) | |
download | mariadb-git-ce8011429a2729597ec7ddc9372f259e4eb53d6b.tar.gz |
Merge dev3-138.dev.cn.tlan:/home/zhl/mysql/mysql-5.0/bug21052
into dev3-138.dev.cn.tlan:/home/zhl/mysql/mysql-5.1/bug21052
storage/ndb/include/ndbapi/ndberror.h:
Auto merged
storage/ndb/src/mgmsrv/Services.cpp:
Auto merged
storage/ndb/src/ndbapi/ndberror.c:
Auto merged
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/include/ndbapi/ndberror.h | 2 | ||||
-rw-r--r-- | storage/ndb/src/mgmsrv/Services.cpp | 9 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/ndberror.c | 7 |
3 files changed, 12 insertions, 6 deletions
diff --git a/storage/ndb/include/ndbapi/ndberror.h b/storage/ndb/include/ndbapi/ndberror.h index cf03eb9da34..009818f5f4f 100644 --- a/storage/ndb/include/ndbapi/ndberror.h +++ b/storage/ndb/include/ndbapi/ndberror.h @@ -99,7 +99,7 @@ typedef ndberror_classification_enum ndberror_classification; 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*/ diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index 4a84095aa9f..c59ab282af7 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -1352,7 +1352,7 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) 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); @@ -1371,8 +1371,11 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) 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); + } } } diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index 083830e8b44..68c521e7b82 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -774,11 +774,14 @@ const char *ndberror_classification_message(ndberror_classification classificati 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); |