InnoDB: correct potential overflow in trx_purge()
innobase/trx/trx0purge.c: trx_purge(): avoid overflow in setting srv_dml_needed_delay
This commit is contained in:
parent
beb3fddcf7
commit
74c254182d
@ -1057,12 +1057,15 @@ trx_purge(void)
|
|||||||
&& !UT_LIST_GET_LAST(trx_sys->view_list)) {
|
&& !UT_LIST_GET_LAST(trx_sys->view_list)) {
|
||||||
float ratio = (float) trx_sys->rseg_history_len
|
float ratio = (float) trx_sys->rseg_history_len
|
||||||
/ srv_max_purge_lag;
|
/ 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
|
/* If the history list length exceeds the
|
||||||
innodb_max_purge_lag, the
|
innodb_max_purge_lag, the
|
||||||
data manipulation statements are delayed
|
data manipulation statements are delayed
|
||||||
by at least 5000 microseconds. */
|
by at least 5000 microseconds. */
|
||||||
srv_dml_needed_delay = (ratio - .5) * 10000;
|
srv_dml_needed_delay = (ulint) ((ratio - .5) * 10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user