summaryrefslogtreecommitdiff
path: root/storage/heap
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2019-08-20 12:57:52 +0300
committerMonty <monty@mariadb.org>2019-08-20 12:57:52 +0300
commit262927a9e5e49d57332e2123d667a33c5faa3f1a (patch)
tree76a1504ac630837948ad3f69b1e3e768d48408b6 /storage/heap
parent64c6f2bffc321f7640ae683d0341e1bc72ee2c00 (diff)
downloadmariadb-git-262927a9e5e49d57332e2123d667a33c5faa3f1a.tar.gz
Fixes a problem with heap when scanning and insert rows at the same time
This causes failures in versioning.update-big in 10.3 and above
Diffstat (limited to 'storage/heap')
-rw-r--r--storage/heap/hp_scan.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/storage/heap/hp_scan.c b/storage/heap/hp_scan.c
index 3315cb05b3f..361a1cd7397 100644
--- a/storage/heap/hp_scan.c
+++ b/storage/heap/hp_scan.c
@@ -44,6 +44,12 @@ 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;
@@ -51,15 +57,6 @@ 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])