summaryrefslogtreecommitdiff
path: root/storage/maria/trnman.c
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2008-07-05 14:03:21 +0300
committerMichael Widenius <monty@mysql.com>2008-07-05 14:03:21 +0300
commit82d7938905a0a9c6647bd476b479f3e80e85a5e0 (patch)
tree73ad0ece2e35cae745c47b1b65ebce17acfa1dc2 /storage/maria/trnman.c
parent6559f5c229a082a695a728be1c23a4d59f7b3d9b (diff)
downloadmariadb-git-82d7938905a0a9c6647bd476b479f3e80e85a5e0.tar.gz
Bug#37276 maria crash on insert around the time check table is run
Fixed several (but not all) issues found by the test program: - ASSERT on row_length in ma_blockrec.c::_ma_compact_block_page() - Fixed bug when splitting node pages - Fixed hang in 'closeing tables' (conflicting mutex order) by ensuring we first take trnman lock and then share->intern_lock storage/maria/ma_blockrec.c: When compacting a row page when allocating space for a new row, the min length of a the new block may be temporarly smaller than 'min_block_length'. storage/maria/ma_check.c: More DBUG output storage/maria/ma_checkpoint.c: Call new function _ma_remove_not_visible_states_with_lock() to ensure we first take lock on trnman and then on share->intern_lock + storage/maria/ma_close.c: Added comment storage/maria/ma_open.c: Added comment storage/maria/ma_search.c: Copy also node data; Caused bug when splitting node pages storage/maria/ma_state.c: Added _ma_remove_not_visible_states_with_lock() to ensure we take locks in right order storage/maria/ma_state.h: Added new prototype storage/maria/trnman.c: Added trnman_lock() and trnman_unlock(). Needed by _ma_remove_not_visible_states_with_lock() to get mutex in right order storage/maria/trnman_public.h: Added new prototypes
Diffstat (limited to 'storage/maria/trnman.c')
-rw-r--r--storage/maria/trnman.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c
index 163305a1fb5..374adddacde 100644
--- a/storage/maria/trnman.c
+++ b/storage/maria/trnman.c
@@ -851,7 +851,7 @@ TrID trnman_get_max_trid()
}
/**
- Check if there exist an active transaction between two commit_id's
+ @brief Check if there exist an active transaction between two commit_id's
@todo
Improve speed of this.
@@ -885,3 +885,22 @@ my_bool trnman_exists_active_transactions(TrID min_id, TrID max_id,
pthread_mutex_unlock(&LOCK_trn_list);
return ret;
}
+
+
+/**
+ lock transaction list
+*/
+
+void trnman_lock()
+{
+ pthread_mutex_lock(&LOCK_trn_list);
+}
+
+/**
+ unlock transaction list
+*/
+
+void trnman_unlock()
+{
+ pthread_mutex_unlock(&LOCK_trn_list);
+}