Commit 97da8630 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

merge

parents 5933619c 5f267b47
...@@ -2253,6 +2253,18 @@ void Query_cache::free_cache() ...@@ -2253,6 +2253,18 @@ void Query_cache::free_cache()
{ {
DBUG_ENTER("Query_cache::free_cache"); DBUG_ENTER("Query_cache::free_cache");
/* Destroy locks */
Query_cache_block *block= queries_blocks;
if (block)
{
do
{
Query_cache_query *query= block->query();
my_rwlock_destroy(&query->lock);
block= block->next;
} while (block != queries_blocks);
}
my_free((uchar*) cache, MYF(MY_ALLOW_ZERO_PTR)); my_free((uchar*) cache, MYF(MY_ALLOW_ZERO_PTR));
make_disabled(); make_disabled();
hash_free(&queries); hash_free(&queries);
......
...@@ -357,6 +357,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc) ...@@ -357,6 +357,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
{ {
*rc= my_errno ? my_errno : -1; *rc= my_errno ? my_errno : -1;
pthread_mutex_unlock(&archive_mutex); pthread_mutex_unlock(&archive_mutex);
pthread_mutex_destroy(&share->mutex);
my_free(share, MYF(0)); my_free(share, MYF(0));
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
} }
......
...@@ -717,6 +717,11 @@ xtPublic void xt_ind_exit(XTThreadPtr self) ...@@ -717,6 +717,11 @@ xtPublic void xt_ind_exit(XTThreadPtr self)
ind_handle_exit(self); ind_handle_exit(self);
if (ind_cac_globals.cg_blocks) { if (ind_cac_globals.cg_blocks) {
XTIndBlockPtr block = ind_cac_globals.cg_blocks;
for (u_int i=0; i<ind_cac_globals.cg_block_count; i++) {
XT_IPAGE_FREE_LOCK(self, &block->cb_lock);
block++;
}
xt_free(self, ind_cac_globals.cg_blocks); xt_free(self, ind_cac_globals.cg_blocks);
ind_cac_globals.cg_blocks = NULL; ind_cac_globals.cg_blocks = NULL;
xt_free_mutex(&ind_cac_globals.cg_lock); xt_free_mutex(&ind_cac_globals.cg_lock);
......
...@@ -109,6 +109,7 @@ xtPublic void xt_heap_release(XTThreadPtr self, XTHeapPtr hp) ...@@ -109,6 +109,7 @@ xtPublic void xt_heap_release(XTThreadPtr self, XTHeapPtr hp)
if (hp->h_finalize) if (hp->h_finalize)
(*hp->h_finalize)(self, hp); (*hp->h_finalize)(self, hp);
xt_spinlock_unlock(&hp->h_lock); xt_spinlock_unlock(&hp->h_lock);
xt_spinlock_free(NULL, &hp->h_lock);
xt_free(self, hp); xt_free(self, hp);
return; return;
} }
......
...@@ -726,11 +726,15 @@ xtBool xt_init_row_locks(XTRowLocksPtr rl) ...@@ -726,11 +726,15 @@ xtBool xt_init_row_locks(XTRowLocksPtr rl)
rl->rl_groups[i].lg_list_in_use = 0; rl->rl_groups[i].lg_list_in_use = 0;
rl->rl_groups[i].lg_list = NULL; rl->rl_groups[i].lg_list = NULL;
} }
rl->valid = 1;
return OK; return OK;
} }
void xt_exit_row_locks(XTRowLocksPtr rl) void xt_exit_row_locks(XTRowLocksPtr rl)
{ {
if (!rl->valid)
return;
for (int i=0; i<XT_ROW_LOCK_GROUP_COUNT; i++) { for (int i=0; i<XT_ROW_LOCK_GROUP_COUNT; i++) {
xt_spinlock_free(NULL, &rl->rl_groups[i].lg_lock); xt_spinlock_free(NULL, &rl->rl_groups[i].lg_lock);
rl->rl_groups[i].lg_wait_queue = NULL; rl->rl_groups[i].lg_wait_queue = NULL;
...@@ -741,6 +745,7 @@ void xt_exit_row_locks(XTRowLocksPtr rl) ...@@ -741,6 +745,7 @@ void xt_exit_row_locks(XTRowLocksPtr rl)
rl->rl_groups[i].lg_list = NULL; rl->rl_groups[i].lg_list = NULL;
} }
} }
rl->valid = 0;
} }
/* /*
......
...@@ -658,6 +658,7 @@ typedef struct XTLockGroup { ...@@ -658,6 +658,7 @@ typedef struct XTLockGroup {
struct XTLockWait; struct XTLockWait;
typedef struct XTRowLocks { typedef struct XTRowLocks {
int valid;
XTLockGroupRec rl_groups[XT_ROW_LOCK_GROUP_COUNT]; XTLockGroupRec rl_groups[XT_ROW_LOCK_GROUP_COUNT];
void xt_cancel_temp_lock(XTLockWaitPtr lw); void xt_cancel_temp_lock(XTLockWaitPtr lw);
......
...@@ -1123,7 +1123,6 @@ xtPublic void xt_xn_init_db(XTThreadPtr self, XTDatabaseHPtr db) ...@@ -1123,7 +1123,6 @@ xtPublic void xt_xn_init_db(XTThreadPtr self, XTDatabaseHPtr db)
*/ */
for (u_int i=0; i<XT_XN_NO_OF_SEGMENTS; i++) { for (u_int i=0; i<XT_XN_NO_OF_SEGMENTS; i++) {
seg = &db->db_xn_idx[i]; seg = &db->db_xn_idx[i];
XT_XACT_INIT_LOCK(self, &seg->xs_tab_lock);
seg->xs_last_xn_id = db->db_xn_curr_id; seg->xs_last_xn_id = db->db_xn_curr_id;
} }
......
...@@ -193,6 +193,11 @@ int vio_fastsend(Vio * vio __attribute__((unused))) ...@@ -193,6 +193,11 @@ int vio_fastsend(Vio * vio __attribute__((unused)))
int r=0; int r=0;
DBUG_ENTER("vio_fastsend"); DBUG_ENTER("vio_fastsend");
if (vio->type == VIO_TYPE_NAMEDPIPE ||vio->type == VIO_TYPE_SHARED_MEMORY)
{
DBUG_RETURN(0);
}
#if defined(IPTOS_THROUGHPUT) #if defined(IPTOS_THROUGHPUT)
{ {
int tos = IPTOS_THROUGHPUT; int tos = IPTOS_THROUGHPUT;
...@@ -228,7 +233,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) ...@@ -228,7 +233,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive)
DBUG_ENTER("vio_keepalive"); DBUG_ENTER("vio_keepalive");
DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d", vio->sd, (int) DBUG_PRINT("enter", ("sd: %d set_keep_alive: %d", vio->sd, (int)
set_keep_alive)); set_keep_alive));
if (vio->type != VIO_TYPE_NAMEDPIPE) if (vio->type != VIO_TYPE_NAMEDPIPE && vio->type != VIO_TYPE_SHARED_MEMORY)
{ {
if (set_keep_alive) if (set_keep_alive)
opt = 1; opt = 1;
......
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