summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2004-03-04 15:32:16 +0200
committerheikki@hundin.mysql.fi <>2004-03-04 15:32:16 +0200
commit995b74ee0db22aeacbfe8f4d19cef94b2fa4000d (patch)
tree016ef387929b3094e3e12ad1561f8fc4390c45eb /innobase
parent6fbf1efdc2b8fe54e2508b7468d5a879d71ced47 (diff)
downloadmariadb-git-995b74ee0db22aeacbfe8f4d19cef94b2fa4000d.tar.gz
srv0srv.c:
Protect the reading of the latest foreign key error explantion buffer with a mutex; in theory, a race condition could cause SHOW INNODB STATUS print garbage characters after the error info; remove the sprintf of the latest UNIQUE KEY error, since the buffer really was always empty
Diffstat (limited to 'innobase')
-rw-r--r--innobase/srv/srv0srv.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index cea17e9f223..2bb3e8ea60c 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -1434,6 +1434,13 @@ srv_sprintf_innodb_monitor(
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
+ /* Conceptually, srv_innodb_monitor_mutex has a very high latching
+ order level in sync0sync.h, while dict_foreign_err_mutex has a very
+ low level 135. Therefore we can reserve the latter mutex here without
+ a danger of a deadlock of threads. */
+
+ mutex_enter(&dict_foreign_err_mutex);
+
if (*dict_foreign_err_buf != '\0') {
buf += sprintf(buf,
"------------------------\n"
@@ -1445,18 +1452,7 @@ srv_sprintf_innodb_monitor(
}
}
- ut_a(buf < buf_end + 1500);
-
- if (*dict_unique_err_buf != '\0') {
- buf += sprintf(buf,
-"---------------------------------------------------------------\n"
-"LATEST UNIQUE KEY ERROR (is masked in REPLACE or INSERT IGNORE)\n"
-"---------------------------------------------------------------\n");
-
- if (buf_end - buf > 6000) {
- buf+= sprintf(buf, "%.4000s", dict_unique_err_buf);
- }
- }
+ mutex_exit(&dict_foreign_err_mutex);
ut_a(buf < buf_end + 1500);