Commit aa7d01bc 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

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
parents 8b8a61d7 e372d041
...@@ -8553,6 +8553,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ...@@ -8553,6 +8553,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
struct timespec abstime; struct timespec abstime;
List<NDB_SHARE> util_open_tables; List<NDB_SHARE> util_open_tables;
Thd_ndb *thd_ndb; Thd_ndb *thd_ndb;
uint share_list_size= 0;
NDB_SHARE **share_list= NULL;
my_thread_init(); my_thread_init();
DBUG_ENTER("ndb_util_thread"); DBUG_ENTER("ndb_util_thread");
...@@ -8672,7 +8674,22 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ...@@ -8672,7 +8674,22 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
/* Lock mutex and fill list with pointers to all open tables */ /* Lock mutex and fill list with pointers to all open tables */
NDB_SHARE *share; NDB_SHARE *share;
pthread_mutex_lock(&ndbcluster_mutex); pthread_mutex_lock(&ndbcluster_mutex);
for (uint i= 0; i < ndbcluster_open_tables.records; i++) uint i, open_count, record_count= ndbcluster_open_tables.records;
if (share_list_size < record_count)
{
NDB_SHARE ** new_share_list= new NDB_SHARE * [record_count];
if (!new_share_list)
{
sql_print_warning("ndb util thread: malloc failure, "
"query cache not maintained properly");
pthread_mutex_unlock(&ndbcluster_mutex);
goto next; // At least do not crash
}
delete [] share_list;
share_list_size= record_count;
share_list= new_share_list;
}
for (i= 0, open_count= 0; i < record_count; i++)
{ {
share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i); share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i);
#ifdef HAVE_NDB_BINLOG #ifdef HAVE_NDB_BINLOG
...@@ -8690,14 +8707,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ...@@ -8690,14 +8707,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
i, share->table_name, share->use_count)); i, share->table_name, share->use_count));
/* Store pointer to table */ /* Store pointer to table */
util_open_tables.push_back(share); share_list[open_count++]= share;
} }
pthread_mutex_unlock(&ndbcluster_mutex); pthread_mutex_unlock(&ndbcluster_mutex);
/* Iterate through the open files list */ /* Iterate through the open files list */
List_iterator_fast<NDB_SHARE> it(util_open_tables); for (i= 0; i < open_count; i++)
while ((share= it++))
{ {
share= share_list[i];
#ifdef HAVE_NDB_BINLOG #ifdef HAVE_NDB_BINLOG
if ((share->use_count - (int) (share->op != 0) - (int) (share->op != 0)) if ((share->use_count - (int) (share->op != 0) - (int) (share->op != 0))
<= 1) <= 1)
...@@ -8758,10 +8775,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ...@@ -8758,10 +8775,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
share->key, share->use_count)); share->key, share->use_count));
free_share(&share); free_share(&share);
} }
next:
/* Clear the list of open tables */
util_open_tables.empty();
/* Calculate new time to wake up */ /* Calculate new time to wake up */
int secs= 0; int secs= 0;
int msecs= ndb_cache_check_time; int msecs= ndb_cache_check_time;
...@@ -8789,6 +8803,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) ...@@ -8789,6 +8803,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
ndb_util_thread_end: ndb_util_thread_end:
net_end(&thd->net); net_end(&thd->net);
ndb_util_thread_fail: ndb_util_thread_fail:
if (share_list)
delete [] share_list;
thd->cleanup(); thd->cleanup();
delete thd; delete thd;
......
...@@ -484,6 +484,13 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr ...@@ -484,6 +484,13 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr
ptrCheckGuard(parentPageRangePtr, cnoOfPageRangeRec, pageRange); ptrCheckGuard(parentPageRangePtr, cnoOfPageRangeRec, pageRange);
if (parentPageRangePtr.p->currentIndexPos < 3) { if (parentPageRangePtr.p->currentIndexPos < 3) {
jam(); jam();
if (c_noOfFreePageRanges < tiprNoLevels)
{
jam();
return RNIL;
}//if
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
/* WE HAVE FOUND AN EMPTY ENTRY IN A PAGE RANGE RECORD. */ /* WE HAVE FOUND AN EMPTY ENTRY IN A PAGE RANGE RECORD. */
/* ALLOCATE A NEW PAGE RANGE RECORD, FILL IN THE START RANGE, */ /* ALLOCATE A NEW PAGE RANGE RECORD, FILL IN THE START RANGE, */
......
...@@ -669,7 +669,7 @@ InitConfigFileParser::store_in_properties(Vector<struct my_option>& options, ...@@ -669,7 +669,7 @@ InitConfigFileParser::store_in_properties(Vector<struct my_option>& options,
if (options[i].var_type == GET_INT) if (options[i].var_type == GET_INT)
ctx.m_currentSection->put(options[i].name, (Uint32)value_int); ctx.m_currentSection->put(options[i].name, (Uint32)value_int);
else else
ctx.m_currentSection->put(options[i].name, value_int); ctx.m_currentSection->put64(options[i].name, value_int);
} }
} }
return true; return true;
......
...@@ -155,12 +155,13 @@ setup_files(atrt_config& config, int setup, int sshx) ...@@ -155,12 +155,13 @@ setup_files(atrt_config& config, int setup, int sshx)
const char * val; const char * val;
require(proc.m_options.m_loaded.get("--datadir=", &val)); require(proc.m_options.m_loaded.get("--datadir=", &val));
BaseString tmp; BaseString tmp;
tmp.assfmt("%s/bin/mysql_install_db --datadir=%s > /dev/null 2>&1", tmp.assfmt("%s/bin/mysql_install_db --defaults-file=%s/my.cnf --datadir=%s > /dev/null 2>&1",
g_prefix, val); g_prefix, g_basedir, val);
if (system(tmp.c_str()) != 0) if (system(tmp.c_str()) != 0)
{ {
g_logger.error("Failed to mysql_install_db for %s", g_logger.error("Failed to mysql_install_db for %s, cmd: >%s<",
proc.m_proc.m_cwd.c_str()); proc.m_proc.m_cwd.c_str(),
tmp.c_str());
} }
else else
{ {
......
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