mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +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:
@@ -50,7 +50,9 @@ int heap_scan(register HP_INFO *info, uchar *record)
|
|||||||
}
|
}
|
||||||
else
|
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)
|
if (info->next_block >= share->records+share->deleted)
|
||||||
{
|
{
|
||||||
info->next_block= share->records+share->deleted;
|
info->next_block= share->records+share->deleted;
|
||||||
|
Reference in New Issue
Block a user