summaryrefslogtreecommitdiff
path: root/storage/maria/ma_bitmap.c
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2010-08-12 19:46:36 +0300
committerMichael Widenius <monty@mysql.com>2010-08-12 19:46:36 +0300
commit6bbb0b573983320d136522d207f282e8506862da (patch)
tree9aed74c4dc9850ee7e6ab1d25c1a7a55c8b9dbb3 /storage/maria/ma_bitmap.c
parent2d7b9ac75c18537c5dfd67660b42619249f11a34 (diff)
downloadmariadb-git-6bbb0b573983320d136522d207f282e8506862da.tar.gz
Added option --start-from-checkpoint to maria_read_log
Print out checked file names in maria_check -s (unless you use a second -s) Some trivial optimizations storage/maria/ma_bitmap.c: Trivial optimizations: - Combine common code (to be able to remove duplicate mutex_lock call) - Move setting of thread specific variables outside of mutex storage/maria/ma_check.c: Fixed wrong argument to printf storage/maria/maria_chk.c: Print out checked table names unless -s -s storage/maria/maria_read_log.c: Added option --start-from-checkpoint (to help find bugs in checkpoints)
Diffstat (limited to 'storage/maria/ma_bitmap.c')
-rw-r--r--storage/maria/ma_bitmap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index 70617160d03..f75df06cadc 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -2142,12 +2142,12 @@ void _ma_bitmap_flushable(MARIA_HA *info, int non_flushable_inc)
DBUG_VOID_RETURN;
bitmap= &share->bitmap;
+ pthread_mutex_lock(&bitmap->bitmap_lock);
+
if (non_flushable_inc == -1)
{
- pthread_mutex_lock(&bitmap->bitmap_lock);
DBUG_ASSERT((int) bitmap->non_flushable > 0);
DBUG_ASSERT(info->non_flushable_state == 1);
- info->non_flushable_state= 0;
if (--bitmap->non_flushable == 0)
{
/*
@@ -2164,11 +2164,11 @@ void _ma_bitmap_flushable(MARIA_HA *info, int non_flushable_inc)
}
DBUG_PRINT("info", ("bitmap->non_flushable: %u", bitmap->non_flushable));
pthread_mutex_unlock(&bitmap->bitmap_lock);
+ info->non_flushable_state= 0;
DBUG_VOID_RETURN;
}
DBUG_ASSERT(non_flushable_inc == 1);
DBUG_ASSERT(info->non_flushable_state == 0);
- pthread_mutex_lock(&bitmap->bitmap_lock);
while (unlikely(bitmap->flush_all_requested))
{
/*
@@ -2186,9 +2186,9 @@ void _ma_bitmap_flushable(MARIA_HA *info, int non_flushable_inc)
pthread_cond_wait(&bitmap->bitmap_cond, &bitmap->bitmap_lock);
}
bitmap->non_flushable++;
- info->non_flushable_state= 1;
DBUG_PRINT("info", ("bitmap->non_flushable: %u", bitmap->non_flushable));
pthread_mutex_unlock(&bitmap->bitmap_lock);
+ info->non_flushable_state= 1;
DBUG_VOID_RETURN;
}
@@ -2217,6 +2217,8 @@ void _ma_bitmap_flushable(MARIA_HA *info, int non_flushable_inc)
Note that we may have 'filler blocks' that are used to split a block
in half; These can be recognized by that they have page_count == 0.
+ This code also reverse the effect of ma_bitmap_flushable(.., 1);
+
RETURN
0 ok
1 error (Couldn't write or read bitmap page)