1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-18479 Complement

This patch complements the patch that fixes bug MDEV-18479.
This patch takes care of possible overflow when calculating the
estimated number of rows in a materialized derived table / view.
This commit is contained in:
Igor Babaev
2019-05-28 23:26:36 -07:00
parent eb09580b67
commit cbb90f77cd
5 changed files with 29 additions and 20 deletions

View File

@ -4100,7 +4100,10 @@ void SELECT_LEX::increase_derived_records(ha_rows records)
DBUG_ASSERT(unit->derived);
select_union *result= (select_union*)unit->result;
result->records+= records;
if (HA_ROWS_MAX - records > result->records)
result->records+= records;
else
result->records= HA_ROWS_MAX;
}