Commit b4b8d1f6 authored by unknown's avatar unknown

univ.i, srv0srv.c:

  Define macro ULINTPF which can be used in printf statements as the print format of ulint both on Win64 and other platforms


innobase/srv/srv0srv.c:
  Define macro ULINTPF which can be used in printf statements as the print format of ulint both on Win64 and other platforms
innobase/include/univ.i:
  Define macro ULINTPF which can be used in printf statements as the print format of ulint both on Win64 and other platforms
parent 9e56a0a7
...@@ -67,16 +67,6 @@ Microsoft Visual C++ */ ...@@ -67,16 +67,6 @@ Microsoft Visual C++ */
#endif /* #if (defined(WIN32) || ... */ #endif /* #if (defined(WIN32) || ... */
#ifdef NOT_USED
/* On the 64-bit Windows we replace printf with ut_printf, etc. so that
we can use the %lu format string to print a 64-bit ulint */
#if defined(__WIN__) && (defined(WIN64) || defined(_WIN64))
#define printf ut_printf
#define sprintf ut_sprintf
#define fprintf ut_fprintf
#endif
#endif
/* DEBUG VERSION CONTROL /* DEBUG VERSION CONTROL
===================== */ ===================== */
...@@ -187,16 +177,20 @@ management to ensure correct alignment for doubles etc. */ ...@@ -187,16 +177,20 @@ management to ensure correct alignment for doubles etc. */
/* Note that inside MySQL 'byte' is defined as char on Linux! */ /* Note that inside MySQL 'byte' is defined as char on Linux! */
#define byte unsigned char #define byte unsigned char
/* Another basic type we use is unsigned long integer which is intended to be /* Another basic type we use is unsigned long integer which should be equal to
equal to the word size of the machine. */ the word size of the machine, that is on a 32-bit platform 32 bits, and on a
64-bit platform 64 bits. We also give the printf format for the type as a
macro PRULINT. */
#ifdef _WIN64 #ifdef _WIN64
typedef unsigned __int64 ulint; typedef unsigned __int64 ulint;
#define ULINTPF "%I64u"
typedef __int64 lint;
#else #else
typedef unsigned long int ulint; typedef unsigned long int ulint;
#endif #define ULINTPF "%lu"
typedef long int lint; typedef long int lint;
#endif
#ifdef __WIN__ #ifdef __WIN__
typedef __int64 ib_longlong; typedef __int64 ib_longlong;
......
...@@ -2447,14 +2447,16 @@ srv_sprintf_innodb_monitor( ...@@ -2447,14 +2447,16 @@ srv_sprintf_innodb_monitor(
"BUFFER POOL AND MEMORY\n" "BUFFER POOL AND MEMORY\n"
"----------------------\n"); "----------------------\n");
buf += sprintf(buf, buf += sprintf(buf,
"Total memory allocated %lu; in additional pool allocated %lu\n", "Total memory allocated " ULINTPF
(ulong) ut_total_allocated_memory, "; in additional pool allocated" ULINTPF "\n",
(ulong) mem_pool_get_reserved(mem_comm_pool)); ut_total_allocated_memory,
mem_pool_get_reserved(mem_comm_pool));
if (mem_out_of_mem_err_msg_count > 0) { if (mem_out_of_mem_err_msg_count > 0) {
buf += sprintf(buf, buf += sprintf(buf,
"Mem allocation has spilled out of additional mem pool %lu times\n", "Mem allocation has spilled out of additional mem pool" ULINTPF
(ulong) mem_out_of_mem_err_msg_count); "times\n",
mem_out_of_mem_err_msg_count);
} }
if (srv_use_awe) { if (srv_use_awe) {
...@@ -2472,7 +2474,7 @@ srv_sprintf_innodb_monitor( ...@@ -2472,7 +2474,7 @@ srv_sprintf_innodb_monitor(
"--------------\n"); "--------------\n");
buf += sprintf(buf, buf += sprintf(buf,
"%ld queries inside InnoDB, %lu queries in queue\n", "%ld queries inside InnoDB, %lu queries in queue\n",
(ulong) srv_conc_n_threads, (long) srv_conc_n_threads,
(ulong) srv_conc_n_waiting_threads); (ulong) srv_conc_n_waiting_threads);
n_reserved = fil_space_get_n_reserved_extents(0); n_reserved = fil_space_get_n_reserved_extents(0);
...@@ -2495,11 +2497,12 @@ srv_sprintf_innodb_monitor( ...@@ -2495,11 +2497,12 @@ srv_sprintf_innodb_monitor(
srv_main_thread_op_info); srv_main_thread_op_info);
#endif #endif
buf += sprintf(buf, buf += sprintf(buf,
"Number of rows inserted %lu, updated %lu, deleted %lu, read %lu\n", "Number of rows inserted " ULINTPF
(ulong) srv_n_rows_inserted, ", updated " ULINTPF ", deleted " ULINTPF ", read " ULINTPF "\n",
(ulong) srv_n_rows_updated, srv_n_rows_inserted,
(ulong) srv_n_rows_deleted, srv_n_rows_updated,
(ulong) srv_n_rows_read); srv_n_rows_deleted,
srv_n_rows_read);
buf += sprintf(buf, buf += sprintf(buf,
"%.2f inserts/s, %.2f updates/s, %.2f deletes/s, %.2f reads/s\n", "%.2f inserts/s, %.2f updates/s, %.2f deletes/s, %.2f reads/s\n",
(srv_n_rows_inserted - srv_n_rows_inserted_old) (srv_n_rows_inserted - srv_n_rows_inserted_old)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment