From 1ad70bf2fe380354ae1719d91644f2ec335e4b12 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 20 Aug 2019 13:06:53 +0200 Subject: Revert "Fixes a problem with heap when scanning and insert rows at the same time" This reverts commit 262927a9e5e49d57332e2123d667a33c5faa3f1a. --- storage/heap/hp_scan.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'storage/heap') diff --git a/storage/heap/hp_scan.c b/storage/heap/hp_scan.c index 361a1cd7397..3315cb05b3f 100644 --- a/storage/heap/hp_scan.c +++ b/storage/heap/hp_scan.c @@ -44,12 +44,6 @@ int heap_scan(register HP_INFO *info, uchar *record) DBUG_ENTER("heap_scan"); pos= ++info->current_record; - if (pos >= share->records+share->deleted) - { - info->update= 0; /* No active row */ - DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE); - } - if (pos < info->next_block) { info->current_ptr+=share->block.recbuffer; @@ -57,6 +51,15 @@ int heap_scan(register HP_INFO *info, uchar *record) else { info->next_block+=share->block.records_in_block; + if (info->next_block >= share->records+share->deleted) + { + info->next_block= share->records+share->deleted; + if (pos >= info->next_block) + { + info->update= 0; + DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE); + } + } hp_find_record(info, pos); } if (!info->current_ptr[share->visible]) -- cgit v1.2.1