summaryrefslogtreecommitdiff
path: root/innobase/srv
diff options
context:
space:
mode:
authormonty@mysql.com <>2003-12-20 03:41:04 +0200
committermonty@mysql.com <>2003-12-20 03:41:04 +0200
commit0448a3f4c01fdbc1d3ae0c26dddba7874b652394 (patch)
tree7b73c477120c02f912fc4e2d5105e727385d6bc6 /innobase/srv
parent4b3e443b3637446ef5933fd705e92a1d198c6568 (diff)
downloadmariadb-git-0448a3f4c01fdbc1d3ae0c26dddba7874b652394.tar.gz
Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe
A after merge fix for last merge
Diffstat (limited to 'innobase/srv')
-rw-r--r--innobase/srv/srv0srv.c59
-rw-r--r--innobase/srv/srv0start.c52
2 files changed, 59 insertions, 52 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index 1f709025759..2c1cb07c703 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -637,7 +637,8 @@ srv_suspend_thread(void)
if (srv_print_thread_releases) {
printf("Suspending thread %lu to slot %lu meter %lu\n",
- os_thread_get_curr_id(), slot_no, srv_meter[SRV_RECOVERY]);
+ (ulong) os_thread_get_curr_id(), (ulong) slot_no,
+ (ulong) srv_meter[SRV_RECOVERY]);
}
slot = srv_table_get_nth_slot(slot_no);
@@ -697,7 +698,8 @@ srv_release_threads(
if (srv_print_thread_releases) {
printf(
"Releasing thread %lu type %lu from slot %lu meter %lu\n",
- slot->id, type, i, srv_meter[SRV_RECOVERY]);
+ (ulong) slot->id, (ulong) type, (ulong) i,
+ (ulong) srv_meter[SRV_RECOVERY]);
}
count++;
@@ -776,7 +778,7 @@ srv_dec_thread_count(
/* FIXME: the following assertion sometimes fails: */
if (srv_n_threads_active[type] == 0) {
- printf("Error: thread type %lu\n", type);
+ printf("Error: thread type %lu\n", (ulong) type);
ut_ad(0);
}
@@ -987,7 +989,7 @@ srv_console(
printf(
"Starting disk access simulation with pct %lu\n",
- srv_sim_disk_wait_pct);
+ (ulong) srv_sim_disk_wait_pct);
} else {
printf("\nNot supported!\n");
}
@@ -2114,7 +2116,7 @@ srv_table_reserve_slot_for_mysql(void)
" InnoDB: There appear to be %lu MySQL threads currently waiting\n"
"InnoDB: inside InnoDB, which is the upper limit. Cannot continue operation.\n"
"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
-"InnoDB: on Linux. But first we print a list of waiting threads.\n", i);
+"InnoDB: on Linux. But first we print a list of waiting threads.\n", (ulong) i);
for (i = 0; i < OS_THREAD_MAX_N; i++) {
@@ -2122,10 +2124,10 @@ srv_table_reserve_slot_for_mysql(void)
fprintf(stderr,
"Slot %lu: thread id %lu, type %lu, in use %lu, susp %lu, time %lu\n",
- i, os_thread_pf(slot->id),
- slot->type, slot->in_use,
- slot->suspended,
- (ulint)difftime(ut_time(), slot->suspend_time));
+ (ulong) i, (ulong) os_thread_pf(slot->id),
+ (ulong) slot->type, (ulong) slot->in_use,
+ (ulong) slot->suspended,
+ (ulong) difftime(ut_time(), slot->suspend_time));
}
ut_a(0);
@@ -2368,7 +2370,7 @@ srv_sprintf_innodb_monitor(
buf += sprintf(buf,
"Per second averages calculated from the last %lu seconds\n",
- (ulint)time_elapsed);
+ (ulong) time_elapsed);
buf += sprintf(buf, "----------\n"
"SEMAPHORES\n"
@@ -2446,19 +2448,19 @@ srv_sprintf_innodb_monitor(
"----------------------\n");
buf += sprintf(buf,
"Total memory allocated %lu; in additional pool allocated %lu\n",
- ut_total_allocated_memory,
- mem_pool_get_reserved(mem_comm_pool));
+ (ulong) ut_total_allocated_memory,
+ (ulong) mem_pool_get_reserved(mem_comm_pool));
if (mem_out_of_mem_err_msg_count > 0) {
buf += sprintf(buf,
"Mem allocation has spilled out of additional mem pool %lu times\n",
- mem_out_of_mem_err_msg_count);
+ (ulong) mem_out_of_mem_err_msg_count);
}
if (srv_use_awe) {
buf += sprintf(buf,
"In addition to that %lu MB of AWE memory allocated\n",
- srv_pool_size / ((1024 * 1024) / UNIV_PAGE_SIZE));
+ (ulong) (srv_pool_size / ((1024 * 1024) / UNIV_PAGE_SIZE)));
}
buf_print_io(buf, buf_end);
@@ -2470,33 +2472,34 @@ srv_sprintf_innodb_monitor(
"--------------\n");
buf += sprintf(buf,
"%ld queries inside InnoDB, %lu queries in queue\n",
- srv_conc_n_threads, srv_conc_n_waiting_threads);
+ (ulong) srv_conc_n_threads,
+ (ulong) srv_conc_n_waiting_threads);
n_reserved = fil_space_get_n_reserved_extents(0);
if (n_reserved > 0) {
buf += sprintf(buf,
"%lu tablespace extents now reserved for B-tree split operations\n",
- n_reserved);
+ (ulong) n_reserved);
}
#ifdef UNIV_LINUX
buf += sprintf(buf,
"Main thread process no. %lu, id %lu, state: %s\n",
- srv_main_thread_process_no,
- srv_main_thread_id,
- srv_main_thread_op_info);
+ (ulong) srv_main_thread_process_no,
+ (ulong) srv_main_thread_id,
+ srv_main_thread_op_info);
#else
buf += sprintf(buf,
"Main thread id %lu, state: %s\n",
- srv_main_thread_id,
+ (ulong) srv_main_thread_id,
srv_main_thread_op_info);
#endif
buf += sprintf(buf,
"Number of rows inserted %lu, updated %lu, deleted %lu, read %lu\n",
- srv_n_rows_inserted,
- srv_n_rows_updated,
- srv_n_rows_deleted,
- srv_n_rows_read);
+ (ulong) srv_n_rows_inserted,
+ (ulong) srv_n_rows_updated,
+ (ulong) srv_n_rows_deleted,
+ (ulong) srv_n_rows_read);
buf += sprintf(buf,
"%.2f inserts/s, %.2f updates/s, %.2f deletes/s, %.2f reads/s\n",
(srv_n_rows_inserted - srv_n_rows_inserted_old)
@@ -2746,10 +2749,10 @@ loop:
" InnoDB: Error: old log sequence number %lu %lu was greater\n"
"InnoDB: than the new log sequence number %lu %lu!\n"
"InnoDB: Please send a bug report to mysql@lists.mysql.com\n",
- ut_dulint_get_high(old_lsn),
- ut_dulint_get_low(old_lsn),
- ut_dulint_get_high(new_lsn),
- ut_dulint_get_low(new_lsn));
+ (ulong) ut_dulint_get_high(old_lsn),
+ (ulong) ut_dulint_get_low(old_lsn),
+ (ulong) ut_dulint_get_high(new_lsn),
+ (ulong) ut_dulint_get_low(new_lsn));
}
old_lsn = new_lsn;
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 69ddaec0619..a2d4d2ba9b8 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -565,7 +565,7 @@ open_or_create_log_file(
srv_log_group_home_dirs[k] = srv_add_path_separator_if_needed(
srv_log_group_home_dirs[k]);
- sprintf(name, "%s%s%lu", srv_log_group_home_dirs[k], "ib_logfile", i);
+ sprintf(name, "%s%s%lu", srv_log_group_home_dirs[k], "ib_logfile", (ulong) i);
files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_NORMAL,
OS_LOG_FILE, &ret);
@@ -595,9 +595,9 @@ open_or_create_log_file(
fprintf(stderr,
"InnoDB: Error: log file %s is of different size %lu %lu bytes\n"
"InnoDB: than specified in the .cnf file %lu %lu bytes!\n",
- name, size_high, size,
- srv_calc_high32(srv_log_file_size),
- srv_calc_low32(srv_log_file_size));
+ name, (ulong) size_high, (ulong) size,
+ (ulong) srv_calc_high32(srv_log_file_size),
+ (ulong) srv_calc_low32(srv_log_file_size));
return(DB_ERROR);
}
@@ -615,7 +615,7 @@ open_or_create_log_file(
}
fprintf(stderr, "InnoDB: Setting log file %s size to %lu MB\n",
- name, srv_log_file_size
+ name, (ulong) srv_log_file_size
>> (20 - UNIV_PAGE_SIZE_SHIFT));
fprintf(stderr,
@@ -702,7 +702,7 @@ open_or_create_data_files(
if (srv_n_data_files >= 1000) {
fprintf(stderr, "InnoDB: can only have < 1000 data files\n"
"InnoDB: you have defined %lu\n",
- srv_n_data_files);
+ (ulong) srv_n_data_files);
return(DB_ERROR);
}
@@ -814,8 +814,9 @@ open_or_create_data_files(
"InnoDB: Error: auto-extending data file %s is of a different size\n"
"InnoDB: %lu pages (rounded down to MB) than specified in the .cnf file:\n"
"InnoDB: initial %lu pages, max %lu (relevant if non-zero) pages!\n",
- name, rounded_size_pages,
- srv_data_file_sizes[i], srv_last_file_size_max);
+ name, (ulong) rounded_size_pages,
+ (ulong) srv_data_file_sizes[i],
+ (ulong) srv_last_file_size_max);
return(DB_ERROR);
}
@@ -829,8 +830,8 @@ open_or_create_data_files(
"InnoDB: Error: data file %s is of a different size\n"
"InnoDB: %lu pages (rounded down to MB)\n"
"InnoDB: than specified in the .cnf file %lu pages!\n", name,
- rounded_size_pages,
- srv_data_file_sizes[i]);
+ (ulong) rounded_size_pages,
+ (ulong) srv_data_file_sizes[i]);
return(DB_ERROR);
}
@@ -861,7 +862,7 @@ skip_size_check:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Setting file %s size to %lu MB\n",
- name, (srv_data_file_sizes[i]
+ name, (ulong) (srv_data_file_sizes[i]
>> (20 - UNIV_PAGE_SIZE_SHIFT)));
fprintf(stderr,
@@ -1040,7 +1041,8 @@ innobase_start_or_create_for_mysql(void)
"InnoDB: Error: trx_t size is %lu in ha_innodb.cc but %lu in srv0start.c\n"
"InnoDB: Check that pthread_mutex_t is defined in the same way in these\n"
"InnoDB: compilation modules. Cannot continue.\n",
- srv_sizeof_trx_t_in_ha_innodb_cc, (ulint)sizeof(trx_t));
+ (ulong) srv_sizeof_trx_t_in_ha_innodb_cc,
+ (ulong) sizeof(trx_t));
return(DB_ERROR);
}
@@ -1219,8 +1221,8 @@ NetWare. */
if (srv_use_awe) {
fprintf(stderr,
"InnoDB: Using AWE: Memory window is %lu MB and AWE memory is %lu MB\n",
- srv_awe_window_size / ((1024 * 1024) / UNIV_PAGE_SIZE),
- srv_pool_size / ((1024 * 1024) / UNIV_PAGE_SIZE));
+ (ulong) (srv_awe_window_size / ((1024 * 1024) / UNIV_PAGE_SIZE)),
+ (ulong) (srv_pool_size / ((1024 * 1024) / UNIV_PAGE_SIZE)));
/* We must disable adaptive hash indexes because they do not
tolerate remapping of pages in AWE */
@@ -1545,7 +1547,8 @@ NetWare. */
fprintf(stderr,
"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is %lu pages\n",
- tablespace_size_in_header, sum_of_data_file_sizes);
+ (ulong) tablespace_size_in_header,
+ (ulong) sum_of_data_file_sizes);
}
if (srv_auto_extend_last_data_file
@@ -1554,7 +1557,8 @@ NetWare. */
fprintf(stderr,
"InnoDB: Error: tablespace size stored in header is %lu pages, but\n"
"InnoDB: the sum of data file sizes is only %lu pages\n",
- tablespace_size_in_header, sum_of_data_file_sizes);
+ (ulong) tablespace_size_in_header,
+ (ulong) sum_of_data_file_sizes);
}
/* Check that os_fast_mutexes work as expected */
@@ -1579,14 +1583,14 @@ NetWare. */
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Started; log sequence number %lu %lu\n",
- ut_dulint_get_high(srv_start_lsn),
- ut_dulint_get_low(srv_start_lsn));
+ (ulong) ut_dulint_get_high(srv_start_lsn),
+ (ulong) ut_dulint_get_low(srv_start_lsn));
}
if (srv_force_recovery > 0) {
fprintf(stderr,
"InnoDB: !!! innodb_force_recovery is set to %lu !!!\n",
- srv_force_recovery);
+ (ulong) srv_force_recovery);
}
fflush(stderr);
@@ -1716,7 +1720,7 @@ innobase_shutdown_for_mysql(void)
if (i == 1000) {
fprintf(stderr,
"InnoDB: Warning: %lu threads created by InnoDB had not exited at shutdown!\n",
- os_thread_count);
+ (ulong) os_thread_count);
}
/* 3. Free all InnoDB's own mutexes and the os_fast_mutexes inside
@@ -1741,16 +1745,16 @@ innobase_shutdown_for_mysql(void)
fprintf(stderr,
"InnoDB: Warning: some resources were not cleaned up in shutdown:\n"
"InnoDB: threads %lu, events %lu, os_mutexes %lu, os_fast_mutexes %lu\n",
- os_thread_count, os_event_count, os_mutex_count,
- os_fast_mutex_count);
+ (ulong) os_thread_count, (ulong) os_event_count,
+ (ulong) os_mutex_count, (ulong) os_fast_mutex_count);
}
if (srv_print_verbose_log) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Shutdown completed; log sequence number %lu %lu\n",
- ut_dulint_get_high(srv_shutdown_lsn),
- ut_dulint_get_low(srv_shutdown_lsn));
+ (ulong) ut_dulint_get_high(srv_shutdown_lsn),
+ (ulong) ut_dulint_get_low(srv_shutdown_lsn));
}
return((int) DB_SUCCESS);