1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

ha_innobase.cc, ut0ut.c, univ.i, ut0ut.h:

Redefine sprintf as ut_sprintf inside InnoDB code; some old Unixes may have a pointer as the return type of sprintf
lock0lock.c:
  Add safety against buffer overruns in latest deadlock info
srv0srv.c:
  Add safety against buffer overruns in SHOW INNODB STATUS
os0thread.h, os0thread.c:
  Fix a portability bug introduced in Windows when we changed os_thread_id_t to be the same as os_thread_t
This commit is contained in:
heikki@hundin.mysql.fi
2002-08-11 18:49:47 +03:00
parent 0005f28b4e
commit bee3f072e4
8 changed files with 82 additions and 62 deletions

View File

@ -2222,6 +2222,7 @@ srv_sprintf_innodb_monitor(
ut_sprintf_timestamp(buf);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
buf += sprintf(buf, " INNODB MONITOR OUTPUT\n"
"=====================================\n");
@ -2236,6 +2237,7 @@ srv_sprintf_innodb_monitor(
sync_print(buf, buf_end);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
buf += sprintf(buf, "------------\n"
"TRANSACTIONS\n"
@ -2248,15 +2250,18 @@ srv_sprintf_innodb_monitor(
"--------\n");
os_aio_print(buf, buf_end);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
buf += sprintf(buf, "-------------------------------------\n"
"INSERT BUFFER AND ADAPTIVE HASH INDEX\n"
"-------------------------------------\n");
ibuf_print(buf, buf_end);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
ha_print_info(buf, buf_end, btr_search_sys->hash_index);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
buf += sprintf(buf,
"%.2f hash searches/s, %.2f non-hash searches/s\n",
@ -2272,6 +2277,7 @@ srv_sprintf_innodb_monitor(
"---\n");
log_print(buf, buf_end);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
buf += sprintf(buf, "----------------------\n"
"BUFFER POOL AND MEMORY\n"
@ -2282,6 +2288,7 @@ srv_sprintf_innodb_monitor(
mem_pool_get_reserved(mem_comm_pool));
buf_print_io(buf, buf_end);
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
buf += sprintf(buf, "--------------\n"
"ROW OPERATIONS\n"
@ -2315,6 +2322,8 @@ srv_sprintf_innodb_monitor(
buf += sprintf(buf, "----------------------------\n"
"END OF INNODB MONITOR OUTPUT\n"
"============================\n");
ut_a(buf < buf_end + 1900);
mutex_exit(&srv_innodb_monitor_mutex);
}
@ -2372,7 +2381,9 @@ loop:
buf = mem_alloc(100000);
srv_sprintf_innodb_monitor(buf, 100000);
srv_sprintf_innodb_monitor(buf, 90000);
ut_a(strlen(buf) < 99000);
printf("%s", buf);