summaryrefslogtreecommitdiff
path: root/innobase/fil/fil0fil.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-12-20 03:41:04 +0200
committerunknown <monty@mysql.com>2003-12-20 03:41:04 +0200
commit65c44414c21c21ce7b57bd672873558ec2ed3031 (patch)
tree7b73c477120c02f912fc4e2d5105e727385d6bc6 /innobase/fil/fil0fil.c
parentaa2eb815d6453502889fafb8106bbe33c0632e73 (diff)
downloadmariadb-git-65c44414c21c21ce7b57bd672873558ec2ed3031.tar.gz
Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe
A after merge fix for last merge innobase/btr/btr0btr.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/btr/btr0sea.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0buf.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0flu.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0lru.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/buf/buf0rea.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/com/com0shm.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/data/data0data.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/data/data0type.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/dict/dict0crea.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/dict/dict0dict.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/fil/fil0fil.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/fsp/fsp0fsp.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/fut/fut0lst.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ha/ha0ha.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ibuf/ibuf0ibuf.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/include/univ.i: Disabled ut_sprintf/ut_fprintf. Not needed as all number arguments to printf are now casted innobase/lock/lock0lock.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/log/log0log.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/log/log0recv.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mem/mem0dbg.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mem/mem0pool.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mtr/mtr0log.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/mtr/mtr0mtr.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/os/os0file.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/os/os0sync.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/page/page0cur.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/page/page0page.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/read/read0read.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/rem/rem0cmp.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/rem/rem0rec.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/row/row0mysql.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe Heikki, please check the change of % to %% innobase/row/row0sel.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/row/row0undo.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/srv/srv0srv.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/srv/srv0start.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/sync/sync0arr.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/sync/sync0rw.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/sync/sync0sync.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0purge.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0rec.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0roll.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0sys.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0trx.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/trx/trx0undo.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/usr/usr0sess.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ut/ut0mem.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe innobase/ut/ut0ut.c: Add cast of integer/longlong to (ulong) to make printf/sprintf 64 bit safe sql/sql_delete.cc: After merge fix
Diffstat (limited to 'innobase/fil/fil0fil.c')
-rw-r--r--innobase/fil/fil0fil.c106
1 files changed, 61 insertions, 45 deletions
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index b45eec8e4cf..ee63df08744 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -432,7 +432,7 @@ fil_node_create(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: Could not find tablespace %lu for\n"
-"InnoDB: file %s from the tablespace memory cache.\n", id, name);
+"InnoDB: file %s from the tablespace memory cache.\n", (ulong) id, name);
mem_free(name2);
mem_free(node);
@@ -583,7 +583,7 @@ fil_try_to_close_file_in_LRU(
if (print_info) {
fprintf(stderr,
-"InnoDB: fil_sys open file LRU len %lu\n", UT_LIST_GET_LEN(system->LRU));
+"InnoDB: fil_sys open file LRU len %lu\n", (ulong) UT_LIST_GET_LEN(system->LRU));
}
while (node != NULL) {
@@ -598,7 +598,7 @@ fil_try_to_close_file_in_LRU(
if (print_info && node->n_pending_flushes > 0) {
fprintf(stderr,
"InnoDB: cannot close file %s, because n_pending_flushes %lu\n", node->name,
- node->n_pending_flushes);
+ (ulong) node->n_pending_flushes);
}
if (print_info
@@ -660,7 +660,8 @@ retry:
if (count2 > 20000) {
fprintf(stderr,
"InnoDB: Warning: tablespace %s has i/o ops stopped for a long time %lu\n",
- space->name, count2);
+ space->name,
+ (ulong) count2);
}
mutex_exit(&(system->mutex));
@@ -706,7 +707,7 @@ close_more:
" InnoDB: Warning: too many (%lu) files stay open while the maximum\n"
"InnoDB: allowed value would be %lu.\n"
"InnoDB: You may need to raise the value of innodb_max_files_open in\n"
-"InnoDB: my.cnf.\n", system->n_open, system->max_n_open);
+"InnoDB: my.cnf.\n", (ulong) system->n_open, (ulong) system->max_n_open);
return;
}
@@ -832,7 +833,8 @@ try_again:
"InnoDB: a tablespace %lu of name %s,\n"
"InnoDB: but a tablespace %lu of the same name %s\n"
"InnoDB: already exists in the tablespace memory cache!\n",
- id, name, space->id, space->name);
+ (ulong) id, name,
+ (ulong) space->id, space->name);
if (id == 0 || purpose != FIL_TABLESPACE) {
@@ -866,7 +868,7 @@ try_again:
"InnoDB: Error: trying to add tablespace %lu of name %s\n"
"InnoDB: to the tablespace memory cache, but tablespace\n"
"InnoDB: %lu of name %s already exists in the tablespace\n"
-"InnoDB: memory cache!\n", id, name, space->id, space->name);
+"InnoDB: memory cache!\n", (ulong) id, name, (ulong) space->id, space->name);
mutex_exit(&(system->mutex));
@@ -946,8 +948,8 @@ fil_assign_new_space_id(void)
"InnoDB: Warning: you are running out of new single-table tablespace id's.\n"
"InnoDB: Current counter is %lu and it must not exceed %lu!\n"
"InnoDB: To reset the counter to zero you have to dump all your tables and\n"
-"InnoDB: recreate the whole InnoDB installation.\n", id,
- SRV_LOG_SPACE_FIRST_ID);
+"InnoDB: recreate the whole InnoDB installation.\n", (ulong) id,
+ (ulong) SRV_LOG_SPACE_FIRST_ID);
}
if (id >= SRV_LOG_SPACE_FIRST_ID) {
@@ -956,7 +958,7 @@ fil_assign_new_space_id(void)
"InnoDB: You have run out of single-table tablespace id's!\n"
"InnoDB: Current counter is %lu.\n"
"InnoDB: To reset the counter to zero you have to dump all your tables and\n"
-"InnoDB: recreate the whole InnoDB installation.\n", id);
+"InnoDB: recreate the whole InnoDB installation.\n", (ulong) id);
system->max_assigned_id--;
id = ULINT_UNDEFINED;
@@ -991,7 +993,7 @@ fil_space_free(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: trying to remove tablespace %lu from the cache but\n"
-"InnoDB: it is not there.\n", id);
+"InnoDB: it is not there.\n", (ulong) id);
mutex_exit(&(system->mutex));
@@ -1214,7 +1216,8 @@ fil_open_log_and_system_tablespace_files(void)
"InnoDB: tablespace files open for the whole time mysqld is running, and\n"
"InnoDB: needs to open also some .ibd files if the file-per-table storage\n"
"InnoDB: model is used. Current open files %lu, max allowed open files %lu.\n",
- system->n_open, system->max_n_open);
+ (ulong) system->n_open,
+ (ulong) system->max_n_open);
}
node = UT_LIST_GET_NEXT(chain, node);
}
@@ -1269,7 +1272,7 @@ fil_set_max_space_id_if_bigger(
if (max_id >= SRV_LOG_SPACE_FIRST_ID) {
fprintf(stderr,
-"InnoDB: Fatal error: max tablespace id is too high, %lu\n", max_id);
+"InnoDB: Fatal error: max tablespace id is too high, %lu\n", (ulong) max_id);
ut_a(0);
}
@@ -1464,7 +1467,8 @@ fil_inc_pending_ibuf_merges(
if (space == NULL) {
fprintf(stderr,
-"InnoDB: Error: trying to do ibuf merge to a dropped tablespace %lu\n", id);
+"InnoDB: Error: trying to do ibuf merge to a dropped tablespace %lu\n",
+ (ulong) id);
}
if (space == NULL || space->stop_ibuf_merges) {
@@ -1497,7 +1501,8 @@ fil_decr_pending_ibuf_merges(
if (space == NULL) {
fprintf(stderr,
-"InnoDB: Error: decrementing ibuf merge of a dropped tablespace %lu\n", id);
+"InnoDB: Error: decrementing ibuf merge of a dropped tablespace %lu\n",
+ (ulong) id);
}
if (space != NULL) {
@@ -1767,7 +1772,8 @@ stop_ibuf_merges:
fprintf(stderr,
" InnoDB: Warning: trying to delete tablespace %s,\n"
"InnoDB: but there are %lu pending ibuf merges on it.\n"
-"InnoDB: Loop %lu.\n", space->name, space->n_pending_ibuf_merges, count);
+"InnoDB: Loop %lu.\n", space->name, (ulong) space->n_pending_ibuf_merges,
+ (ulong) count);
}
mutex_exit(&(system->mutex));
@@ -1791,7 +1797,8 @@ try_again:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: cannot delete tablespace %lu\n"
-"InnoDB: because it is not found in the tablespace memory cache.\n", id);
+"InnoDB: because it is not found in the tablespace memory cache.\n",
+ (ulong) id);
mutex_exit(&(system->mutex));
@@ -1815,8 +1822,9 @@ try_again:
fprintf(stderr,
" InnoDB: Warning: trying to delete tablespace %s,\n"
"InnoDB: but there are %lu flushes and %lu pending i/o's on it\n"
-"InnoDB: Loop %lu.\n", space->name, space->n_pending_flushes, node->n_pending,
- count);
+"InnoDB: Loop %lu.\n", space->name, (ulong) space->n_pending_flushes,
+ (ulong) node->n_pending,
+ (ulong) count);
}
mutex_exit(&(system->mutex));
os_thread_sleep(20000);
@@ -1892,7 +1900,7 @@ fil_discard_tablespace(
fprintf(stderr,
"InnoDB: Warning: cannot delete tablespace %lu in DISCARD TABLESPACE.\n"
"InnoDB: But let us remove the insert buffer entries for this tablespace.\n",
- id);
+ (ulong) id);
}
/* Remove all insert buffer entries for the tablespace */
@@ -1989,7 +1997,8 @@ retry:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: problems renaming %s to %s, %lu iterations\n",
- old_name, new_name, count);
+ old_name, new_name,
+ (ulong) count);
}
mutex_enter(&(system->mutex));
@@ -2000,7 +2009,7 @@ retry:
fprintf(stderr,
"InnoDB: Error: cannot find space id %lu from the tablespace memory cache\n"
"InnoDB: though the table %s in a rename operation should have that id\n",
- id, old_name);
+ (ulong) id, old_name);
mutex_exit(&(system->mutex));
return(FALSE);
@@ -2351,11 +2360,11 @@ fil_reset_too_high_lsns(
" InnoDB: Flush lsn in the tablespace file %lu to be imported\n"
"InnoDB: is %lu %lu, which exceeds current system lsn %lu %lu.\n"
"InnoDB: We reset the lsn's in the file %s.\n",
- space_id,
- ut_dulint_get_high(flush_lsn),
- ut_dulint_get_low(flush_lsn),
- ut_dulint_get_high(current_lsn),
- ut_dulint_get_low(current_lsn), filepath);
+ (ulong) space_id,
+ (ulong) ut_dulint_get_high(flush_lsn),
+ (ulong) ut_dulint_get_low(flush_lsn),
+ (ulong) ut_dulint_get_high(current_lsn),
+ (ulong) ut_dulint_get_low(current_lsn), filepath);
/* Loop through all the pages in the tablespace and reset the lsn and
the page checksum if necessary */
@@ -2487,7 +2496,7 @@ fil_open_single_table_tablespace(
fprintf(stderr,
" InnoDB: Error: tablespace id in file %s is %lu, but in the InnoDB\n"
-"InnoDB: data dictionary it is %lu.\n", filepath, space_id, id);
+"InnoDB: data dictionary it is %lu.\n", filepath, (ulong) space_id, (ulong) id);
fprintf(stderr,
"InnoDB: Have you moved InnoDB .ibd files around without using the\n"
"InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE?\n"
@@ -2587,8 +2596,9 @@ fil_load_single_table_tablespace(
if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
fprintf(stderr,
"InnoDB: Error: the size of single-table tablespace file %s\n"
-"InnoDB: is only %lu %lu, should be at least %lu!", filepath, size_high,
- size_low, (ulint)4 * UNIV_PAGE_SIZE);
+"InnoDB: is only %lu %lu, should be at least %lu!", filepath,
+ (ulong) size_high,
+ (ulong) size_low, (ulong) (4 * UNIV_PAGE_SIZE));
os_file_close(file);
ut_free(filepath);
@@ -2612,8 +2622,9 @@ fil_load_single_table_tablespace(
#ifndef UNIV_HOTBACKUP
if (space_id == ULINT_UNDEFINED || space_id == 0) {
fprintf(stderr,
-"InnoDB: Error: tablespace id %lu in file %s is not sensible\n", space_id,
- filepath);
+"InnoDB: Error: tablespace id %lu in file %s is not sensible\n",
+ (ulong) space_id,
+ filepath);
goto func_exit;
}
#else
@@ -2845,7 +2856,7 @@ fil_print_orphaned_tablespaces(void)
&& !space->mark) {
fprintf(stderr,
"InnoDB: Warning: tablespace %s of id %lu has no matching table in\n"
-"InnoDB: the InnoDB data dictionary.\n", space->name, space->id);
+"InnoDB: the InnoDB data dictionary.\n", space->name, (ulong) space->id);
}
space = UT_LIST_GET_NEXT(space_list, space);
@@ -2996,7 +3007,7 @@ fil_space_for_table_exists_in_mem(
"InnoDB: in InnoDB data dictionary has tablespace id %lu,\n"
"InnoDB: but tablespace with that id or name does not exist. Have\n"
"InnoDB: you deleted or moved .ibd files?\n",
- name, id);
+ name, (ulong) id);
} else {
ut_print_timestamp(stderr);
fprintf(stderr,
@@ -3005,7 +3016,8 @@ fil_space_for_table_exists_in_mem(
"InnoDB: but tablespace with that id does not exist. There is\n"
"InnoDB: a tablespace of name %s and id %lu, though. Have\n"
"InnoDB: you deleted or moved .ibd files?\n",
- name, id, namespace->name, namespace->id);
+ name, (ulong) id, namespace->name,
+ (ulong) namespace->id);
}
fprintf(stderr,
"InnoDB: You can look from section 15.1 of http://www.innodb.com/ibman.html\n"
@@ -3022,12 +3034,12 @@ fil_space_for_table_exists_in_mem(
" InnoDB: Error: table %s\n"
"InnoDB: in InnoDB data dictionary has tablespace id %lu,\n"
"InnoDB: but tablespace with that id has name %s.\n"
-"InnoDB: Have you deleted or moved .ibd files?\n", name, id, space->name);
+"InnoDB: Have you deleted or moved .ibd files?\n", name, (ulong) id, space->name);
if (namespace != NULL) {
fprintf(stderr,
"InnoDB: There is a tablespace with the right name\n"
-"InnoDB: %s, but its id is %lu.\n", namespace->name, namespace->id);
+"InnoDB: %s, but its id is %lu.\n", namespace->name, (ulong) namespace->id);
}
fprintf(stderr,
@@ -3377,7 +3389,8 @@ fil_node_prepare_for_io(
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: open files %lu exceeds the limit %lu\n",
- system->n_open, system->max_n_open);
+ (ulong) system->n_open,
+ (ulong) system->max_n_open);
}
if (node->open == FALSE) {
@@ -3520,7 +3533,8 @@ fil_io(
fprintf(stderr,
" InnoDB: Error: trying to do i/o to a tablespace which does not exist.\n"
"InnoDB: i/o type %lu, space id %lu, page no. %lu, i/o length %lu bytes\n",
- type, space_id, block_offset, len);
+ (ulong) type, (ulong) space_id, (ulong) block_offset,
+ (ulong) len);
return(DB_TABLESPACE_DELETED);
}
@@ -3543,8 +3557,9 @@ fil_io(
"InnoDB: space name %s,\n"
"InnoDB: which is outside the tablespace bounds.\n"
"InnoDB: Byte offset %lu, len %lu, i/o type %lu\n",
- block_offset, space_id, space->name, byte_offset, len,
- type);
+ (ulong) block_offset, (ulong) space_id,
+ space->name, (ulong) byte_offset, (ulong) len,
+ (ulong) type);
ut_a(0);
}
@@ -3571,8 +3586,9 @@ fil_io(
"InnoDB: space name %s,\n"
"InnoDB: which is outside the tablespace bounds.\n"
"InnoDB: Byte offset %lu, len %lu, i/o type %lu\n",
- block_offset, space_id, space->name, byte_offset, len,
- type);
+ (ulong) block_offset, (ulong) space_id,
+ space->name, (ulong) byte_offset, (ulong) len,
+ (ulong) type);
ut_a(0);
}
@@ -3704,8 +3720,8 @@ fil_aio_wait(
if (os_aio_use_native_aio) {
srv_io_thread_op_info[segment] = (char *) "handle native aio";
#ifdef WIN_ASYNC_IO
- ret = os_aio_windows_handle(segment, 0, &fil_node, &message,
- &type);
+ ret = os_aio_windows_handle(segment, 0, (void**) &fil_node,
+ &message, &type);
#elif defined(POSIX_ASYNC_IO)
ret = os_aio_posix_handle(segment, &fil_node, &message);
#else