summaryrefslogtreecommitdiff
path: root/innobase/trx
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-10-13 11:29:57 +0300
committerunknown <marko@hundin.mysql.fi>2004-10-13 11:29:57 +0300
commit74c254182dad379fb81153fa227f5f8e84f67d39 (patch)
treed87fe2e2b0be389709fee21d9b3646b230d7338e /innobase/trx
parentbeb3fddcf7b8cb852ee0be8debf4b9ea3d0ebcb2 (diff)
downloadmariadb-git-74c254182dad379fb81153fa227f5f8e84f67d39.tar.gz
InnoDB: correct potential overflow in trx_purge()
innobase/trx/trx0purge.c: trx_purge(): avoid overflow in setting srv_dml_needed_delay
Diffstat (limited to 'innobase/trx')
-rw-r--r--innobase/trx/trx0purge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c
index 1a4ef6a2e99..5c62640e011 100644
--- a/innobase/trx/trx0purge.c
+++ b/innobase/trx/trx0purge.c
@@ -1057,12 +1057,15 @@ trx_purge(void)
&& !UT_LIST_GET_LAST(trx_sys->view_list)) {
float ratio = (float) trx_sys->rseg_history_len
/ srv_max_purge_lag;
- if (ratio > 1) {
+ if (ratio > ULINT_MAX / 10000) {
+ /* Avoid overflow: maximum delay is 4295 seconds */
+ srv_dml_needed_delay = ULINT_MAX;
+ } else if (ratio > 1) {
/* If the history list length exceeds the
innodb_max_purge_lag, the
data manipulation statements are delayed
by at least 5000 microseconds. */
- srv_dml_needed_delay = (ratio - .5) * 10000;
+ srv_dml_needed_delay = (ulint) ((ratio - .5) * 10000);
}
}