summaryrefslogtreecommitdiff
path: root/storage/maria
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2019-06-17 17:50:08 +0300
committerMichael Widenius <monty@mariadb.org>2019-06-17 17:50:08 +0300
commitc8b5fa4afc6c233101b8163ef19c1abc1be0373d (patch)
tree377b25b9207e3b3d5e1a0f5ab0b63cc1cfb3b685 /storage/maria
parent2b660fb4c212973ba0f118b47336b608d091f327 (diff)
downloadmariadb-git-c8b5fa4afc6c233101b8163ef19c1abc1be0373d.tar.gz
MDEV-19055 Failures with temporary tables and Aria
There was two separate problems: - Aria pagecache didn't properly handle re-reading of blocks that have given errors before (this triggered an assert) - temporary tables that where opened several times where not properly closed in ALTER, REPAIR or OPTIMIZE table Other things - Added a couple of asserts that will make it easier to find problems like this in the future.
Diffstat (limited to 'storage/maria')
-rw-r--r--storage/maria/ma_blockrec.c2
-rw-r--r--storage/maria/ma_pagecache.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index c38b27d0f6c..13323dcae55 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -5244,6 +5244,8 @@ my_bool _ma_scan_init_block_record(MARIA_HA *info)
{
MARIA_SHARE *share= info->s;
DBUG_ENTER("_ma_scan_init_block_record");
+ DBUG_ASSERT(info->dfile.file == share->bitmap.file.file);
+
/*
bitmap_buff may already be allocated if this is the second call to
rnd_init() without a rnd_end() in between, see sql/handler.h
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index 7b0f395f926..f8c83e12a18 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -3464,8 +3464,6 @@ restart:
pagecache_pthread_mutex_lock(&pagecache->cache_lock);
#endif
}
- if (status & PCBLOCK_ERROR)
- my_errno= block->error;
}
remove_reader(block);
@@ -3497,6 +3495,7 @@ restart:
if (status & PCBLOCK_ERROR)
{
+ my_errno= block->error;
DBUG_ASSERT(my_errno != 0);
DBUG_PRINT("error", ("Got error %d when doing page read", my_errno));
DBUG_RETURN((uchar *) 0);