1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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"
This commit is contained in:
Sergei Golubchik
2019-08-19 14:17:38 +02:00
parent 1ad70bf2fe
commit 6c06defb5f

View File

@@ -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;