Below is the list of changes that have just been committed into a local
5.1 repository of justin.he. When justin.he 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-11-13 15:31:59+08:00, Justin.He@stripped +5 -0
Bug#19203, Different error reports for similar cases - unable allocate memory
storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp@stripped, 2006-11-13 15:29:41+08:00, Justin.He@stripped +2 -1
if malloc failed, it will show the parameter's name
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2006-11-13 15:29:41+08:00, Justin.He@stripped +5 -2
if malloc failed, it will show the parameter's name
storage/ndb/src/kernel/vm/ArrayPool.hpp@stripped, 2006-11-13 15:29:41+08:00, Justin.He@stripped +1 -1
reduce err message, or else some of it will be cut
storage/ndb/src/kernel/vm/SimulatedBlock.cpp@stripped, 2006-11-13 15:29:42+08:00, Justin.He@stripped +11 -3
add the feature which it can display the parameter's name if malloc failed
storage/ndb/src/kernel/vm/SimulatedBlock.hpp@stripped, 2006-11-13 15:29:42+08:00, Justin.He@stripped +1 -1
add an input argument which is the ID of a parameter
# 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: Justin.He
# Host: dev3-47.dev.cn.tlan
# Root: /mnt/sda7/justin.he/mysql/mysql-5.1/bug19203-5.1-new-ndb-bj
--- 1.21/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp 2006-11-13 15:32:06 +08:00
+++ 1.22/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp 2006-11-13 15:32:06 +08:00
@@ -51,7 +51,8 @@
page8 = (Page8*)allocRecord("Page8",
sizeof(Page8),
cpagesize,
- false);
+ false,
+ CFG_DB_INDEX_MEM);
operationrec = (Operationrec*)allocRecord("Operationrec",
sizeof(Operationrec),
--- 1.30/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2006-11-13 15:32:06 +08:00
+++ 1.31/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2006-11-13 15:32:06 +08:00
@@ -342,6 +342,7 @@
{
unsigned i;
Uint32 tmp;
+ Uint32 tmp1 = 0;
const ndb_mgm_configuration_iterator * p =
m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
@@ -349,7 +350,7 @@
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &tmp));
// Records with dynamic sizes
- Page* ptr =(Page*)allocRecord("Page", sizeof(Page), tmp, false);
+ Page* ptr =(Page*)allocRecord("Page", sizeof(Page), tmp, false, CFG_DB_DATA_MEM);
c_page_pool.set(ptr, tmp);
attrbufrec = (Attrbufrec*)allocRecord("Attrbufrec",
@@ -373,7 +374,9 @@
cnoOfTabDescrRec);
ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &tmp));
- c_operation_pool.setSize(tmp);
+ ndb_mgm_get_int_parameter(p, CFG_DB_NO_LOCAL_OPS, &tmp1);
+ c_operation_pool.setSize(tmp, false, true, true,
+ tmp1 == 0 ? CFG_DB_NO_OPS : CFG_DB_NO_LOCAL_OPS);
pageRange = (PageRange*)allocRecord("PageRange",
sizeof(PageRange),
--- 1.13/storage/ndb/src/kernel/vm/ArrayPool.hpp 2006-11-13 15:32:06 +08:00
+++ 1.14/storage/ndb/src/kernel/vm/ArrayPool.hpp 2006-11-13 15:32:06 +08:00
@@ -257,7 +257,7 @@
if(0 != paramId && 0 == ndb_mgm_get_db_parameter_info(paramId, ¶m_info, &size)) {
BaseString::snprintf(errmsg, sizeof(errmsg),
- "ArrayPool<T>::setSize malloc parameter %s failed", param_info.m_name);
+ "Malloc memory for %s failed", param_info.m_name);
}
ErrorReporter::handleAssert(errmsg,
--- 1.33/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2006-11-13 15:32:06 +08:00
+++ 1.34/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2006-11-13 15:32:06 +08:00
@@ -657,7 +657,7 @@
}
void*
-SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear)
+SimulatedBlock::allocRecord(const char * type, size_t s, size_t n, bool clear, Uint32 paramId)
{
void * p = NULL;
@@ -678,8 +678,16 @@
if (p == NULL){
char buf1[255];
char buf2[255];
- BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s",
- getBlockName(number()), type);
+ struct ndb_mgm_param_info param_info;
+ size_t size = sizeof(ndb_mgm_param_info);
+
+ if(0 != paramId && 0 == ndb_mgm_get_db_parameter_info(paramId, ¶m_info, &size)) {
+ BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for parameter %s",
+ getBlockName(number()), param_info.m_name);
+ } else {
+ BaseString::snprintf(buf1, sizeof(buf1), "%s could not allocate memory for %s",
+ getBlockName(number()), type);
+ }
BaseString::snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %llu bytes",
(Uint32)s, (Uint32)n, (Uint64)real_size);
ERROR_SET(fatal, NDBD_EXIT_MEMALLOC, buf1, buf2);
--- 1.25/storage/ndb/src/kernel/vm/SimulatedBlock.hpp 2006-11-13 15:32:06 +08:00
+++ 1.26/storage/ndb/src/kernel/vm/SimulatedBlock.hpp 2006-11-13 15:32:06 +08:00
@@ -377,7 +377,7 @@
* Allocates memory for the datastructures where ndb keeps the data
*
*/
- void* allocRecord(const char * type, size_t s, size_t n, bool clear = true);
+ void* allocRecord(const char * type, size_t s, size_t n, bool clear = true, Uint32 paramId = 0);
/**
* Deallocate record
| Thread |
|---|
| • bk commit into 5.1 tree (Justin.He:1.2320) BUG#19203 | jhe | 13 Nov |