Commit 1ad70bf2 authored by Sergei Golubchik's avatar Sergei Golubchik

Revert "Fixes a problem with heap when scanning and insert rows at the same time"

This reverts commit 262927a9.
parent 4438ff07
...@@ -44,12 +44,6 @@ int heap_scan(register HP_INFO *info, uchar *record) ...@@ -44,12 +44,6 @@ int heap_scan(register HP_INFO *info, uchar *record)
DBUG_ENTER("heap_scan"); DBUG_ENTER("heap_scan");
pos= ++info->current_record; 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) if (pos < info->next_block)
{ {
info->current_ptr+=share->block.recbuffer; info->current_ptr+=share->block.recbuffer;
...@@ -57,6 +51,15 @@ int heap_scan(register HP_INFO *info, uchar *record) ...@@ -57,6 +51,15 @@ int heap_scan(register HP_INFO *info, uchar *record)
else else
{ {
info->next_block+=share->block.records_in_block; 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); hp_find_record(info, pos);
} }
if (!info->current_ptr[share->visible]) if (!info->current_ptr[share->visible])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment