Commit db9a44ce authored by tomas@whalegate.ndb.mysql.com's avatar tomas@whalegate.ndb.mysql.com

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-telco-gca

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-telco-gca
parents b9968172 585782e0
...@@ -1011,7 +1011,7 @@ int ha_ndbcluster::get_metadata(const char *path) ...@@ -1011,7 +1011,7 @@ int ha_ndbcluster::get_metadata(const char *path)
DBUG_ASSERT(m_table == NULL); DBUG_ASSERT(m_table == NULL);
DBUG_ASSERT(m_table_info == NULL); DBUG_ASSERT(m_table_info == NULL);
const void *data, *pack_data; const void *data= NULL, *pack_data= NULL;
uint length, pack_length; uint length, pack_length;
/* /*
...@@ -4749,7 +4749,7 @@ int ha_ndbcluster::create(const char *name, ...@@ -4749,7 +4749,7 @@ int ha_ndbcluster::create(const char *name,
NDBTAB tab; NDBTAB tab;
NDBCOL col; NDBCOL col;
uint pack_length, length, i, pk_length= 0; uint pack_length, length, i, pk_length= 0;
const void *data, *pack_data; const void *data= NULL, *pack_data= NULL;
bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE); bool create_from_engine= (info->table_options & HA_OPTION_CREATE_FROM_ENGINE);
bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE); bool is_truncate= (thd->lex->sql_command == SQLCOM_TRUNCATE);
char tablespace[FN_LEN]; char tablespace[FN_LEN];
...@@ -5077,7 +5077,7 @@ int ha_ndbcluster::create_handler_files(const char *file, ...@@ -5077,7 +5077,7 @@ int ha_ndbcluster::create_handler_files(const char *file,
const char *name; const char *name;
Ndb* ndb; Ndb* ndb;
const NDBTAB *tab; const NDBTAB *tab;
const void *data, *pack_data; const void *data= NULL, *pack_data= NULL;
uint length, pack_length; uint length, pack_length;
int error= 0; int error= 0;
...@@ -6063,7 +6063,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, ...@@ -6063,7 +6063,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
int error= 0; int error= 0;
NdbError ndb_error; NdbError ndb_error;
uint len; uint len;
const void* data; const void* data= NULL;
Ndb* ndb; Ndb* ndb;
char key[FN_REFLEN]; char key[FN_REFLEN];
DBUG_ENTER("ndbcluster_discover"); DBUG_ENTER("ndbcluster_discover");
...@@ -6131,6 +6131,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, ...@@ -6131,6 +6131,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db,
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR));
if (share) if (share)
free_share(&share); free_share(&share);
if (ndb_error.code) if (ndb_error.code)
......
...@@ -652,9 +652,9 @@ void getTextEventBufferStatus(QQQQ) { ...@@ -652,9 +652,9 @@ void getTextEventBufferStatus(QQQQ) {
"Event buffer status: used=%d%s(%d%) alloc=%d%s(%d%) " "Event buffer status: used=%d%s(%d%) alloc=%d%s(%d%) "
"max=%d%s apply_gci=%lld latest_gci=%lld", "max=%d%s apply_gci=%lld latest_gci=%lld",
used, used_unit, used, used_unit,
theData[2] ? (theData[1]*100)/theData[2] : 0, theData[2] ? (Uint32)((((Uint64)theData[1])*100)/theData[2]) : 0,
alloc, alloc_unit, alloc, alloc_unit,
theData[3] ? (theData[2]*100)/theData[3] : 0, theData[3] ? (Uint32)((((Uint64)theData[2])*100)/theData[3]) : 0,
max_, max_unit, max_, max_unit,
theData[4]+(((Uint64)theData[5])<<32), theData[4]+(((Uint64)theData[5])<<32),
theData[6]+(((Uint64)theData[7])<<32)); theData[6]+(((Uint64)theData[7])<<32));
......
...@@ -2100,15 +2100,17 @@ NdbEventBuffer::alloc_mem(EventBufData* data, ...@@ -2100,15 +2100,17 @@ NdbEventBuffer::alloc_mem(EventBufData* data,
NdbMem_Free((char*)data->memory); NdbMem_Free((char*)data->memory);
assert(m_total_alloc >= data->sz); assert(m_total_alloc >= data->sz);
m_total_alloc -= data->sz;
data->memory = 0; data->memory = 0;
data->sz = 0; data->sz = 0;
data->memory = (Uint32*)NdbMem_Allocate(alloc_size); data->memory = (Uint32*)NdbMem_Allocate(alloc_size);
if (data->memory == 0) if (data->memory == 0)
{
m_total_alloc -= data->sz;
DBUG_RETURN(-1); DBUG_RETURN(-1);
}
data->sz = alloc_size; data->sz = alloc_size;
m_total_alloc += data->sz; m_total_alloc += add_sz;
if (change_sz != NULL) if (change_sz != NULL)
*change_sz += add_sz; *change_sz += add_sz;
...@@ -2780,7 +2782,7 @@ NdbEventBuffer::reportStatus() ...@@ -2780,7 +2782,7 @@ NdbEventBuffer::reportStatus()
else else
apply_gci= latest_gci; apply_gci= latest_gci;
if (100*m_free_data_sz < m_min_free_thresh*m_total_alloc && if (100*(Uint64)m_free_data_sz < m_min_free_thresh*(Uint64)m_total_alloc &&
m_total_alloc > 1024*1024) m_total_alloc > 1024*1024)
{ {
/* report less free buffer than m_free_thresh, /* report less free buffer than m_free_thresh,
...@@ -2791,7 +2793,7 @@ NdbEventBuffer::reportStatus() ...@@ -2791,7 +2793,7 @@ NdbEventBuffer::reportStatus()
goto send_report; goto send_report;
} }
if (100*m_free_data_sz > m_max_free_thresh*m_total_alloc && if (100*(Uint64)m_free_data_sz > m_max_free_thresh*(Uint64)m_total_alloc &&
m_total_alloc > 1024*1024) m_total_alloc > 1024*1024)
{ {
/* report more free than 2 * m_free_thresh /* report more free than 2 * m_free_thresh
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment