summaryrefslogtreecommitdiff
path: root/innobase/srv
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-07-08 20:04:10 +0300
committerunknown <heikki@hundin.mysql.fi>2002-07-08 20:04:10 +0300
commit5db805be78e04beafceba01c60f5ce8a8eb8c2a4 (patch)
treeb4aef8dc005066208f32fdfcb01c39be335d0695 /innobase/srv
parentc0e8c9a11f0427fe6e0604eaeef5988abdb55210 (diff)
downloadmariadb-git-5db805be78e04beafceba01c60f5ce8a8eb8c2a4.tar.gz
srv0srv.c:
Eliminate potential division by zero innobase/srv/srv0srv.c: Eliminate potential division by zero
Diffstat (limited to 'innobase/srv')
-rw-r--r--innobase/srv/srv0srv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 81b3333cbe8..5d9d6a77b12 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -2148,7 +2148,12 @@ srv_sprintf_innodb_monitor(
current_time = time(NULL);
- time_elapsed = difftime(current_time, srv_last_monitor_time);
+ /* We add 0.001 seconds to time_elapsed to prevent division
+ by zero if two users happen to call SHOW INNODB STATUS at the same
+ time */
+
+ time_elapsed = difftime(current_time, srv_last_monitor_time)
+ + 0.001;
srv_last_monitor_time = time(NULL);
@@ -2443,13 +2448,13 @@ loop:
srv_error_monitor_active = TRUE;
os_thread_sleep(10000000);
- /*
+
printf("Validating has index\n");
btr_search_validate();
printf("Hash index validated\n");
- */
+
sync_array_print_long_waits();
/* Flush stdout and stderr so that a database user gets their output