diff options
author | Igor Babaev <igor@askmonty.org> | 2019-05-28 23:26:36 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2019-05-28 23:26:36 -0700 |
commit | cbb90f77cdbf57c02145dc6cd86acf8ebb8a88f0 (patch) | |
tree | dd5a613a38a95a9a4f05144ac10e1b96c945a6ab /sql/sql_lex.cc | |
parent | eb09580b67ee19f7ac30c1a41c8307b9c7d482d1 (diff) | |
download | mariadb-git-cbb90f77cdbf57c02145dc6cd86acf8ebb8a88f0.tar.gz |
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.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 3e20cdb48da..28f56282bad 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -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; } |