diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-08-20 13:06:53 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-08-20 15:37:08 +0200 |
commit | 1ad70bf2fe380354ae1719d91644f2ec335e4b12 (patch) | |
tree | 97893e46ae30dfab7bf7c05d4164205f6cb8a02a /storage/heap | |
parent | 4438ff07cda1766d08730c93f92b298e845e3df9 (diff) | |
download | mariadb-git-1ad70bf2fe380354ae1719d91644f2ec335e4b12.tar.gz |
Revert "Fixes a problem with heap when scanning and insert rows at the same time"
This reverts commit 262927a9e5e49d57332e2123d667a33c5faa3f1a.
Diffstat (limited to 'storage/heap')
-rw-r--r-- | storage/heap/hp_scan.c | 15 |
1 files changed, 9 insertions, 6 deletions
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]) |