summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-01-19 11:53:22 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2021-01-19 11:53:22 +0200
commitbde9aa8e8cefb7bc89befb931b5db6609c4bbbd6 (patch)
treeb571fdd7e46de54e7df954dc67fcdf647bf26a9a
parentbeaea31ab12ab56ea8a6eb5e99cf82648675ea78 (diff)
downloadmariadb-git-bb-10.2-MDEV-24609.tar.gz
MDEV-24609: innodb_io_capacity can exceed innodb_io_capacity_maxbb-10.2-MDEV-24609
innodb_io_capacity_update(): When the requested innodb_io_capacity exceeds innodb_io_capacity_max and is more than half the maximum, do not double it for computing innodb_io_capacity_max. This integer arithmetics overflow was introduced in commit 0f32299437a036ddaad04fe14a6ff63d15e3a72b (MDEV-7035). No test case is added, because sizeof(ulong) varies between platforms.
-rw-r--r--storage/innobase/handler/ha_innodb.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 0dea402b32b..e513155b0e0 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -17532,7 +17532,8 @@ innodb_io_capacity_update(
" higher than innodb_io_capacity_max %lu",
in_val, srv_max_io_capacity);
- srv_max_io_capacity = in_val * 2;
+ srv_max_io_capacity = (in_val & ~(~0UL >> 1))
+ ? in_val : in_val * 2;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,