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 14:43:04 +0200
commit48ac7e1a42ac932582d0650ac54ec8900ae801bd (patch)
treeef8afe5eb40e66bec818be8a1bfd0a141521e6a2
parent959dfac4d0e715725d05448a77c08d870d5aa247 (diff)
downloadmariadb-git-48ac7e1a42ac932582d0650ac54ec8900ae801bd.tar.gz
MDEV-24609: innodb_io_capacity can exceed innodb_io_capacity_max
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 70e4ba79bb7..c8be848fabe 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,