Commit 6c06defb authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYSTEM VERSIONING

heap_scan() makes info->next_block to be either an integer number
of share->block.records_in_block's or the total number of
records in the table. So when this total number or records changes,
info->next_block needs to be recalculated to take it into account.

This is a different fix for "Fixes a problem with heap when scanning and insert rows at the same time"
parent 1ad70bf2
......@@ -50,7 +50,9 @@ int heap_scan(register HP_INFO *info, uchar *record)
}
else
{
info->next_block+=share->block.records_in_block;
/* increase next_block to the next records_in_block boundary */
ulong rem= info->next_block % share->block.records_in_block;
info->next_block+=share->block.records_in_block - rem;
if (info->next_block >= share->records+share->deleted)
{
info->next_block= share->records+share->deleted;
......
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