mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
This commit is contained in:
commit
c457e2b88b
3 changed files with 33 additions and 11 deletions
|
@ -452,6 +452,13 @@ Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr curr
|
|||
ptrCheckGuard(parentPageRangePtr, cnoOfPageRangeRec, pageRange);
|
||||
if (parentPageRangePtr.p->currentIndexPos < 3) {
|
||||
ljam();
|
||||
|
||||
if (c_noOfFreePageRanges < tiprNoLevels)
|
||||
{
|
||||
ljam();
|
||||
return RNIL;
|
||||
}//if
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* WE HAVE FOUND AN EMPTY ENTRY IN A PAGE RANGE RECORD. */
|
||||
/* ALLOCATE A NEW PAGE RANGE RECORD, FILL IN THE START RANGE, */
|
||||
|
|
|
@ -657,7 +657,7 @@ InitConfigFileParser::store_in_properties(Vector<struct my_option>& options,
|
|||
if (options[i].var_type == GET_INT)
|
||||
ctx.m_currentSection->put(options[i].name, (Uint32)value_int);
|
||||
else
|
||||
ctx.m_currentSection->put(options[i].name, value_int);
|
||||
ctx.m_currentSection->put64(options[i].name, value_int);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -6695,7 +6695,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||
DBUG_RETURN(NULL);
|
||||
}
|
||||
|
||||
List<NDB_SHARE> util_open_tables;
|
||||
uint share_list_size= 0;
|
||||
NDB_SHARE **share_list= NULL;
|
||||
set_timespec(abstime, 0);
|
||||
for (;;)
|
||||
{
|
||||
|
@ -6725,7 +6726,22 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||
/* Lock mutex and fill list with pointers to all open tables */
|
||||
NDB_SHARE *share;
|
||||
pthread_mutex_lock(&ndbcluster_mutex);
|
||||
for (uint i= 0; i < ndbcluster_open_tables.records; i++)
|
||||
uint i, 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; i < record_count; i++)
|
||||
{
|
||||
share= (NDB_SHARE *)hash_element(&ndbcluster_open_tables, i);
|
||||
share->use_count++; /* Make sure the table can't be closed */
|
||||
|
@ -6734,14 +6750,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||
i, share->table_name, share->use_count));
|
||||
|
||||
/* Store pointer to table */
|
||||
util_open_tables.push_back(share);
|
||||
share_list[i]= share;
|
||||
}
|
||||
pthread_mutex_unlock(&ndbcluster_mutex);
|
||||
|
||||
/* Iterate through the open files list */
|
||||
List_iterator_fast<NDB_SHARE> it(util_open_tables);
|
||||
while ((share= it++))
|
||||
/* Iterate through the open files list */
|
||||
for (i= 0; i < record_count; i++)
|
||||
{
|
||||
share= share_list[i];
|
||||
/* Split tab- and dbname */
|
||||
char buf[FN_REFLEN];
|
||||
char *tabname, *db;
|
||||
|
@ -6790,10 +6806,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||
/* Decrease the use count and possibly free share */
|
||||
free_share(share);
|
||||
}
|
||||
|
||||
/* Clear the list of open tables */
|
||||
util_open_tables.empty();
|
||||
|
||||
next:
|
||||
/* Calculate new time to wake up */
|
||||
int secs= 0;
|
||||
int msecs= ndb_cache_check_time;
|
||||
|
@ -6816,6 +6829,8 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
|
|||
}
|
||||
}
|
||||
|
||||
if (share_list)
|
||||
delete [] share_list;
|
||||
thd->cleanup();
|
||||
delete thd;
|
||||
delete ndb;
|
||||
|
|
Loading…
Reference in a new issue