Cleanup: Make InnoDB page numbers uint32_t

InnoDB stores a 32-bit page number in page headers and in some
data structures, such as FIL_ADDR (consisting of a 32-bit page number
and a 16-bit byte offset within a page). For better compile-time
error detection and to reduce the memory footprint in some data
structures, let us use a uint32_t for the page number, instead
of ulint (size_t) which can be 64 bits.
This commit is contained in:
Marko Mäkelä 2020-10-15 16:28:19 +03:00
commit 9028cc6b86
46 changed files with 443 additions and 606 deletions

View file

@ -489,8 +489,8 @@ buf_load()
page_id_t* dump;
ulint dump_n;
ulint i;
ulint space_id;
ulint page_no;
uint32_t space_id;
uint32_t page_no;
int fscanf_ret;
/* Ignore any leftovers from before */
@ -514,7 +514,7 @@ buf_load()
This file is tiny (approx 500KB per 1GB buffer pool), reading it
two times is fine. */
dump_n = 0;
while (fscanf(f, ULINTPF "," ULINTPF, &space_id, &page_no) == 2
while (fscanf(f, "%u,%u", &space_id, &page_no) == 2
&& !SHUTTING_DOWN()) {
dump_n++;
}
@ -565,8 +565,7 @@ buf_load()
export_vars.innodb_buffer_pool_load_incomplete = 1;
for (i = 0; i < dump_n && !SHUTTING_DOWN(); i++) {
fscanf_ret = fscanf(f, ULINTPF "," ULINTPF,
&space_id, &page_no);
fscanf_ret = fscanf(f, "%u,%u", &space_id, &page_no);
if (fscanf_ret != 2) {
if (feof(f)) {
@ -588,9 +587,8 @@ buf_load()
fclose(f);
buf_load_status(STATUS_ERR,
"Error parsing '%s': bogus"
" space,page " ULINTPF "," ULINTPF
" at line " ULINTPF ","
" unable to load buffer pool",
" space,page %u,%u at line " ULINTPF
", unable to load buffer pool",
full_filename,
space_id, page_no,
i);