Browse Source

Replace univ_page_size and UNIV_PAGE_SIZE

Try to use one variable (srv_page_size) for innodb_page_size.

Also, replace UNIV_PAGE_SIZE_SHIFT with srv_page_size_shift.
pull/738/head
Marko Mäkelä 8 years ago
parent
commit
a90100d756
  1. 6
      extra/mariabackup/fil_cur.cc
  2. 25
      extra/mariabackup/xtrabackup.cc
  3. 16
      storage/innobase/btr/btr0btr.cc
  4. 10
      storage/innobase/btr/btr0bulk.cc
  5. 18
      storage/innobase/btr/btr0cur.cc
  6. 4
      storage/innobase/btr/btr0defragment.cc
  7. 2
      storage/innobase/btr/btr0scrub.cc
  8. 14
      storage/innobase/buf/buf0buddy.cc
  9. 62
      storage/innobase/buf/buf0buf.cc
  10. 6
      storage/innobase/buf/buf0checksum.cc
  11. 62
      storage/innobase/buf/buf0dblwr.cc
  12. 4
      storage/innobase/buf/buf0flu.cc
  13. 20
      storage/innobase/buf/buf0lru.cc
  14. 2
      storage/innobase/buf/buf0rea.cc
  15. 18
      storage/innobase/dict/dict0dict.cc
  16. 12
      storage/innobase/fil/fil0crypt.cc
  17. 40
      storage/innobase/fil/fil0fil.cc
  18. 40
      storage/innobase/fil/fil0pagecompress.cc
  19. 22
      storage/innobase/fsp/fsp0file.cc
  20. 4
      storage/innobase/fsp/fsp0fsp.cc
  21. 14
      storage/innobase/fsp/fsp0sysspace.cc
  22. 2
      storage/innobase/gis/gis0rtree.cc
  23. 2
      storage/innobase/gis/gis0sea.cc
  24. 32
      storage/innobase/handler/ha_innodb.cc
  25. 20
      storage/innobase/ibuf/ibuf0ibuf.cc
  26. 2
      storage/innobase/include/btr0btr.h
  27. 2
      storage/innobase/include/btr0cur.h
  28. 6
      storage/innobase/include/buf0buddy.h
  29. 10
      storage/innobase/include/buf0buddy.ic
  30. 8
      storage/innobase/include/buf0buf.h
  31. 10
      storage/innobase/include/buf0buf.ic
  32. 2
      storage/innobase/include/buf0checksum.h
  33. 4
      storage/innobase/include/buf0dblwr.h
  34. 4
      storage/innobase/include/buf0types.h
  35. 8
      storage/innobase/include/dict0dict.ic
  36. 6
      storage/innobase/include/fsp0fsp.h
  37. 4
      storage/innobase/include/fsp0fsp.ic
  38. 2
      storage/innobase/include/fsp0sysspace.h
  39. 14
      storage/innobase/include/fsp0types.h
  40. 2
      storage/innobase/include/fut0fut.ic
  41. 4
      storage/innobase/include/fut0lst.ic
  42. 2
      storage/innobase/include/ibuf0ibuf.ic
  43. 6
      storage/innobase/include/log0log.h
  44. 2
      storage/innobase/include/log0recv.h
  45. 4
      storage/innobase/include/mem0mem.h
  46. 2
      storage/innobase/include/mem0mem.ic
  47. 2
      storage/innobase/include/mtr0log.ic
  48. 12
      storage/innobase/include/page0page.h
  49. 14
      storage/innobase/include/page0page.ic
  50. 2
      storage/innobase/include/page0zip.ic
  51. 38
      storage/innobase/include/rem0rec.ic
  52. 4
      storage/innobase/include/row0merge.h
  53. 2
      storage/innobase/include/srv0srv.h
  54. 4
      storage/innobase/include/trx0rec.ic
  55. 2
      storage/innobase/include/trx0rseg.h
  56. 18
      storage/innobase/include/trx0sys.h
  57. 2
      storage/innobase/include/trx0undo.h
  58. 2
      storage/innobase/include/trx0undo.ic
  59. 12
      storage/innobase/include/univ.i
  60. 30
      storage/innobase/log/log0log.cc
  61. 24
      storage/innobase/log/log0recv.cc
  62. 8
      storage/innobase/mem/mem0mem.cc
  63. 8
      storage/innobase/mtr/mtr0log.cc
  64. 26
      storage/innobase/os/os0file.cc
  65. 28
      storage/innobase/page/page0cur.cc
  66. 58
      storage/innobase/page/page0page.cc
  67. 82
      storage/innobase/page/page0zip.cc
  68. 6
      storage/innobase/rem/rem0rec.cc
  69. 26
      storage/innobase/row/row0import.cc
  70. 10
      storage/innobase/row/row0log.cc
  71. 4
      storage/innobase/row/row0merge.cc
  72. 3
      storage/innobase/row/row0mysql.cc
  73. 2
      storage/innobase/row/row0purge.cc
  74. 2
      storage/innobase/row/row0quiesce.cc
  75. 13
      storage/innobase/row/row0sel.cc
  76. 26
      storage/innobase/row/row0trunc.cc
  77. 2
      storage/innobase/srv/srv0mon.cc
  78. 6
      storage/innobase/srv/srv0srv.cc
  79. 6
      storage/innobase/srv/srv0start.cc
  80. 18
      storage/innobase/trx/trx0purge.cc
  81. 12
      storage/innobase/trx/trx0rec.cc
  82. 2
      storage/innobase/trx/trx0rseg.cc
  83. 6
      storage/innobase/trx/trx0sys.cc
  84. 4
      storage/innobase/trx/trx0undo.cc

6
extra/mariabackup/fil_cur.cc

@ -218,9 +218,9 @@ xb_fil_cur_open(
/* Allocate read buffer */ /* Allocate read buffer */
cursor->buf_size = XB_FIL_CUR_PAGES * page_size.physical(); cursor->buf_size = XB_FIL_CUR_PAGES * page_size.physical();
cursor->orig_buf = static_cast<byte *> cursor->orig_buf = static_cast<byte *>
(malloc(cursor->buf_size + UNIV_PAGE_SIZE));
(malloc(cursor->buf_size + srv_page_size));
cursor->buf = static_cast<byte *> cursor->buf = static_cast<byte *>
(ut_align(cursor->orig_buf, UNIV_PAGE_SIZE));
(ut_align(cursor->orig_buf, srv_page_size));
cursor->buf_read = 0; cursor->buf_read = 0;
cursor->buf_npages = 0; cursor->buf_npages = 0;
@ -258,7 +258,7 @@ xb_fil_cur_read(
ib_int64_t offset; ib_int64_t offset;
ib_int64_t to_read; ib_int64_t to_read;
const ulint page_size = cursor->page_size.physical(); const ulint page_size = cursor->page_size.physical();
xb_ad(!cursor->is_system() || page_size == UNIV_PAGE_SIZE);
xb_ad(!cursor->is_system() || page_size == srv_page_size);
cursor->read_filter->get_next_batch(&cursor->read_filter_ctxt, cursor->read_filter->get_next_batch(&cursor->read_filter_ctxt,
&offset, &to_read); &offset, &to_read);

25
extra/mariabackup/xtrabackup.cc

@ -3061,12 +3061,13 @@ static dberr_t xb_assign_undo_space_start()
return DB_ERROR; return DB_ERROR;
} }
buf = static_cast<byte*>(ut_malloc_nokey(2 * UNIV_PAGE_SIZE));
page = static_cast<byte*>(ut_align(buf, UNIV_PAGE_SIZE));
buf = static_cast<byte*>(ut_malloc_nokey(2 * srv_page_size));
page = static_cast<byte*>(ut_align(buf, srv_page_size));
retry: retry:
if (!os_file_read(IORequestRead, file, page, TRX_SYS_PAGE_NO * UNIV_PAGE_SIZE,
UNIV_PAGE_SIZE)) {
if (!os_file_read(IORequestRead, file, page,
TRX_SYS_PAGE_NO * srv_page_size,
srv_page_size)) {
msg("mariabackup: Reading TRX_SYS page failed.\n"); msg("mariabackup: Reading TRX_SYS page failed.\n");
error = DB_ERROR; error = DB_ERROR;
goto func_exit; goto func_exit;
@ -3591,8 +3592,8 @@ xb_normalize_init_values(void)
/*==========================*/ /*==========================*/
{ {
srv_sys_space.normalize(); srv_sys_space.normalize();
srv_log_buffer_size /= UNIV_PAGE_SIZE;
srv_lock_table_size = 5 * (srv_buf_pool_size / UNIV_PAGE_SIZE);
srv_log_buffer_size /= srv_page_size;
srv_lock_table_size = 5 * (srv_buf_pool_size / srv_page_size);
} }
/*********************************************************************** /***********************************************************************
@ -4248,7 +4249,7 @@ xb_space_create_file(
} }
ret = os_file_set_size(path, *file, ret = os_file_set_size(path, *file,
FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE);
FIL_IBD_FILE_INITIAL_SIZE * srv_page_size);
if (!ret) { if (!ret) {
msg("mariabackup: cannot set size for file %s\n", path); msg("mariabackup: cannot set size for file %s\n", path);
os_file_close(*file); os_file_close(*file);
@ -4256,11 +4257,11 @@ xb_space_create_file(
return ret; return ret;
} }
buf = static_cast<byte *>(malloc(3 * UNIV_PAGE_SIZE));
buf = static_cast<byte *>(malloc(3 * srv_page_size));
/* Align the memory for file i/o if we might have O_DIRECT set */ /* Align the memory for file i/o if we might have O_DIRECT set */
page = static_cast<byte *>(ut_align(buf, UNIV_PAGE_SIZE));
page = static_cast<byte *>(ut_align(buf, srv_page_size));
memset(page, '\0', UNIV_PAGE_SIZE);
memset(page, '\0', srv_page_size);
fsp_header_init_fields(page, space_id, flags); fsp_header_init_fields(page, space_id, flags);
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space_id); mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space_id);
@ -4271,12 +4272,12 @@ xb_space_create_file(
buf_flush_init_for_writing(NULL, page, NULL, 0); buf_flush_init_for_writing(NULL, page, NULL, 0);
ret = os_file_write(IORequestWrite, path, *file, page, 0, ret = os_file_write(IORequestWrite, path, *file, page, 0,
UNIV_PAGE_SIZE);
srv_page_size);
} else { } else {
page_zip_des_t page_zip; page_zip_des_t page_zip;
ulint zip_size = page_size.physical(); ulint zip_size = page_size.physical();
page_zip_set_size(&page_zip, zip_size); page_zip_set_size(&page_zip, zip_size);
page_zip.data = page + UNIV_PAGE_SIZE;
page_zip.data = page + srv_page_size;
fprintf(stderr, "zip_size = " ULINTPF "\n", zip_size); fprintf(stderr, "zip_size = " ULINTPF "\n", zip_size);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG

16
storage/innobase/btr/btr0btr.cc

@ -207,7 +207,7 @@ btr_root_fseg_validate(
ut_a(mach_read_from_4(seg_header + FSEG_HDR_SPACE) == space); ut_a(mach_read_from_4(seg_header + FSEG_HDR_SPACE) == space);
ut_a(offset >= FIL_PAGE_DATA); ut_a(offset >= FIL_PAGE_DATA);
ut_a(offset <= UNIV_PAGE_SIZE - FIL_PAGE_DATA_END);
ut_a(offset <= srv_page_size - FIL_PAGE_DATA_END);
return(TRUE); return(TRUE);
} }
#endif /* UNIV_BTR_DEBUG */ #endif /* UNIV_BTR_DEBUG */
@ -336,7 +336,7 @@ btr_root_fseg_adjust_on_import(
ulint offset = mach_read_from_2(seg_header + FSEG_HDR_OFFSET); ulint offset = mach_read_from_2(seg_header + FSEG_HDR_OFFSET);
if (offset < FIL_PAGE_DATA if (offset < FIL_PAGE_DATA
|| offset > UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) {
|| offset > srv_page_size - FIL_PAGE_DATA_END) {
return(FALSE); return(FALSE);
@ -755,7 +755,7 @@ btr_page_free_low(
// TODO(jonaso): scrub only what is actually needed // TODO(jonaso): scrub only what is actually needed
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
memset(page + PAGE_HEADER, 0, memset(page + PAGE_HEADER, 0,
UNIV_PAGE_SIZE - PAGE_HEADER);
srv_page_size - PAGE_HEADER);
#ifdef UNIV_DEBUG_SCRUBBING #ifdef UNIV_DEBUG_SCRUBBING
fprintf(stderr, fprintf(stderr,
"btr_page_free_low: scrub blob page %lu/%lu\n", "btr_page_free_low: scrub blob page %lu/%lu\n",
@ -1684,18 +1684,18 @@ btr_page_reorganize_low(
ut_a(!memcmp(PAGE_HEADER + PAGE_N_RECS + page, ut_a(!memcmp(PAGE_HEADER + PAGE_N_RECS + page,
PAGE_HEADER + PAGE_N_RECS + temp_page, PAGE_HEADER + PAGE_N_RECS + temp_page,
PAGE_DATA - (PAGE_HEADER + PAGE_N_RECS))); PAGE_DATA - (PAGE_HEADER + PAGE_N_RECS)));
ut_a(!memcmp(UNIV_PAGE_SIZE - FIL_PAGE_DATA_END + page,
UNIV_PAGE_SIZE - FIL_PAGE_DATA_END + temp_page,
ut_a(!memcmp(srv_page_size - FIL_PAGE_DATA_END + page,
srv_page_size - FIL_PAGE_DATA_END + temp_page,
FIL_PAGE_DATA_END)); FIL_PAGE_DATA_END));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
memcpy(PAGE_HEADER + page, PAGE_HEADER + temp_page, memcpy(PAGE_HEADER + page, PAGE_HEADER + temp_page,
PAGE_N_RECS - PAGE_N_DIR_SLOTS); PAGE_N_RECS - PAGE_N_DIR_SLOTS);
memcpy(PAGE_DATA + page, PAGE_DATA + temp_page, memcpy(PAGE_DATA + page, PAGE_DATA + temp_page,
UNIV_PAGE_SIZE - PAGE_DATA - FIL_PAGE_DATA_END);
srv_page_size - PAGE_DATA - FIL_PAGE_DATA_END);
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
ut_a(!memcmp(page, temp_page, UNIV_PAGE_SIZE));
ut_a(!memcmp(page, temp_page, srv_page_size));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */ #endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
goto func_exit; goto func_exit;
@ -4173,7 +4173,7 @@ retry:
write the bits accurately in a separate write the bits accurately in a separate
mini-transaction. */ mini-transaction. */
ibuf_update_free_bits_if_full(merge_block, ibuf_update_free_bits_if_full(merge_block,
UNIV_PAGE_SIZE,
srv_page_size,
ULINT_UNDEFINED); ULINT_UNDEFINED);
} }
} }

10
storage/innobase/btr/btr0bulk.cc

@ -140,16 +140,16 @@ PageBulk::init()
m_reserved_space = dict_index_get_space_reserve(); m_reserved_space = dict_index_get_space_reserve();
} else { } else {
m_reserved_space = m_reserved_space =
UNIV_PAGE_SIZE * (100 - innobase_fill_factor) / 100;
srv_page_size * (100 - innobase_fill_factor) / 100;
} }
m_padding_space = m_padding_space =
UNIV_PAGE_SIZE - dict_index_zip_pad_optimal_page_size(m_index);
srv_page_size - dict_index_zip_pad_optimal_page_size(m_index);
m_heap_top = page_header_get_ptr(new_page, PAGE_HEAP_TOP); m_heap_top = page_header_get_ptr(new_page, PAGE_HEAP_TOP);
m_rec_no = page_header_get_field(new_page, PAGE_N_RECS); m_rec_no = page_header_get_field(new_page, PAGE_N_RECS);
ut_d(m_total_data = 0); ut_d(m_total_data = 0);
page_header_set_field(m_page, NULL, PAGE_HEAP_TOP, UNIV_PAGE_SIZE - 1);
page_header_set_field(m_page, NULL, PAGE_HEAP_TOP, srv_page_size - 1);
return(DB_SUCCESS); return(DB_SUCCESS);
} }
@ -212,7 +212,7 @@ PageBulk::insert(
- page_dir_calc_reserved_space(m_rec_no); - page_dir_calc_reserved_space(m_rec_no);
ut_ad(m_free_space >= rec_size + slot_size); ut_ad(m_free_space >= rec_size + slot_size);
ut_ad(m_heap_top + rec_size < m_page + UNIV_PAGE_SIZE);
ut_ad(m_heap_top + rec_size < m_page + srv_page_size);
m_free_space -= rec_size + slot_size; m_free_space -= rec_size + slot_size;
m_heap_top += rec_size; m_heap_top += rec_size;
@ -234,7 +234,7 @@ PageBulk::finish()
/* To pass the debug tests we have to set these dummy values /* To pass the debug tests we have to set these dummy values
in the debug version */ in the debug version */
page_dir_set_n_slots(m_page, NULL, UNIV_PAGE_SIZE / 2);
page_dir_set_n_slots(m_page, NULL, srv_page_size / 2);
#endif #endif
ulint count = 0; ulint count = 0;

18
storage/innobase/btr/btr0cur.cc

@ -118,7 +118,7 @@ uint btr_cur_limit_optimistic_insert_debug;
/** In the optimistic insert, if the insert does not fit, but this much space /** In the optimistic insert, if the insert does not fit, but this much space
can be released by page reorganize, then it is reorganized */ can be released by page reorganize, then it is reorganized */
#define BTR_CUR_PAGE_REORGANIZE_LIMIT (UNIV_PAGE_SIZE / 32)
#define BTR_CUR_PAGE_REORGANIZE_LIMIT (srv_page_size / 32)
/** The structure of a BLOB part header */ /** The structure of a BLOB part header */
/* @{ */ /* @{ */
@ -959,7 +959,7 @@ btr_cur_search_to_nth_level_func(
page_cur_mode_t search_mode = PAGE_CUR_UNSUPP; page_cur_mode_t search_mode = PAGE_CUR_UNSUPP;
ulint buf_mode; ulint buf_mode;
ulint estimate; ulint estimate;
ulint node_ptr_max_size = UNIV_PAGE_SIZE / 2;
ulint node_ptr_max_size = srv_page_size / 2;
page_cur_t* page_cursor; page_cur_t* page_cursor;
btr_op_t btr_op; btr_op_t btr_op;
ulint root_height = 0; /* remove warning */ ulint root_height = 0; /* remove warning */
@ -2244,7 +2244,7 @@ btr_cur_open_at_index_side_func(
mtr_t* mtr) /*!< in/out: mini-transaction */ mtr_t* mtr) /*!< in/out: mini-transaction */
{ {
page_cur_t* page_cursor; page_cur_t* page_cursor;
ulint node_ptr_max_size = UNIV_PAGE_SIZE / 2;
ulint node_ptr_max_size = srv_page_size / 2;
ulint height; ulint height;
ulint root_height = 0; /* remove warning */ ulint root_height = 0; /* remove warning */
rec_t* node_ptr; rec_t* node_ptr;
@ -2615,7 +2615,7 @@ btr_cur_open_at_rnd_pos_func(
mtr_t* mtr) /*!< in: mtr */ mtr_t* mtr) /*!< in: mtr */
{ {
page_cur_t* page_cursor; page_cur_t* page_cursor;
ulint node_ptr_max_size = UNIV_PAGE_SIZE / 2;
ulint node_ptr_max_size = srv_page_size / 2;
ulint height; ulint height;
rec_t* node_ptr; rec_t* node_ptr;
ulint savepoint; ulint savepoint;
@ -3709,7 +3709,7 @@ btr_cur_parse_update_in_place(
rec_offset = mach_read_from_2(ptr); rec_offset = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
ut_a(rec_offset <= UNIV_PAGE_SIZE);
ut_a(rec_offset <= srv_page_size);
heap = mem_heap_create(256); heap = mem_heap_create(256);
@ -4937,7 +4937,7 @@ btr_cur_parse_del_mark_set_clust_rec(
offset = mach_read_from_2(ptr); offset = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
ut_a(offset <= UNIV_PAGE_SIZE);
ut_a(offset <= srv_page_size);
/* In delete-marked records, DB_TRX_ID must /* In delete-marked records, DB_TRX_ID must
always refer to an existing undo log record. */ always refer to an existing undo log record. */
@ -5131,7 +5131,7 @@ btr_cur_parse_del_mark_set_sec_rec(
offset = mach_read_from_2(ptr); offset = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
ut_a(offset <= UNIV_PAGE_SIZE);
ut_a(offset <= srv_page_size);
if (page) { if (page) {
rec = page + offset; rec = page + offset;
@ -6710,11 +6710,11 @@ btr_rec_get_externally_stored_len(
+ BTR_EXTERN_LEN + 4); + BTR_EXTERN_LEN + 4);
total_extern_len += ut_calc_align(extern_len, total_extern_len += ut_calc_align(extern_len,
UNIV_PAGE_SIZE);
srv_page_size);
} }
} }
return(total_extern_len / UNIV_PAGE_SIZE);
return(total_extern_len / srv_page_size);
} }
/*******************************************************************//** /*******************************************************************//**

4
storage/innobase/btr/btr0defragment.cc

@ -456,7 +456,7 @@ btr_defragment_merge_pages(
// Estimate how many records can be moved from the from_page to // Estimate how many records can be moved from the from_page to
// the to_page. // the to_page.
if (page_size.is_compressed()) { if (page_size.is_compressed()) {
ulint page_diff = UNIV_PAGE_SIZE - *max_data_size;
ulint page_diff = srv_page_size - *max_data_size;
max_ins_size_to_use = (max_ins_size_to_use > page_diff) max_ins_size_to_use = (max_ins_size_to_use > page_diff)
? max_ins_size_to_use - page_diff : 0; ? max_ins_size_to_use - page_diff : 0;
} }
@ -529,7 +529,7 @@ btr_defragment_merge_pages(
} else { } else {
ibuf_update_free_bits_if_full( ibuf_update_free_bits_if_full(
to_block, to_block,
UNIV_PAGE_SIZE,
srv_page_size,
ULINT_UNDEFINED); ULINT_UNDEFINED);
} }
} }

2
storage/innobase/btr/btr0scrub.cc

@ -668,7 +668,7 @@ btr_scrub_free_page(
* it will be found by scrubbing thread again * it will be found by scrubbing thread again
*/ */
memset(buf_block_get_frame(block) + PAGE_HEADER, 0, memset(buf_block_get_frame(block) + PAGE_HEADER, 0,
UNIV_PAGE_SIZE - PAGE_HEADER);
srv_page_size - PAGE_HEADER);
mach_write_to_2(buf_block_get_frame(block) + FIL_PAGE_TYPE, mach_write_to_2(buf_block_get_frame(block) + FIL_PAGE_TYPE,
FIL_PAGE_TYPE_ALLOCATED); FIL_PAGE_TYPE_ALLOCATED);

14
storage/innobase/buf/buf0buddy.cc

@ -160,7 +160,7 @@ buf_buddy_get(
ut_ad(size >= BUF_BUDDY_LOW); ut_ad(size >= BUF_BUDDY_LOW);
ut_ad(BUF_BUDDY_LOW <= UNIV_ZIP_SIZE_MIN); ut_ad(BUF_BUDDY_LOW <= UNIV_ZIP_SIZE_MIN);
ut_ad(size < BUF_BUDDY_HIGH); ut_ad(size < BUF_BUDDY_HIGH);
ut_ad(BUF_BUDDY_HIGH == UNIV_PAGE_SIZE);
ut_ad(BUF_BUDDY_HIGH == srv_page_size);
ut_ad(!ut_align_offset(page, size)); ut_ad(!ut_align_offset(page, size));
if (((ulint) page) & size) { if (((ulint) page) & size) {
@ -376,7 +376,7 @@ buf_buddy_alloc_zip(
} }
/**********************************************************************//** /**********************************************************************//**
Deallocate a buffer frame of UNIV_PAGE_SIZE. */
Deallocate a buffer frame of srv_page_size. */
static static
void void
buf_buddy_block_free( buf_buddy_block_free(
@ -390,7 +390,7 @@ buf_buddy_block_free(
ut_ad(buf_pool_mutex_own(buf_pool)); ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(!mutex_own(&buf_pool->zip_mutex)); ut_ad(!mutex_own(&buf_pool->zip_mutex));
ut_a(!ut_align_offset(buf, UNIV_PAGE_SIZE));
ut_a(!ut_align_offset(buf, srv_page_size));
HASH_SEARCH(hash, buf_pool->zip_hash, fold, buf_page_t*, bpage, HASH_SEARCH(hash, buf_pool->zip_hash, fold, buf_page_t*, bpage,
ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_MEMORY ut_ad(buf_page_get_state(bpage) == BUF_BLOCK_MEMORY
@ -403,8 +403,8 @@ buf_buddy_block_free(
ut_d(bpage->in_zip_hash = FALSE); ut_d(bpage->in_zip_hash = FALSE);
HASH_DELETE(buf_page_t, hash, buf_pool->zip_hash, fold, bpage); HASH_DELETE(buf_page_t, hash, buf_pool->zip_hash, fold, bpage);
ut_d(memset(buf, 0, UNIV_PAGE_SIZE));
UNIV_MEM_INVALID(buf, UNIV_PAGE_SIZE);
ut_d(memset(buf, 0, srv_page_size));
UNIV_MEM_INVALID(buf, srv_page_size);
block = (buf_block_t*) bpage; block = (buf_block_t*) bpage;
buf_page_mutex_enter(block); buf_page_mutex_enter(block);
@ -432,7 +432,7 @@ buf_buddy_block_register(
buf_block_set_state(block, BUF_BLOCK_MEMORY); buf_block_set_state(block, BUF_BLOCK_MEMORY);
ut_a(block->frame); ut_a(block->frame);
ut_a(!ut_align_offset(block->frame, UNIV_PAGE_SIZE));
ut_a(!ut_align_offset(block->frame, srv_page_size));
ut_ad(!block->page.in_page_hash); ut_ad(!block->page.in_page_hash);
ut_ad(!block->page.in_zip_hash); ut_ad(!block->page.in_zip_hash);
@ -765,7 +765,7 @@ func_exit:
@param[in] buf_pool buffer pool instance @param[in] buf_pool buffer pool instance
@param[in] buf block to be reallocated, must be pointed @param[in] buf block to be reallocated, must be pointed
to by the buffer pool to by the buffer pool
@param[in] size block size, up to UNIV_PAGE_SIZE
@param[in] size block size, up to srv_page_size
@retval false if failed because of no free blocks. */ @retval false if failed because of no free blocks. */
bool bool
buf_buddy_realloc( buf_buddy_realloc(

62
storage/innobase/buf/buf0buf.cc

@ -288,8 +288,8 @@ reachable via buf_pool->chunks[].
The chains of free memory blocks (buf_pool->zip_free[]) are used by The chains of free memory blocks (buf_pool->zip_free[]) are used by
the buddy allocator (buf0buddy.cc) to keep track of currently unused the buddy allocator (buf0buddy.cc) to keep track of currently unused
memory blocks of size sizeof(buf_page_t)..UNIV_PAGE_SIZE / 2. These
blocks are inside the UNIV_PAGE_SIZE-sized memory blocks of type
memory blocks of size sizeof(buf_page_t)..srv_page_size / 2. These
blocks are inside the srv_page_size-sized memory blocks of type
BUF_BLOCK_MEMORY that the buddy allocator requests from the buffer BUF_BLOCK_MEMORY that the buddy allocator requests from the buffer
pool. The buddy allocator is solely used for allocating control pool. The buddy allocator is solely used for allocating control
blocks for compressed pages (buf_page_t) and compressed page frames. blocks for compressed pages (buf_page_t) and compressed page frames.
@ -542,7 +542,7 @@ buf_get_total_list_size_in_bytes(
for statistics purpose */ for statistics purpose */
buf_pools_list_size->LRU_bytes += buf_pool->stat.LRU_bytes; buf_pools_list_size->LRU_bytes += buf_pool->stat.LRU_bytes;
buf_pools_list_size->unzip_LRU_bytes += buf_pools_list_size->unzip_LRU_bytes +=
UT_LIST_GET_LEN(buf_pool->unzip_LRU) * UNIV_PAGE_SIZE;
UT_LIST_GET_LEN(buf_pool->unzip_LRU) * srv_page_size;
buf_pools_list_size->flush_list_bytes += buf_pools_list_size->flush_list_bytes +=
buf_pool->stat.flush_list_bytes; buf_pool->stat.flush_list_bytes;
} }
@ -854,7 +854,7 @@ buf_page_is_corrupted(
ib::info() << "Log sequence number at the start " ib::info() << "Log sequence number at the start "
<< mach_read_from_4(read_buf + FIL_PAGE_LSN + 4) << mach_read_from_4(read_buf + FIL_PAGE_LSN + 4)
<< " and the end " << " and the end "
<< mach_read_from_4(read_buf + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)
<< mach_read_from_4(read_buf + srv_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)
<< " do not match"; << " do not match";
#endif /* UNIV_INNOCHECKSUM */ #endif /* UNIV_INNOCHECKSUM */
return(true); return(true);
@ -1461,7 +1461,7 @@ buf_block_init(
buf_block_t* block, /*!< in: pointer to control block */ buf_block_t* block, /*!< in: pointer to control block */
byte* frame) /*!< in: pointer to buffer frame */ byte* frame) /*!< in: pointer to buffer frame */
{ {
UNIV_MEM_DESC(frame, UNIV_PAGE_SIZE);
UNIV_MEM_DESC(frame, srv_page_size);
/* This function should only be executed at database startup or by /* This function should only be executed at database startup or by
buf_pool_resize(). Either way, adaptive hash index must not exist. */ buf_pool_resize(). Either way, adaptive hash index must not exist. */
@ -1544,10 +1544,12 @@ buf_chunk_init(
/* Round down to a multiple of page size, /* Round down to a multiple of page size,
although it already should be. */ although it already should be. */
mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE);
mem_size = ut_2pow_round(mem_size, srv_page_size);
/* Reserve space for the block descriptors. */ /* Reserve space for the block descriptors. */
mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block)
+ (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
mem_size += ut_2pow_round((mem_size >> srv_page_size_shift)
* (sizeof *block)
+ (srv_page_size - 1),
ulint(srv_page_size));
DBUG_EXECUTE_IF("ib_buf_chunk_init_fails", return(NULL);); DBUG_EXECUTE_IF("ib_buf_chunk_init_fails", return(NULL););
@ -1581,12 +1583,12 @@ buf_chunk_init(
chunk->blocks = (buf_block_t*) chunk->mem; chunk->blocks = (buf_block_t*) chunk->mem;
/* Align a pointer to the first frame. Note that when /* Align a pointer to the first frame. Note that when
os_large_page_size is smaller than UNIV_PAGE_SIZE,
os_large_page_size is smaller than srv_page_size,
we may allocate one fewer block than requested. When we may allocate one fewer block than requested. When
it is bigger, we may allocate more blocks than requested. */ it is bigger, we may allocate more blocks than requested. */
frame = (byte*) ut_align(chunk->mem, UNIV_PAGE_SIZE);
chunk->size = chunk->mem_pfx.m_size / UNIV_PAGE_SIZE
frame = (byte*) ut_align(chunk->mem, srv_page_size);
chunk->size = chunk->mem_pfx.m_size / srv_page_size
- (frame != chunk->mem); - (frame != chunk->mem);
/* Subtract the space needed for block descriptors. */ /* Subtract the space needed for block descriptors. */
@ -1594,7 +1596,7 @@ buf_chunk_init(
ulint size = chunk->size; ulint size = chunk->size;
while (frame < (byte*) (chunk->blocks + size)) { while (frame < (byte*) (chunk->blocks + size)) {
frame += UNIV_PAGE_SIZE;
frame += srv_page_size;
size--; size--;
} }
@ -1610,7 +1612,7 @@ buf_chunk_init(
for (i = chunk->size; i--; ) { for (i = chunk->size; i--; ) {
buf_block_init(buf_pool, block, frame); buf_block_init(buf_pool, block, frame);
UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
UNIV_MEM_INVALID(block->frame, srv_page_size);
/* Add the block to the free list */ /* Add the block to the free list */
UT_LIST_ADD_LAST(buf_pool->free, &block->page); UT_LIST_ADD_LAST(buf_pool->free, &block->page);
@ -1619,7 +1621,7 @@ buf_chunk_init(
ut_ad(buf_pool_from_block(block) == buf_pool); ut_ad(buf_pool_from_block(block) == buf_pool);
block++; block++;
frame += UNIV_PAGE_SIZE;
frame += srv_page_size;
} }
buf_pool_register_chunk(chunk); buf_pool_register_chunk(chunk);
@ -1863,7 +1865,7 @@ buf_pool_init_instance(
ut_min(BUF_READ_AHEAD_PAGES, ut_min(BUF_READ_AHEAD_PAGES,
ut_2_power_up(buf_pool->curr_size / ut_2_power_up(buf_pool->curr_size /
BUF_READ_AHEAD_PORTION)); BUF_READ_AHEAD_PORTION));
buf_pool->curr_pool_size = buf_pool->curr_size * UNIV_PAGE_SIZE;
buf_pool->curr_pool_size = buf_pool->curr_size * srv_page_size;
buf_pool->old_size = buf_pool->curr_size; buf_pool->old_size = buf_pool->curr_size;
buf_pool->n_chunks_new = buf_pool->n_chunks; buf_pool->n_chunks_new = buf_pool->n_chunks;
@ -2127,7 +2129,7 @@ buf_page_realloc(
if (buf_page_can_relocate(&block->page)) { if (buf_page_can_relocate(&block->page)) {
mutex_enter(&new_block->mutex); mutex_enter(&new_block->mutex);
memcpy(new_block->frame, block->frame, UNIV_PAGE_SIZE);
memcpy(new_block->frame, block->frame, srv_page_size);
memcpy(&new_block->page, &block->page, sizeof block->page); memcpy(&new_block->page, &block->page, sizeof block->page);
/* relocate LRU list */ /* relocate LRU list */
@ -2191,7 +2193,7 @@ buf_page_realloc(
buf_block_modify_clock_inc(block); buf_block_modify_clock_inc(block);
memset(block->frame + FIL_PAGE_OFFSET, 0xff, 4); memset(block->frame + FIL_PAGE_OFFSET, 0xff, 4);
memset(block->frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xff, 4); memset(block->frame + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xff, 4);
UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
UNIV_MEM_INVALID(block->frame, srv_page_size);
buf_block_set_state(block, BUF_BLOCK_REMOVE_HASH); buf_block_set_state(block, BUF_BLOCK_REMOVE_HASH);
block->page.id.reset(); block->page.id.reset();
@ -2314,7 +2316,7 @@ buf_frame_will_withdrawn(
while (chunk < echunk) { while (chunk < echunk) {
if (ptr >= chunk->blocks->frame if (ptr >= chunk->blocks->frame
&& ptr < (chunk->blocks + chunk->size - 1)->frame && ptr < (chunk->blocks + chunk->size - 1)->frame
+ UNIV_PAGE_SIZE) {
+ srv_page_size) {
return(true); return(true);
} }
++chunk; ++chunk;
@ -2652,7 +2654,7 @@ buf_pool_resize()
ut_ad(srv_buf_pool_chunk_unit > 0); ut_ad(srv_buf_pool_chunk_unit > 0);
new_instance_size = srv_buf_pool_size / srv_buf_pool_instances; new_instance_size = srv_buf_pool_size / srv_buf_pool_instances;
new_instance_size /= UNIV_PAGE_SIZE;
new_instance_size /= srv_page_size;
buf_resize_status("Resizing buffer pool from " ULINTPF " to " buf_resize_status("Resizing buffer pool from " ULINTPF " to "
ULINTPF " (unit=" ULINTPF ").", ULINTPF " (unit=" ULINTPF ").",
@ -2671,7 +2673,7 @@ buf_pool_resize()
buf_pool->curr_size = new_instance_size; buf_pool->curr_size = new_instance_size;
buf_pool->n_chunks_new = new_instance_size * UNIV_PAGE_SIZE
buf_pool->n_chunks_new = new_instance_size * srv_page_size
/ srv_buf_pool_chunk_unit; / srv_buf_pool_chunk_unit;
buf_pool_mutex_exit(buf_pool); buf_pool_mutex_exit(buf_pool);
@ -3004,7 +3006,7 @@ calc_buf_pool_size:
ut_2_power_up(buf_pool->curr_size / ut_2_power_up(buf_pool->curr_size /
BUF_READ_AHEAD_PORTION)); BUF_READ_AHEAD_PORTION));
buf_pool->curr_pool_size buf_pool->curr_pool_size
= buf_pool->curr_size * UNIV_PAGE_SIZE;
= buf_pool->curr_size * srv_page_size;
curr_size += buf_pool->curr_pool_size; curr_size += buf_pool->curr_pool_size;
buf_pool->old_size = buf_pool->curr_size; buf_pool->old_size = buf_pool->curr_size;
} }
@ -3056,7 +3058,7 @@ calc_buf_pool_size:
buf_resize_status("Resizing also other hash tables."); buf_resize_status("Resizing also other hash tables.");
/* normalize lock_sys */ /* normalize lock_sys */
srv_lock_table_size = 5 * (srv_buf_pool_size / UNIV_PAGE_SIZE);
srv_lock_table_size = 5 * (srv_buf_pool_size / srv_page_size);
lock_sys.resize(srv_lock_table_size); lock_sys.resize(srv_lock_table_size);
/* normalize btr_search_sys */ /* normalize btr_search_sys */
@ -4046,14 +4048,14 @@ buf_block_from_ahi(const byte* ptr)
ulint offs = ulint(ptr - chunk->blocks->frame); ulint offs = ulint(ptr - chunk->blocks->frame);
offs >>= UNIV_PAGE_SIZE_SHIFT;
offs >>= srv_page_size_shift;
ut_a(offs < chunk->size); ut_a(offs < chunk->size);
buf_block_t* block = &chunk->blocks[offs]; buf_block_t* block = &chunk->blocks[offs];
/* The function buf_chunk_init() invokes buf_block_init() so that /* The function buf_chunk_init() invokes buf_block_init() so that
block[n].frame == block->frame + n * UNIV_PAGE_SIZE. Check it. */
block[n].frame == block->frame + n * srv_page_size. Check it. */
ut_ad(block->frame == page_align(ptr)); ut_ad(block->frame == page_align(ptr));
/* Read the state of the block without holding a mutex. /* Read the state of the block without holding a mutex.
A state transition from BUF_BLOCK_FILE_PAGE to A state transition from BUF_BLOCK_FILE_PAGE to
@ -5252,7 +5254,7 @@ buf_page_init(
/* Silence valid Valgrind warnings about uninitialized /* Silence valid Valgrind warnings about uninitialized
data being written to data files. There are some unused data being written to data files. There are some unused
bytes on some pages that InnoDB does not initialize. */ bytes on some pages that InnoDB does not initialize. */
UNIV_MEM_VALID(block->frame, UNIV_PAGE_SIZE);
UNIV_MEM_VALID(block->frame, srv_page_size);
} }
#endif /* UNIV_DEBUG_VALGRIND */ #endif /* UNIV_DEBUG_VALGRIND */
@ -7339,14 +7341,14 @@ buf_pool_reserve_tmp_slot(
/* Allocate temporary memory for encryption/decryption */ /* Allocate temporary memory for encryption/decryption */
if (free_slot->crypt_buf == NULL) { if (free_slot->crypt_buf == NULL) {
free_slot->crypt_buf = static_cast<byte*>(aligned_malloc(UNIV_PAGE_SIZE, UNIV_PAGE_SIZE));
memset(free_slot->crypt_buf, 0, UNIV_PAGE_SIZE);
free_slot->crypt_buf = static_cast<byte*>(aligned_malloc(srv_page_size, srv_page_size));
memset(free_slot->crypt_buf, 0, srv_page_size);
} }
/* For page compressed tables allocate temporary memory for /* For page compressed tables allocate temporary memory for
compression/decompression */ compression/decompression */
if (compressed && free_slot->comp_buf == NULL) { if (compressed && free_slot->comp_buf == NULL) {
ulint size = UNIV_PAGE_SIZE;
ulint size = srv_page_size;
/* Both snappy and lzo compression methods require that /* Both snappy and lzo compression methods require that
output buffer used for compression is bigger than input output buffer used for compression is bigger than input
@ -7357,7 +7359,7 @@ buf_pool_reserve_tmp_slot(
#if HAVE_LZO #if HAVE_LZO
size += LZO1X_1_15_MEM_COMPRESS; size += LZO1X_1_15_MEM_COMPRESS;
#endif #endif
free_slot->comp_buf = static_cast<byte*>(aligned_malloc(size, UNIV_PAGE_SIZE));
free_slot->comp_buf = static_cast<byte*>(aligned_malloc(size, srv_page_size));
memset(free_slot->comp_buf, 0, size); memset(free_slot->comp_buf, 0, size);
} }
@ -7379,7 +7381,7 @@ buf_page_encrypt_before_write(
byte* src_frame) byte* src_frame)
{ {
ut_ad(space->id == bpage->id.space()); ut_ad(space->id == bpage->id.space());
bpage->real_size = UNIV_PAGE_SIZE;
bpage->real_size = srv_page_size;
fil_page_type_validate(src_frame); fil_page_type_validate(src_frame);

6
storage/innobase/buf/buf0checksum.cc

@ -49,7 +49,7 @@ when it is written to a file and also checked for a match when reading from
the file. When reading we allow both normal CRC32 and CRC-legacy-big-endian the file. When reading we allow both normal CRC32 and CRC-legacy-big-endian
variants. Note that we must be careful to calculate the same value on 32-bit variants. Note that we must be careful to calculate the same value on 32-bit
and 64-bit architectures. and 64-bit architectures.
@param[in] page buffer page (UNIV_PAGE_SIZE bytes)
@param[in] page buffer page (srv_page_size bytes)
@param[in] use_legacy_big_endian if true then use big endian @param[in] use_legacy_big_endian if true then use big endian
byteorder when converting byte strings to integers byteorder when converting byte strings to integers
@return checksum */ @return checksum */
@ -76,7 +76,7 @@ buf_calc_page_crc32(
const uint32_t c2 = crc32_func( const uint32_t c2 = crc32_func(
page + FIL_PAGE_DATA, page + FIL_PAGE_DATA,
UNIV_PAGE_SIZE - FIL_PAGE_DATA - FIL_PAGE_END_LSN_OLD_CHKSUM);
srv_page_size - FIL_PAGE_DATA - FIL_PAGE_END_LSN_OLD_CHKSUM);
return(c1 ^ c2); return(c1 ^ c2);
} }
@ -103,7 +103,7 @@ buf_calc_page_new_checksum(const byte* page)
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
- FIL_PAGE_OFFSET) - FIL_PAGE_OFFSET)
+ ut_fold_binary(page + FIL_PAGE_DATA, + ut_fold_binary(page + FIL_PAGE_DATA,
UNIV_PAGE_SIZE - FIL_PAGE_DATA
srv_page_size - FIL_PAGE_DATA
- FIL_PAGE_END_LSN_OLD_CHKSUM); - FIL_PAGE_END_LSN_OLD_CHKSUM);
return(static_cast<uint32_t>(checksum)); return(static_cast<uint32_t>(checksum));
} }

62
storage/innobase/buf/buf0dblwr.cc

@ -149,11 +149,11 @@ buf_dblwr_init(
ut_zalloc_nokey(buf_size * sizeof(bool))); ut_zalloc_nokey(buf_size * sizeof(bool)));
buf_dblwr->write_buf_unaligned = static_cast<byte*>( buf_dblwr->write_buf_unaligned = static_cast<byte*>(
ut_malloc_nokey((1 + buf_size) * UNIV_PAGE_SIZE));
ut_malloc_nokey((1 + buf_size) * srv_page_size));
buf_dblwr->write_buf = static_cast<byte*>( buf_dblwr->write_buf = static_cast<byte*>(
ut_align(buf_dblwr->write_buf_unaligned, ut_align(buf_dblwr->write_buf_unaligned,
UNIV_PAGE_SIZE));
srv_page_size));
buf_dblwr->buf_block_arr = static_cast<buf_page_t**>( buf_dblwr->buf_block_arr = static_cast<buf_page_t**>(
ut_zalloc_nokey(buf_size * sizeof(void*))); ut_zalloc_nokey(buf_size * sizeof(void*)));
@ -214,7 +214,7 @@ too_small:
<< "Cannot create doublewrite buffer: " << "Cannot create doublewrite buffer: "
"the first file in innodb_data_file_path" "the first file in innodb_data_file_path"
" must be at least " " must be at least "
<< (3 * (FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) >> 20)
<< (3 * (FSP_EXTENT_SIZE * srv_page_size) >> 20)
<< "M."; << "M.";
mtr.commit(); mtr.commit();
return(false); return(false);
@ -363,10 +363,10 @@ buf_dblwr_init_or_load_pages(
/* We do the file i/o past the buffer pool */ /* We do the file i/o past the buffer pool */
unaligned_read_buf = static_cast<byte*>( unaligned_read_buf = static_cast<byte*>(
ut_malloc_nokey(3 * UNIV_PAGE_SIZE));
ut_malloc_nokey(3 * srv_page_size));
read_buf = static_cast<byte*>( read_buf = static_cast<byte*>(
ut_align(unaligned_read_buf, UNIV_PAGE_SIZE));
ut_align(unaligned_read_buf, srv_page_size));
/* Read the trx sys header to check if we are using the doublewrite /* Read the trx sys header to check if we are using the doublewrite
buffer */ buffer */
@ -376,8 +376,8 @@ buf_dblwr_init_or_load_pages(
err = os_file_read( err = os_file_read(
read_request, read_request,
file, read_buf, TRX_SYS_PAGE_NO * UNIV_PAGE_SIZE,
UNIV_PAGE_SIZE);
file, read_buf, TRX_SYS_PAGE_NO * srv_page_size,
srv_page_size);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
@ -425,8 +425,8 @@ buf_dblwr_init_or_load_pages(
/* Read the pages from the doublewrite buffer to memory */ /* Read the pages from the doublewrite buffer to memory */
err = os_file_read( err = os_file_read(
read_request, read_request,
file, buf, block1 * UNIV_PAGE_SIZE,
TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE);
file, buf, block1 * srv_page_size,
TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * srv_page_size);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
@ -442,9 +442,9 @@ buf_dblwr_init_or_load_pages(
err = os_file_read( err = os_file_read(
read_request, read_request,
file, file,
buf + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE,
block2 * UNIV_PAGE_SIZE,
TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE);
buf + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * srv_page_size,
block2 * srv_page_size,
TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * srv_page_size);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
@ -484,8 +484,8 @@ buf_dblwr_init_or_load_pages(
err = os_file_write( err = os_file_write(
write_request, path, file, page, write_request, path, file, page,
source_page_no * UNIV_PAGE_SIZE,
UNIV_PAGE_SIZE);
source_page_no * srv_page_size,
srv_page_size);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
ib::error() ib::error()
@ -503,7 +503,7 @@ buf_dblwr_init_or_load_pages(
recv_dblwr.add(page); recv_dblwr.add(page);
} }
page += univ_page_size.physical();
page += srv_page_size;
} }
if (reset_space_ids) { if (reset_space_ids) {
@ -529,10 +529,10 @@ buf_dblwr_process()
} }
unaligned_read_buf = static_cast<byte*>( unaligned_read_buf = static_cast<byte*>(
ut_malloc_nokey(2 * UNIV_PAGE_SIZE));
ut_malloc_nokey(2 * srv_page_size));
read_buf = static_cast<byte*>( read_buf = static_cast<byte*>(
ut_align(unaligned_read_buf, UNIV_PAGE_SIZE));
ut_align(unaligned_read_buf, srv_page_size));
for (recv_dblwr_t::list::iterator i = recv_dblwr.pages.begin(); for (recv_dblwr_t::list::iterator i = recv_dblwr.pages.begin();
i != recv_dblwr.pages.end(); i != recv_dblwr.pages.end();
@ -791,14 +791,14 @@ buf_dblwr_check_page_lsn(
} }
if (memcmp(page + (FIL_PAGE_LSN + 4), if (memcmp(page + (FIL_PAGE_LSN + 4),
page + (UNIV_PAGE_SIZE
page + (srv_page_size
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4), - FIL_PAGE_END_LSN_OLD_CHKSUM + 4),
4)) { 4)) {
const ulint lsn1 = mach_read_from_4( const ulint lsn1 = mach_read_from_4(
page + FIL_PAGE_LSN + 4); page + FIL_PAGE_LSN + 4);
const ulint lsn2 = mach_read_from_4( const ulint lsn2 = mach_read_from_4(
page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM
page + srv_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM
+ 4); + 4);
ib::error() << "The page to be written seems corrupt!" ib::error() << "The page to be written seems corrupt!"
@ -1001,7 +1001,7 @@ try_again:
for (ulint len2 = 0, i = 0; for (ulint len2 = 0, i = 0;
i < buf_dblwr->first_free; i < buf_dblwr->first_free;
len2 += UNIV_PAGE_SIZE, i++) {
len2 += srv_page_size, i++) {
const buf_block_t* block; const buf_block_t* block;
@ -1025,7 +1025,7 @@ try_again:
/* Write out the first block of the doublewrite buffer */ /* Write out the first block of the doublewrite buffer */
len = ut_min(TRX_SYS_DOUBLEWRITE_BLOCK_SIZE, len = ut_min(TRX_SYS_DOUBLEWRITE_BLOCK_SIZE,
buf_dblwr->first_free) * UNIV_PAGE_SIZE;
buf_dblwr->first_free) * srv_page_size;
fil_io(IORequestWrite, true, fil_io(IORequestWrite, true,
page_id_t(TRX_SYS_SPACE, buf_dblwr->block1), univ_page_size, page_id_t(TRX_SYS_SPACE, buf_dblwr->block1), univ_page_size,
@ -1038,10 +1038,10 @@ try_again:
/* Write out the second block of the doublewrite buffer. */ /* Write out the second block of the doublewrite buffer. */
len = (buf_dblwr->first_free - TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) len = (buf_dblwr->first_free - TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
* UNIV_PAGE_SIZE;
* srv_page_size;
write_buf = buf_dblwr->write_buf write_buf = buf_dblwr->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE;
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * srv_page_size;
fil_io(IORequestWrite, true, fil_io(IORequestWrite, true,
page_id_t(TRX_SYS_SPACE, buf_dblwr->block2), univ_page_size, page_id_t(TRX_SYS_SPACE, buf_dblwr->block2), univ_page_size,
@ -1123,7 +1123,7 @@ try_again:
} }
byte* p = buf_dblwr->write_buf byte* p = buf_dblwr->write_buf
+ univ_page_size.physical() * buf_dblwr->first_free;
+ srv_page_size * buf_dblwr->first_free;
/* We request frame here to get correct buffer in case of /* We request frame here to get correct buffer in case of
encryption and/or page compression */ encryption and/or page compression */
@ -1136,7 +1136,7 @@ try_again:
memcpy(p, frame, bpage->size.physical()); memcpy(p, frame, bpage->size.physical());
memset(p + bpage->size.physical(), 0x0, memset(p + bpage->size.physical(), 0x0,
univ_page_size.physical() - bpage->size.physical());
srv_page_size - bpage->size.physical());
} else { } else {
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE); ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
@ -1266,20 +1266,20 @@ retry:
void * frame = buf_page_get_frame(bpage); void * frame = buf_page_get_frame(bpage);
if (bpage->size.is_compressed()) { if (bpage->size.is_compressed()) {
memcpy(buf_dblwr->write_buf + univ_page_size.physical() * i,
memcpy(buf_dblwr->write_buf + srv_page_size * i,
frame, bpage->size.physical()); frame, bpage->size.physical());
memset(buf_dblwr->write_buf + univ_page_size.physical() * i
memset(buf_dblwr->write_buf + srv_page_size * i
+ bpage->size.physical(), 0x0, + bpage->size.physical(), 0x0,
univ_page_size.physical() - bpage->size.physical());
srv_page_size - bpage->size.physical());
fil_io(IORequestWrite, fil_io(IORequestWrite,
true, true,
page_id_t(TRX_SYS_SPACE, offset), page_id_t(TRX_SYS_SPACE, offset),
univ_page_size, univ_page_size,
0, 0,
univ_page_size.physical(),
(void *)(buf_dblwr->write_buf + univ_page_size.physical() * i),
srv_page_size,
(void *)(buf_dblwr->write_buf + srv_page_size * i),
NULL); NULL);
} else { } else {
/* It is a regular page. Write it directly to the /* It is a regular page. Write it directly to the
@ -1289,7 +1289,7 @@ retry:
page_id_t(TRX_SYS_SPACE, offset), page_id_t(TRX_SYS_SPACE, offset),
univ_page_size, univ_page_size,
0, 0,
univ_page_size.physical(),
srv_page_size,
(void*) frame, (void*) frame,
NULL); NULL);
} }

4
storage/innobase/buf/buf0flu.cc

@ -902,7 +902,7 @@ buf_flush_init_for_writing(
/* Write the newest modification lsn to the page header and trailer */ /* Write the newest modification lsn to the page header and trailer */
mach_write_to_8(page + FIL_PAGE_LSN, newest_lsn); mach_write_to_8(page + FIL_PAGE_LSN, newest_lsn);
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
mach_write_to_8(page + srv_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM,
newest_lsn); newest_lsn);
if (block && srv_page_size == 16384) { if (block && srv_page_size == 16384) {
@ -998,7 +998,7 @@ buf_flush_init_for_writing(
new enum is added and not handled here */ new enum is added and not handled here */
} }
mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
mach_write_to_4(page + srv_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM,
checksum); checksum);
} }

20
storage/innobase/buf/buf0lru.cc

@ -951,7 +951,7 @@ buf_LRU_get_free_only(
assert_block_ahi_empty(block); assert_block_ahi_empty(block);
buf_block_set_state(block, BUF_BLOCK_READY_FOR_USE); buf_block_set_state(block, BUF_BLOCK_READY_FOR_USE);
UNIV_MEM_ALLOC(block->frame, UNIV_PAGE_SIZE);
UNIV_MEM_ALLOC(block->frame, srv_page_size);
ut_ad(buf_pool_from_block(block) == buf_pool); ut_ad(buf_pool_from_block(block) == buf_pool);
@ -998,7 +998,7 @@ buf_LRU_check_size_of_non_data_objects(
" Check that your transactions do not set too many" " Check that your transactions do not set too many"
" row locks, or review if" " row locks, or review if"
" innodb_buffer_pool_size=" " innodb_buffer_pool_size="
<< (buf_pool->curr_size >> (20 - UNIV_PAGE_SIZE_SHIFT))
<< (buf_pool->curr_size >> (20 - srv_page_size_shift))
<< "M could be bigger."; << "M could be bigger.";
} else if (!recv_recovery_is_on() } else if (!recv_recovery_is_on()
&& buf_pool->curr_size == buf_pool->old_size && buf_pool->curr_size == buf_pool->old_size
@ -1021,7 +1021,7 @@ buf_LRU_check_size_of_non_data_objects(
" set too many row locks." " set too many row locks."
" innodb_buffer_pool_size=" " innodb_buffer_pool_size="
<< (buf_pool->curr_size >> << (buf_pool->curr_size >>
(20 - UNIV_PAGE_SIZE_SHIFT)) << "M."
(20 - srv_page_size_shift)) << "M."
" Starting the InnoDB Monitor to print" " Starting the InnoDB Monitor to print"
" diagnostics."; " diagnostics.";
@ -1758,10 +1758,10 @@ func_exit:
order to avoid bogus Valgrind warnings.*/ order to avoid bogus Valgrind warnings.*/
UNIV_MEM_VALID(((buf_block_t*) bpage)->frame, UNIV_MEM_VALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
btr_search_drop_page_hash_index((buf_block_t*) bpage); btr_search_drop_page_hash_index((buf_block_t*) bpage);
UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame, UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
if (b != NULL) { if (b != NULL) {
@ -1827,10 +1827,10 @@ buf_LRU_block_free_non_file_page(
buf_block_set_state(block, BUF_BLOCK_NOT_USED); buf_block_set_state(block, BUF_BLOCK_NOT_USED);
UNIV_MEM_ALLOC(block->frame, UNIV_PAGE_SIZE);
UNIV_MEM_ALLOC(block->frame, srv_page_size);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/* Wipe contents of page to reveal possible stale pointers to it */ /* Wipe contents of page to reveal possible stale pointers to it */
memset(block->frame, '\0', UNIV_PAGE_SIZE);
memset(block->frame, '\0', srv_page_size);
#else #else
/* Wipe page_no and space_id */ /* Wipe page_no and space_id */
memset(block->frame + FIL_PAGE_OFFSET, 0xfe, 4); memset(block->frame + FIL_PAGE_OFFSET, 0xfe, 4);
@ -1871,7 +1871,7 @@ buf_LRU_block_free_non_file_page(
ut_d(block->page.in_free_list = TRUE); ut_d(block->page.in_free_list = TRUE);
} }
UNIV_MEM_FREE(block->frame, UNIV_PAGE_SIZE);
UNIV_MEM_FREE(block->frame, srv_page_size);
} }
/******************************************************************//** /******************************************************************//**
@ -1920,7 +1920,7 @@ buf_LRU_block_remove_hashed(
case BUF_BLOCK_FILE_PAGE: case BUF_BLOCK_FILE_PAGE:
UNIV_MEM_ASSERT_W(bpage, sizeof(buf_block_t)); UNIV_MEM_ASSERT_W(bpage, sizeof(buf_block_t));
UNIV_MEM_ASSERT_W(((buf_block_t*) bpage)->frame, UNIV_MEM_ASSERT_W(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
buf_block_modify_clock_inc((buf_block_t*) bpage); buf_block_modify_clock_inc((buf_block_t*) bpage);
if (bpage->zip.data) { if (bpage->zip.data) {
const page_t* page = ((buf_block_t*) bpage)->frame; const page_t* page = ((buf_block_t*) bpage)->frame;
@ -2069,7 +2069,7 @@ buf_LRU_block_remove_hashed(
memset(((buf_block_t*) bpage)->frame memset(((buf_block_t*) bpage)->frame
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xff, 4); + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xff, 4);
UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame, UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
buf_page_set_state(bpage, BUF_BLOCK_REMOVE_HASH); buf_page_set_state(bpage, BUF_BLOCK_REMOVE_HASH);
/* Question: If we release bpage and hash mutex here /* Question: If we release bpage and hash mutex here

2
storage/innobase/buf/buf0rea.cc

@ -838,7 +838,7 @@ buf_read_ibuf_merge_pages(
in the arrays */ in the arrays */
{ {
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
ut_a(n_stored < UNIV_PAGE_SIZE);
ut_a(n_stored < srv_page_size);
#endif #endif
for (ulint i = 0; i < n_stored; i++) { for (ulint i = 0; i < n_stored; i++) {

18
storage/innobase/dict/dict0dict.cc

@ -2117,13 +2117,13 @@ dict_index_node_ptr_max_size(
/* This is universal index for change buffer. /* This is universal index for change buffer.
The max size of the entry is about max key length * 2. The max size of the entry is about max key length * 2.
(index key + primary key to be inserted to the index) (index key + primary key to be inserted to the index)
(The max key length is UNIV_PAGE_SIZE / 16 * 3 at
(The max key length is srv_page_size / 16 * 3 at
ha_innobase::max_supported_key_length(), ha_innobase::max_supported_key_length(),
considering MAX_KEY_LENGTH = 3072 at MySQL imposes considering MAX_KEY_LENGTH = 3072 at MySQL imposes
the 3500 historical InnoDB value for 16K page size case.) the 3500 historical InnoDB value for 16K page size case.)
For the universal index, node_ptr contains most of the entry. For the universal index, node_ptr contains most of the entry.
And 512 is enough to contain ibuf columns and meta-data */ And 512 is enough to contain ibuf columns and meta-data */
return(UNIV_PAGE_SIZE / 8 * 3 + 512);
return(srv_page_size / 8 * 3 + 512);
} }
comp = dict_table_is_comp(index->table); comp = dict_table_is_comp(index->table);
@ -2224,10 +2224,10 @@ dict_index_too_big_for_tree(
const page_size_t page_size(dict_tf_get_page_size(table->flags)); const page_size_t page_size(dict_tf_get_page_size(table->flags));
if (page_size.is_compressed() if (page_size.is_compressed()
&& page_size.physical() < univ_page_size.physical()) {
&& page_size.physical() < srv_page_size) {
/* On a compressed page, two records must fit in the /* On a compressed page, two records must fit in the
uncompressed page modification log. On compressed pages uncompressed page modification log. On compressed pages
with size.physical() == univ_page_size.physical(),
with size.physical() == srv_page_size,
this limit will never be reached. */ this limit will never be reached. */
ut_ad(comp); ut_ad(comp);
/* The maximum allowed record size is the size of /* The maximum allowed record size is the size of
@ -6980,7 +6980,7 @@ dict_index_zip_pad_update(
/* Only do increment if it won't increase padding /* Only do increment if it won't increase padding
beyond max pad size. */ beyond max pad size. */
if (info->pad + ZIP_PAD_INCR if (info->pad + ZIP_PAD_INCR
< (UNIV_PAGE_SIZE * zip_pad_max) / 100) {
< (srv_page_size * zip_pad_max) / 100) {
/* Use atomics even though we have the mutex. /* Use atomics even though we have the mutex.
This is to ensure that we are able to read This is to ensure that we are able to read
info->pad atomically. */ info->pad atomically. */
@ -7076,17 +7076,17 @@ dict_index_zip_pad_optimal_page_size(
if (!zip_failure_threshold_pct) { if (!zip_failure_threshold_pct) {
/* Disabled by user. */ /* Disabled by user. */
return(UNIV_PAGE_SIZE);
return(srv_page_size);
} }
pad = my_atomic_loadlint(&index->zip_pad.pad); pad = my_atomic_loadlint(&index->zip_pad.pad);
ut_ad(pad < UNIV_PAGE_SIZE);
sz = UNIV_PAGE_SIZE - pad;
ut_ad(pad < srv_page_size);
sz = srv_page_size - pad;
/* Min size allowed by user. */ /* Min size allowed by user. */
ut_ad(zip_pad_max < 100); ut_ad(zip_pad_max < 100);
min_sz = (UNIV_PAGE_SIZE * (100 - zip_pad_max)) / 100;
min_sz = (srv_page_size * (100 - zip_pad_max)) / 100;
return(ut_max(sz, min_sz)); return(ut_max(sz, min_sz));
} }

12
storage/innobase/fil/fil0crypt.cc

@ -665,7 +665,7 @@ fil_space_encrypt(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
if (tmp) { if (tmp) {
/* Verify that encrypted buffer is not corrupted */ /* Verify that encrypted buffer is not corrupted */
byte* tmp_mem = (byte *)malloc(UNIV_PAGE_SIZE);
byte* tmp_mem = (byte *)malloc(srv_page_size);
dberr_t err = DB_SUCCESS; dberr_t err = DB_SUCCESS;
byte* src = src_frame; byte* src = src_frame;
bool page_compressed_encrypted = (mach_read_from_2(tmp+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED); bool page_compressed_encrypted = (mach_read_from_2(tmp+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
@ -673,9 +673,9 @@ fil_space_encrypt(
byte* uncomp_mem = NULL; byte* uncomp_mem = NULL;
if (page_compressed_encrypted) { if (page_compressed_encrypted) {
comp_mem = (byte *)malloc(UNIV_PAGE_SIZE);
uncomp_mem = (byte *)malloc(UNIV_PAGE_SIZE);
memcpy(comp_mem, src_frame, UNIV_PAGE_SIZE);
comp_mem = (byte *)malloc(srv_page_size);
uncomp_mem = (byte *)malloc(srv_page_size);
memcpy(comp_mem, src_frame, srv_page_size);
fil_decompress_page(uncomp_mem, comp_mem, fil_decompress_page(uncomp_mem, comp_mem,
srv_page_size, NULL); srv_page_size, NULL);
src = uncomp_mem; src = uncomp_mem;
@ -686,7 +686,7 @@ fil_space_encrypt(
/* Need to decompress the page if it was also compressed */ /* Need to decompress the page if it was also compressed */
if (page_compressed_encrypted) { if (page_compressed_encrypted) {
memcpy(comp_mem, tmp_mem, UNIV_PAGE_SIZE);
memcpy(comp_mem, tmp_mem, srv_page_size);
fil_decompress_page(tmp_mem, comp_mem, fil_decompress_page(tmp_mem, comp_mem,
srv_page_size, NULL); srv_page_size, NULL);
} }
@ -2649,7 +2649,7 @@ fil_space_verify_crypt_checksum(
checksum2 = checksum1; checksum2 = checksum1;
} else { } else {
checksum2 = mach_read_from_4( checksum2 = mach_read_from_4(
page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM);
page + srv_page_size - FIL_PAGE_END_LSN_OLD_CHKSUM);
valid = buf_page_is_checksum_valid_crc32( valid = buf_page_is_checksum_valid_crc32(
page, checksum1, checksum2, false page, checksum1, checksum2, false
/* FIXME: also try the original crc32 that was /* FIXME: also try the original crc32 that was

40
storage/innobase/fil/fil0fil.cc

@ -1036,11 +1036,11 @@ fil_space_extend_must_retry(
const page_size_t pageSize(space->flags); const page_size_t pageSize(space->flags);
const ulint page_size = pageSize.physical(); const ulint page_size = pageSize.physical();
/* fil_read_first_page() expects UNIV_PAGE_SIZE bytes.
fil_node_open_file() expects at least 4 * UNIV_PAGE_SIZE bytes.*/
/* fil_read_first_page() expects srv_page_size bytes.
fil_node_open_file() expects at least 4 * srv_page_size bytes.*/
os_offset_t new_size = std::max( os_offset_t new_size = std::max(
os_offset_t(size - file_start_page_no) * page_size, os_offset_t(size - file_start_page_no) * page_size,
os_offset_t(FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE));
os_offset_t(FIL_IBD_FILE_INITIAL_SIZE * srv_page_size));
*success = os_file_set_size(node->name, node->handle, new_size, *success = os_file_set_size(node->name, node->handle, new_size,
FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags)); FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags));
@ -2043,18 +2043,18 @@ fil_write_flushed_lsn(
byte* buf; byte* buf;
dberr_t err = DB_TABLESPACE_NOT_FOUND; dberr_t err = DB_TABLESPACE_NOT_FOUND;
buf1 = static_cast<byte*>(ut_malloc_nokey(2 * UNIV_PAGE_SIZE));
buf = static_cast<byte*>(ut_align(buf1, UNIV_PAGE_SIZE));
buf1 = static_cast<byte*>(ut_malloc_nokey(2 * srv_page_size));
buf = static_cast<byte*>(ut_align(buf1, srv_page_size));
const page_id_t page_id(TRX_SYS_SPACE, 0); const page_id_t page_id(TRX_SYS_SPACE, 0);
err = fil_read(page_id, univ_page_size, 0, univ_page_size.physical(),
err = fil_read(page_id, univ_page_size, 0, srv_page_size,
buf); buf);
if (err == DB_SUCCESS) { if (err == DB_SUCCESS) {
mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, lsn); mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, lsn);
err = fil_write(page_id, univ_page_size, 0, err = fil_write(page_id, univ_page_size, 0,
univ_page_size.physical(), buf);
srv_page_size, buf);
fil_flush_file_spaces(FIL_TYPE_TABLESPACE); fil_flush_file_spaces(FIL_TYPE_TABLESPACE);
} }
@ -2805,7 +2805,7 @@ bool fil_truncate_tablespace(fil_space_t* space, ulint size_in_pages)
bool success = os_file_truncate(node->name, node->handle, 0); bool success = os_file_truncate(node->name, node->handle, 0);
if (success) { if (success) {
os_offset_t size = os_offset_t(size_in_pages) * UNIV_PAGE_SIZE;
os_offset_t size = os_offset_t(size_in_pages) * srv_page_size;
success = os_file_set_size( success = os_file_set_size(
node->name, node->handle, size, node->name, node->handle, size,
@ -3252,7 +3252,7 @@ fil_ibd_create(
if (!os_file_set_size( if (!os_file_set_size(
path, file, path, file,
os_offset_t(size) << UNIV_PAGE_SIZE_SHIFT, is_compressed)) {
os_offset_t(size) << srv_page_size_shift, is_compressed)) {
*err = DB_OUT_OF_FILE_SPACE; *err = DB_OUT_OF_FILE_SPACE;
err_exit: err_exit:
os_file_close(file); os_file_close(file);
@ -3273,11 +3273,11 @@ err_exit:
with zeros from the call of os_file_set_size(), until a buffer pool with zeros from the call of os_file_set_size(), until a buffer pool
flush would write to it. */ flush would write to it. */
buf2 = static_cast<byte*>(ut_malloc_nokey(3 * UNIV_PAGE_SIZE));
buf2 = static_cast<byte*>(ut_malloc_nokey(3 * srv_page_size));
/* Align the memory for file i/o if we might have O_DIRECT set */ /* Align the memory for file i/o if we might have O_DIRECT set */
page = static_cast<byte*>(ut_align(buf2, UNIV_PAGE_SIZE));
page = static_cast<byte*>(ut_align(buf2, srv_page_size));
memset(page, '\0', UNIV_PAGE_SIZE);
memset(page, '\0', srv_page_size);
flags |= FSP_FLAGS_PAGE_SSIZE(); flags |= FSP_FLAGS_PAGE_SSIZE();
fsp_header_init_fields(page, space_id, flags); fsp_header_init_fields(page, space_id, flags);
@ -3295,7 +3295,7 @@ err_exit:
} else { } else {
page_zip_des_t page_zip; page_zip_des_t page_zip;
page_zip_set_size(&page_zip, page_size.physical()); page_zip_set_size(&page_zip, page_size.physical());
page_zip.data = page + UNIV_PAGE_SIZE;
page_zip.data = page + srv_page_size;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
page_zip.m_start = page_zip.m_start =
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -4027,7 +4027,7 @@ fil_ibd_load(
/* Every .ibd file is created >= 4 pages in size. /* Every .ibd file is created >= 4 pages in size.
Smaller files cannot be OK. */ Smaller files cannot be OK. */
minimum_size = FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE;
minimum_size = FIL_IBD_FILE_INITIAL_SIZE * srv_page_size;
if (size == static_cast<os_offset_t>(-1)) { if (size == static_cast<os_offset_t>(-1)) {
/* The following call prints an error message */ /* The following call prints an error message */
@ -4379,9 +4379,9 @@ fil_io(
ut_ad(req_type.validate()); ut_ad(req_type.validate());
ut_ad(len > 0); ut_ad(len > 0);
ut_ad(byte_offset < UNIV_PAGE_SIZE);
ut_ad(byte_offset < srv_page_size);
ut_ad(!page_size.is_compressed() || byte_offset == 0); ut_ad(!page_size.is_compressed() || byte_offset == 0);
ut_ad(UNIV_PAGE_SIZE == (ulong)(1 << UNIV_PAGE_SIZE_SHIFT));
ut_ad(srv_page_size == ulong(1) << srv_page_size_shift);
#if (1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX #if (1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX
# error "(1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX" # error "(1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX"
#endif #endif
@ -4570,11 +4570,11 @@ fil_io(
if (!page_size.is_compressed()) { if (!page_size.is_compressed()) {
offset = ((os_offset_t) cur_page_no offset = ((os_offset_t) cur_page_no
<< UNIV_PAGE_SIZE_SHIFT) + byte_offset;
<< srv_page_size_shift) + byte_offset;
ut_a(node->size - cur_page_no ut_a(node->size - cur_page_no
>= ((byte_offset + len + (UNIV_PAGE_SIZE - 1))
/ UNIV_PAGE_SIZE));
>= ((byte_offset + len + (srv_page_size - 1))
/ srv_page_size));
} else { } else {
ulint size_shift; ulint size_shift;
@ -5308,7 +5308,7 @@ truncate_t::truncate(
: space->size; : space->size;
const bool success = os_file_truncate( const bool success = os_file_truncate(
path, node->handle, trunc_size * UNIV_PAGE_SIZE);
path, node->handle, trunc_size * srv_page_size);
if (!success) { if (!success) {
ib::error() << "Cannot truncate file " << path ib::error() << "Cannot truncate file " << path

40
storage/innobase/fil/fil0pagecompress.cc

@ -117,7 +117,7 @@ fil_compress_page(
if (!out_buf) { if (!out_buf) {
allocated = true; allocated = true;
ulint size = UNIV_PAGE_SIZE;
ulint size = srv_page_size;
/* Both snappy and lzo compression methods require that /* Both snappy and lzo compression methods require that
output buffer used for compression is bigger than input output buffer used for compression is bigger than input
@ -162,7 +162,7 @@ fil_compress_page(
<< (space ? space->id : 0) << " '" << (space ? space->id : 0) << " '"
<< (space ? space->name : "(import)") << "' len " << len); << (space ? space->name : "(import)") << "' len " << len);
write_size = UNIV_PAGE_SIZE - header_len;
write_size = srv_page_size - header_len;
switch(comp_method) { switch(comp_method) {
#ifdef HAVE_LZ4 #ifdef HAVE_LZ4
@ -185,11 +185,11 @@ fil_compress_page(
#ifdef HAVE_LZO #ifdef HAVE_LZO
case PAGE_LZO_ALGORITHM: case PAGE_LZO_ALGORITHM:
err = lzo1x_1_15_compress( err = lzo1x_1_15_compress(
buf, len, out_buf+header_len, &write_size_lzo, out_buf+UNIV_PAGE_SIZE);
buf, len, out_buf+header_len, &write_size_lzo, out_buf+srv_page_size);
write_size = write_size_lzo; write_size = write_size_lzo;
if (err != LZO_E_OK || write_size > UNIV_PAGE_SIZE-header_len) {
if (err != LZO_E_OK || write_size > srv_page_size-header_len) {
goto err_exit; goto err_exit;
} }
@ -209,7 +209,7 @@ fil_compress_page(
&out_pos, &out_pos,
(size_t)write_size); (size_t)write_size);
if (err != LZMA_OK || out_pos > UNIV_PAGE_SIZE-header_len) {
if (err != LZMA_OK || out_pos > srv_page_size-header_len) {
write_size = out_pos; write_size = out_pos;
goto err_exit; goto err_exit;
} }
@ -232,7 +232,7 @@ fil_compress_page(
0, 0,
0); 0);
if (err != BZ_OK || write_size > UNIV_PAGE_SIZE-header_len) {
if (err != BZ_OK || write_size > srv_page_size-header_len) {
goto err_exit; goto err_exit;
} }
break; break;
@ -243,7 +243,7 @@ fil_compress_page(
case PAGE_SNAPPY_ALGORITHM: case PAGE_SNAPPY_ALGORITHM:
{ {
snappy_status cstatus; snappy_status cstatus;
write_size = snappy_max_compressed_length(UNIV_PAGE_SIZE);
write_size = snappy_max_compressed_length(srv_page_size);
cstatus = snappy_compress( cstatus = snappy_compress(
(const char *)buf, (const char *)buf,
@ -251,7 +251,7 @@ fil_compress_page(
(char *)(out_buf+header_len), (char *)(out_buf+header_len),
(size_t*)&write_size); (size_t*)&write_size);
if (cstatus != SNAPPY_OK || write_size > UNIV_PAGE_SIZE-header_len) {
if (cstatus != SNAPPY_OK || write_size > srv_page_size-header_len) {
err = (int)cstatus; err = (int)cstatus;
goto err_exit; goto err_exit;
} }
@ -310,9 +310,9 @@ fil_compress_page(
byte *comp_page; byte *comp_page;
byte *uncomp_page; byte *uncomp_page;
comp_page = static_cast<byte *>(ut_malloc_nokey(UNIV_PAGE_SIZE));
uncomp_page = static_cast<byte *>(ut_malloc_nokey(UNIV_PAGE_SIZE));
memcpy(comp_page, out_buf, UNIV_PAGE_SIZE);
comp_page = static_cast<byte *>(ut_malloc_nokey(srv_page_size));
uncomp_page = static_cast<byte *>(ut_malloc_nokey(srv_page_size));
memcpy(comp_page, out_buf, srv_page_size);
fil_decompress_page(uncomp_page, comp_page, ulong(len), NULL); fil_decompress_page(uncomp_page, comp_page, ulong(len), NULL);
@ -439,8 +439,8 @@ fil_decompress_page(
// If no buffer was given, we need to allocate temporal buffer // If no buffer was given, we need to allocate temporal buffer
if (page_buf == NULL) { if (page_buf == NULL) {
in_buf = static_cast<byte *>(ut_malloc_nokey(UNIV_PAGE_SIZE));
memset(in_buf, 0, UNIV_PAGE_SIZE);
in_buf = static_cast<byte *>(ut_malloc_nokey(srv_page_size));
memset(in_buf, 0, srv_page_size);
} else { } else {
in_buf = page_buf; in_buf = page_buf;
} }
@ -472,7 +472,7 @@ fil_decompress_page(
/* Get the actual size of compressed page */ /* Get the actual size of compressed page */
actual_size = mach_read_from_2(buf+FIL_PAGE_DATA); actual_size = mach_read_from_2(buf+FIL_PAGE_DATA);
/* Check if payload size is corrupted */ /* Check if payload size is corrupted */
if (actual_size == 0 || actual_size > UNIV_PAGE_SIZE) {
if (actual_size == 0 || actual_size > srv_page_size) {
ib::error() << "Corruption: We try to uncompress corrupted page" ib::error() << "Corruption: We try to uncompress corrupted page"
<< " actual size: " << actual_size << " actual size: " << actual_size
<< " compression method: " << " compression method: "
@ -527,7 +527,7 @@ fil_decompress_page(
olen = olen_lzo; olen = olen_lzo;
if (err != LZO_E_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
if (err != LZO_E_OK || (olen == 0 || olen > srv_page_size)) {
len = olen; len = olen;
goto err_exit; goto err_exit;
if (return_error) { if (return_error) {
@ -557,7 +557,7 @@ fil_decompress_page(
len); len);
if (ret != LZMA_OK || (dst_pos == 0 || dst_pos > UNIV_PAGE_SIZE)) {
if (ret != LZMA_OK || (dst_pos == 0 || dst_pos > srv_page_size)) {
len = dst_pos; len = dst_pos;
goto err_exit; goto err_exit;
if (return_error) { if (return_error) {
@ -570,7 +570,7 @@ fil_decompress_page(
#endif /* HAVE_LZMA */ #endif /* HAVE_LZMA */
#ifdef HAVE_BZIP2 #ifdef HAVE_BZIP2
case PAGE_BZIP2_ALGORITHM: { case PAGE_BZIP2_ALGORITHM: {
unsigned int dst_pos = UNIV_PAGE_SIZE;
unsigned int dst_pos = srv_page_size;
err = BZ2_bzBuffToBuffDecompress( err = BZ2_bzBuffToBuffDecompress(
(char *)in_buf, (char *)in_buf,
@ -580,7 +580,7 @@ fil_decompress_page(
1, 1,
0); 0);
if (err != BZ_OK || (dst_pos == 0 || dst_pos > UNIV_PAGE_SIZE)) {
if (err != BZ_OK || (dst_pos == 0 || dst_pos > srv_page_size)) {
len = dst_pos; len = dst_pos;
goto err_exit; goto err_exit;
if (return_error) { if (return_error) {
@ -594,7 +594,7 @@ fil_decompress_page(
case PAGE_SNAPPY_ALGORITHM: case PAGE_SNAPPY_ALGORITHM:
{ {
snappy_status cstatus; snappy_status cstatus;
ulint olen = UNIV_PAGE_SIZE;
ulint olen = srv_page_size;
cstatus = snappy_uncompress( cstatus = snappy_uncompress(
(const char *)(buf+header_len), (const char *)(buf+header_len),
@ -602,7 +602,7 @@ fil_decompress_page(
(char *)in_buf, (char *)in_buf,
(size_t*)&olen); (size_t*)&olen);
if (cstatus != SNAPPY_OK || (olen == 0 || olen > UNIV_PAGE_SIZE)) {
if (cstatus != SNAPPY_OK || (olen == 0 || olen > srv_page_size)) {
err = (int)cstatus; err = (int)cstatus;
len = olen; len = olen;
goto err_exit; goto err_exit;

22
storage/innobase/fsp/fsp0file.cc

@ -302,7 +302,7 @@ Datafile::read_first_page(bool read_only_mode)
/* Align the memory for a possible read from a raw device */ /* Align the memory for a possible read from a raw device */
m_first_page = static_cast<byte*>( m_first_page = static_cast<byte*>(
ut_align(m_first_page_buf, UNIV_PAGE_SIZE));
ut_align(m_first_page_buf, srv_page_size));
IORequest request; IORequest request;
dberr_t err = DB_ERROR; dberr_t err = DB_ERROR;
@ -529,7 +529,7 @@ err_exit:
/* Check if the whole page is blank. */ /* Check if the whole page is blank. */
if (!m_space_id && !m_flags) { if (!m_space_id && !m_flags) {
const byte* b = m_first_page; const byte* b = m_first_page;
ulint nonzero_bytes = UNIV_PAGE_SIZE;
ulint nonzero_bytes = srv_page_size;
while (*b == '\0' && --nonzero_bytes != 0) { while (*b == '\0' && --nonzero_bytes != 0) {
@ -550,13 +550,13 @@ err_exit:
const page_size_t page_size(m_flags); const page_size_t page_size(m_flags);
if (univ_page_size.logical() != page_size.logical()) {
/* Page size must be univ_page_size. */
if (srv_page_size != page_size.logical()) {
/* Logical size must be innodb_page_size. */
ib::error() ib::error()
<< "Data file '" << m_filepath << "' uses page size " << "Data file '" << m_filepath << "' uses page size "
<< page_size.logical() << ", but the innodb_page_size" << page_size.logical() << ", but the innodb_page_size"
" start-up parameter is " " start-up parameter is "
<< univ_page_size.logical();
<< srv_page_size;
free_first_page(); free_first_page();
return(DB_ERROR); return(DB_ERROR);
} }
@ -683,8 +683,8 @@ Datafile::find_space_id()
bool noncompressed_ok = false; bool noncompressed_ok = false;
/* For noncompressed pages, the page size must be /* For noncompressed pages, the page size must be
equal to univ_page_size.physical(). */
if (page_size == univ_page_size.physical()) {
equal to srv_page_size. */
if (page_size == srv_page_size) {
noncompressed_ok = !buf_page_is_corrupted( noncompressed_ok = !buf_page_is_corrupted(
false, page, univ_page_size, NULL); false, page, univ_page_size, NULL);
} }
@ -698,11 +698,11 @@ Datafile::find_space_id()
assume the page is compressed if univ_page_size. assume the page is compressed if univ_page_size.
logical() is equal to or less than 16k and the logical() is equal to or less than 16k and the
page_size we are checking is equal to or less than page_size we are checking is equal to or less than
univ_page_size.logical(). */
if (univ_page_size.logical() <= UNIV_PAGE_SIZE_DEF
&& page_size <= univ_page_size.logical()) {
srv_page_size. */
if (srv_page_size <= UNIV_PAGE_SIZE_DEF
&& page_size <= srv_page_size) {
const page_size_t compr_page_size( const page_size_t compr_page_size(
page_size, univ_page_size.logical(),
page_size, srv_page_size,
true); true);
compressed_ok = !buf_page_is_corrupted( compressed_ok = !buf_page_is_corrupted(

4
storage/innobase/fsp/fsp0fsp.cc

@ -587,7 +587,7 @@ fsp_init_file_page_low(
{ {
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
memset(page, 0, UNIV_PAGE_SIZE);
memset(page, 0, srv_page_size);
mach_write_to_4(page + FIL_PAGE_OFFSET, block->page.id.page_no()); mach_write_to_4(page + FIL_PAGE_OFFSET, block->page.id.page_no());
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID,
@ -1989,7 +1989,7 @@ fseg_create(
ut_ad(mtr); ut_ad(mtr);
ut_ad(byte_offset + FSEG_HEADER_SIZE ut_ad(byte_offset + FSEG_HEADER_SIZE
<= UNIV_PAGE_SIZE - FIL_PAGE_DATA_END);
<= srv_page_size - FIL_PAGE_DATA_END);
mtr_x_lock(&space->latch, mtr); mtr_x_lock(&space->latch, mtr);
const page_size_t page_size(space->flags); const page_size_t page_size(space->flags);

14
storage/innobase/fsp/fsp0sysspace.cc

@ -353,7 +353,7 @@ SysTablespace::check_size(
So we need to round the size downward to a megabyte.*/ So we need to round the size downward to a megabyte.*/
const ulint rounded_size_pages = static_cast<ulint>( const ulint rounded_size_pages = static_cast<ulint>(
size >> UNIV_PAGE_SIZE_SHIFT);
size >> srv_page_size_shift);
/* If last file */ /* If last file */
if (&file == &m_files.back() && m_auto_extend_last_file) { if (&file == &m_files.back() && m_auto_extend_last_file) {
@ -397,16 +397,16 @@ SysTablespace::set_size(
/* We created the data file and now write it full of zeros */ /* We created the data file and now write it full of zeros */
ib::info() << "Setting file '" << file.filepath() << "' size to " ib::info() << "Setting file '" << file.filepath() << "' size to "
<< (file.m_size >> (20 - UNIV_PAGE_SIZE_SHIFT)) << " MB."
<< (file.m_size >> (20 - srv_page_size_shift)) << " MB."
" Physically writing the file full; Please wait ..."; " Physically writing the file full; Please wait ...";
bool success = os_file_set_size( bool success = os_file_set_size(
file.m_filepath, file.m_handle, file.m_filepath, file.m_handle,
static_cast<os_offset_t>(file.m_size) << UNIV_PAGE_SIZE_SHIFT);
static_cast<os_offset_t>(file.m_size) << srv_page_size_shift);
if (success) { if (success) {
ib::info() << "File '" << file.filepath() << "' size is now " ib::info() << "File '" << file.filepath() << "' size is now "
<< (file.m_size >> (20 - UNIV_PAGE_SIZE_SHIFT))
<< (file.m_size >> (20 - srv_page_size_shift))
<< " MB."; << " MB.";
} else { } else {
ib::error() << "Could not set the file size of '" ib::error() << "Could not set the file size of '"
@ -766,7 +766,7 @@ SysTablespace::check_file_spec(
} }
if (!m_auto_extend_last_file if (!m_auto_extend_last_file
&& get_sum_of_sizes() < min_expected_size / UNIV_PAGE_SIZE) {
&& get_sum_of_sizes() < min_expected_size / srv_page_size) {
ib::error() << "Tablespace size must be at least " ib::error() << "Tablespace size must be at least "
<< min_expected_size / (1024 * 1024) << " MB"; << min_expected_size / (1024 * 1024) << " MB";
@ -949,10 +949,10 @@ SysTablespace::normalize()
for (files_t::iterator it = m_files.begin(); it != end; ++it) { for (files_t::iterator it = m_files.begin(); it != end; ++it) {
it->m_size *= (1024 * 1024) / UNIV_PAGE_SIZE;
it->m_size *= (1024 * 1024) / srv_page_size;
} }
m_last_file_size_max *= (1024 * 1024) / UNIV_PAGE_SIZE;
m_last_file_size_max *= (1024 * 1024) / srv_page_size;
} }

2
storage/innobase/gis/gis0rtree.cc

@ -1445,7 +1445,7 @@ rtr_page_copy_rec_list_end_no_locks(
btr_assert_not_corrupted(new_block, index); btr_assert_not_corrupted(new_block, index);
ut_a(page_is_comp(new_page) == page_rec_is_comp(rec)); ut_a(page_is_comp(new_page) == page_rec_is_comp(rec));
ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint)
ut_a(mach_read_from_2(new_page + srv_page_size - 10) == (ulint)
(page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM)); (page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));
cur_rec = page_rec_get_next( cur_rec = page_rec_get_next(

2
storage/innobase/gis/gis0sea.cc

@ -1454,7 +1454,7 @@ rtr_leaf_push_match_rec(
data_len = rec_offs_data_size(offsets) + rec_offs_extra_size(offsets); data_len = rec_offs_data_size(offsets) + rec_offs_extra_size(offsets);
match_rec->used += data_len; match_rec->used += data_len;
ut_ad(match_rec->used < UNIV_PAGE_SIZE);
ut_ad(match_rec->used < srv_page_size);
} }
/**************************************************************//** /**************************************************************//**

32
storage/innobase/handler/ha_innodb.cc

@ -3697,10 +3697,10 @@ innobase_init(
/* The buffer pool needs to be able to accommodate enough many /* The buffer pool needs to be able to accommodate enough many
pages, even for larger pages */ pages, even for larger pages */
if (UNIV_PAGE_SIZE > UNIV_PAGE_SIZE_DEF
if (srv_page_size > UNIV_PAGE_SIZE_DEF
&& innobase_buffer_pool_size < (24 * 1024 * 1024)) { && innobase_buffer_pool_size < (24 * 1024 * 1024)) {
ib::info() << "innodb_page_size=" ib::info() << "innodb_page_size="
<< UNIV_PAGE_SIZE << " requires "
<< srv_page_size << " requires "
<< "innodb_buffer_pool_size > 24M current " << "innodb_buffer_pool_size > 24M current "
<< innobase_buffer_pool_size; << innobase_buffer_pool_size;
goto error; goto error;
@ -5168,7 +5168,7 @@ ha_innobase::max_supported_key_length() const
Note: Handle 16k and 32k pages the same here since the limits Note: Handle 16k and 32k pages the same here since the limits
are higher than imposed by MySQL. */ are higher than imposed by MySQL. */
switch (UNIV_PAGE_SIZE) {
switch (srv_page_size) {
case 4096: case 4096:
return(768); return(768);
case 8192: case 8192:
@ -6269,7 +6269,7 @@ no_such_table:
} }
/* Index block size in InnoDB: used by MySQL in query optimization */ /* Index block size in InnoDB: used by MySQL in query optimization */
stats.block_size = UNIV_PAGE_SIZE;
stats.block_size = srv_page_size;
/* Init table lock structure */ /* Init table lock structure */
thr_lock_data_init(&m_share->lock, &lock, NULL); thr_lock_data_init(&m_share->lock, &lock, NULL);
@ -11411,7 +11411,7 @@ create_table_info_t::create_options_are_invalid()
case 8: case 8:
case 16: case 16:
/* The maximum KEY_BLOCK_SIZE (KBS) is /* The maximum KEY_BLOCK_SIZE (KBS) is
UNIV_PAGE_SIZE_MAX. But if UNIV_PAGE_SIZE is
UNIV_PAGE_SIZE_MAX. But if srv_page_size is
smaller than UNIV_PAGE_SIZE_MAX, the maximum smaller than UNIV_PAGE_SIZE_MAX, the maximum
KBS is also smaller. */ KBS is also smaller. */
kbs_max = ut_min( kbs_max = ut_min(
@ -11512,7 +11512,7 @@ create_table_info_t::create_options_are_invalid()
/* Don't support compressed table when page size > 16k. */ /* Don't support compressed table when page size > 16k. */
if ((has_key_block_size || row_format == ROW_TYPE_COMPRESSED) if ((has_key_block_size || row_format == ROW_TYPE_COMPRESSED)
&& UNIV_PAGE_SIZE > UNIV_PAGE_SIZE_DEF) {
&& srv_page_size > UNIV_PAGE_SIZE_DEF) {
push_warning(m_thd, Sql_condition::WARN_LEVEL_WARN, push_warning(m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION, ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: Cannot create a COMPRESSED table" "InnoDB: Cannot create a COMPRESSED table"
@ -11924,7 +11924,7 @@ index_bad:
if (row_type == ROW_TYPE_COMPRESSED && zip_allowed) { if (row_type == ROW_TYPE_COMPRESSED && zip_allowed) {
/* ROW_FORMAT=COMPRESSED without KEY_BLOCK_SIZE /* ROW_FORMAT=COMPRESSED without KEY_BLOCK_SIZE
implies half the maximum KEY_BLOCK_SIZE(*1k) or implies half the maximum KEY_BLOCK_SIZE(*1k) or
UNIV_PAGE_SIZE, whichever is less. */
srv_page_size, whichever is less. */
zip_ssize = zip_ssize_max - 1; zip_ssize = zip_ssize_max - 1;
} }
} }
@ -11975,7 +11975,7 @@ index_bad:
} }
/* Don't support compressed table when page size > 16k. */ /* Don't support compressed table when page size > 16k. */
if (zip_allowed && zip_ssize && UNIV_PAGE_SIZE > UNIV_PAGE_SIZE_DEF) {
if (zip_allowed && zip_ssize && srv_page_size > UNIV_PAGE_SIZE_DEF) {
push_warning(m_thd, Sql_condition::WARN_LEVEL_WARN, push_warning(m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION, ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: Cannot create a COMPRESSED table" "InnoDB: Cannot create a COMPRESSED table"
@ -13436,7 +13436,7 @@ ha_innobase::estimate_rows_upper_bound()
ut_a(stat_n_leaf_pages > 0); ut_a(stat_n_leaf_pages > 0);
local_data_file_length = local_data_file_length =
((ulonglong) stat_n_leaf_pages) * UNIV_PAGE_SIZE;
((ulonglong) stat_n_leaf_pages) * srv_page_size;
/* Calculate a minimum length for a clustered index record and from /* Calculate a minimum length for a clustered index record and from
that an upper bound for the number of rows. Since we only calculate that an upper bound for the number of rows. Since we only calculate
@ -18760,8 +18760,8 @@ innodb_log_write_ahead_size_update(
val = val * 2; val = val * 2;
} }
if (val > UNIV_PAGE_SIZE) {
val = UNIV_PAGE_SIZE;
if (val > srv_page_size) {
val = srv_page_size;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS,
"innodb_log_write_ahead_size cannot" "innodb_log_write_ahead_size cannot"
@ -18770,7 +18770,7 @@ innodb_log_write_ahead_size_update(
ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS,
"Setting innodb_log_write_ahead_size" "Setting innodb_log_write_ahead_size"
" to %lu", " to %lu",
UNIV_PAGE_SIZE);
srv_page_size);
} else if (val != in_val) { } else if (val != in_val) {
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS, ER_WRONG_ARGUMENTS,
@ -20684,13 +20684,13 @@ innodb_params_adjust()
= MYSQL_SYSVAR_NAME(undo_logs).def_val = MYSQL_SYSVAR_NAME(undo_logs).def_val
= srv_available_undo_logs; = srv_available_undo_logs;
MYSQL_SYSVAR_NAME(max_undo_log_size).max_val MYSQL_SYSVAR_NAME(max_undo_log_size).max_val
= 1ULL << (32 + UNIV_PAGE_SIZE_SHIFT);
= 1ULL << (32 + srv_page_size_shift);
MYSQL_SYSVAR_NAME(max_undo_log_size).min_val MYSQL_SYSVAR_NAME(max_undo_log_size).min_val
= MYSQL_SYSVAR_NAME(max_undo_log_size).def_val = MYSQL_SYSVAR_NAME(max_undo_log_size).def_val
= ulonglong(SRV_UNDO_TABLESPACE_SIZE_IN_PAGES) = ulonglong(SRV_UNDO_TABLESPACE_SIZE_IN_PAGES)
* srv_page_size; * srv_page_size;
MYSQL_SYSVAR_NAME(max_undo_log_size).max_val MYSQL_SYSVAR_NAME(max_undo_log_size).max_val
= 1ULL << (32 + UNIV_PAGE_SIZE_SHIFT);
= 1ULL << (32 + srv_page_size_shift);
} }
/**************************************************************************** /****************************************************************************
@ -20994,7 +20994,7 @@ innobase_get_computed_value(
if (!heap || index->table->vc_templ->rec_len if (!heap || index->table->vc_templ->rec_len
>= REC_VERSION_56_MAX_INDEX_COL_LEN) { >= REC_VERSION_56_MAX_INDEX_COL_LEN) {
if (*local_heap == NULL) { if (*local_heap == NULL) {
*local_heap = mem_heap_create(UNIV_PAGE_SIZE);
*local_heap = mem_heap_create(srv_page_size);
} }
buf = static_cast<byte*>(mem_heap_alloc( buf = static_cast<byte*>(mem_heap_alloc(
@ -21035,7 +21035,7 @@ innobase_get_computed_value(
if (row_field->ext) { if (row_field->ext) {
if (*local_heap == NULL) { if (*local_heap == NULL) {
*local_heap = mem_heap_create(UNIV_PAGE_SIZE);
*local_heap = mem_heap_create(srv_page_size);
} }
data = btr_copy_externally_stored_field( data = btr_copy_externally_stored_field(

20
storage/innobase/ibuf/ibuf0ibuf.cc

@ -442,7 +442,7 @@ ibuf_count_set(
ulint val) ulint val)
{ {
ibuf_count_check(page_id); ibuf_count_check(page_id);
ut_a(val < UNIV_PAGE_SIZE);
ut_a(val < srv_page_size);
ibuf_counts[page_id.space()][page_id.page_no()] = val; ibuf_counts[page_id.space()][page_id.page_no()] = val;
} }
@ -510,7 +510,7 @@ ibuf_init_at_db_start(void)
buffer pool size. Once ibuf struct is initialized this buffer pool size. Once ibuf struct is initialized this
value is updated with the user supplied size by calling value is updated with the user supplied size by calling
ibuf_max_size_update(). */ ibuf_max_size_update(). */
ibuf->max_size = ((buf_pool_get_curr_size() / UNIV_PAGE_SIZE)
ibuf->max_size = ((buf_pool_get_curr_size() / srv_page_size)
* CHANGE_BUFFER_DEFAULT_SIZE) / 100; * CHANGE_BUFFER_DEFAULT_SIZE) / 100;
mutex_create(LATCH_ID_IBUF, &ibuf_mutex); mutex_create(LATCH_ID_IBUF, &ibuf_mutex);
@ -584,7 +584,7 @@ ibuf_max_size_update(
ulint new_val) /*!< in: new value in terms of ulint new_val) /*!< in: new value in terms of
percentage of the buffer pool size */ percentage of the buffer pool size */
{ {
ulint new_size = ((buf_pool_get_curr_size() / UNIV_PAGE_SIZE)
ulint new_size = ((buf_pool_get_curr_size() / srv_page_size)
* new_val) / 100; * new_val) / 100;
mutex_enter(&ibuf_mutex); mutex_enter(&ibuf_mutex);
ibuf->max_size = new_size; ibuf->max_size = new_size;
@ -701,7 +701,7 @@ ibuf_bitmap_page_get_bits_low(
byte_offset = bit_offset / 8; byte_offset = bit_offset / 8;
bit_offset = bit_offset % 8; bit_offset = bit_offset % 8;
ut_ad(byte_offset + IBUF_BITMAP < UNIV_PAGE_SIZE);
ut_ad(byte_offset + IBUF_BITMAP < srv_page_size);
map_byte = mach_read_from_1(page + IBUF_BITMAP + byte_offset); map_byte = mach_read_from_1(page + IBUF_BITMAP + byte_offset);
@ -754,7 +754,7 @@ ibuf_bitmap_page_set_bits(
byte_offset = bit_offset / 8; byte_offset = bit_offset / 8;
bit_offset = bit_offset % 8; bit_offset = bit_offset % 8;
ut_ad(byte_offset + IBUF_BITMAP < UNIV_PAGE_SIZE);
ut_ad(byte_offset + IBUF_BITMAP < srv_page_size);
map_byte = mach_read_from_1(page + IBUF_BITMAP + byte_offset); map_byte = mach_read_from_1(page + IBUF_BITMAP + byte_offset);
@ -2381,7 +2381,7 @@ ibuf_get_merge_page_nos_func(
&& prev_space_id == first_space_id) && prev_space_id == first_space_id)
|| (volume_for_page || (volume_for_page
> ((IBUF_MERGE_THRESHOLD - 1) > ((IBUF_MERGE_THRESHOLD - 1)
* 4 * UNIV_PAGE_SIZE
* 4 * srv_page_size
/ IBUF_PAGE_SIZE_PER_FREE_SPACE) / IBUF_PAGE_SIZE_PER_FREE_SPACE)
/ IBUF_MERGE_THRESHOLD)) { / IBUF_MERGE_THRESHOLD)) {
@ -2965,7 +2965,7 @@ get_volume_comp:
Gets an upper limit for the combined size of entries buffered in the insert Gets an upper limit for the combined size of entries buffered in the insert
buffer for a given page. buffer for a given page.
@return upper limit for the volume of buffered inserts for the index @return upper limit for the volume of buffered inserts for the index
page, in bytes; UNIV_PAGE_SIZE, if the entries for the index page span
page, in bytes; srv_page_size, if the entries for the index page span
several pages in the insert buffer */ several pages in the insert buffer */
static static
ulint ulint
@ -3066,7 +3066,7 @@ ibuf_get_volume_buffered(
do not have the x-latch on it, and cannot acquire one do not have the x-latch on it, and cannot acquire one
because of the latching order: we have to give up */ because of the latching order: we have to give up */
return(UNIV_PAGE_SIZE);
return(srv_page_size);
} }
if (page_no != ibuf_rec_get_page_no(mtr, rec) if (page_no != ibuf_rec_get_page_no(mtr, rec)
@ -3136,7 +3136,7 @@ count_later:
/* We give up */ /* We give up */
return(UNIV_PAGE_SIZE);
return(srv_page_size);
} }
if (page_no != ibuf_rec_get_page_no(mtr, rec) if (page_no != ibuf_rec_get_page_no(mtr, rec)
@ -4653,7 +4653,7 @@ loop:
volume += page_dir_calc_reserved_space(1); volume += page_dir_calc_reserved_space(1);
ut_a(volume <= 4 * UNIV_PAGE_SIZE
ut_a(volume <= 4 * srv_page_size
/ IBUF_PAGE_SIZE_PER_FREE_SPACE); / IBUF_PAGE_SIZE_PER_FREE_SPACE);
#endif #endif
ibuf_insert_to_index_page( ibuf_insert_to_index_page(

2
storage/innobase/include/btr0btr.h

@ -45,7 +45,7 @@ Created 6/2/1994 Heikki Tuuri
/** Maximum record size which can be stored on a page, without using the /** Maximum record size which can be stored on a page, without using the
special big record storage structure */ special big record storage structure */
#define BTR_PAGE_MAX_REC_SIZE (UNIV_PAGE_SIZE / 2 - 200)
#define BTR_PAGE_MAX_REC_SIZE (srv_page_size / 2 - 200)
/** @brief Maximum depth of a B-tree in InnoDB. /** @brief Maximum depth of a B-tree in InnoDB.

2
storage/innobase/include/btr0cur.h

@ -834,7 +834,7 @@ btr_cur_latch_leaves(
/** In the pessimistic delete, if the page data size drops below this /** In the pessimistic delete, if the page data size drops below this
limit, merging it to a neighbor is tried */ limit, merging it to a neighbor is tried */
#define BTR_CUR_PAGE_COMPRESS_LIMIT(index) \ #define BTR_CUR_PAGE_COMPRESS_LIMIT(index) \
((UNIV_PAGE_SIZE * (ulint)((index)->merge_threshold)) / 100)
((srv_page_size * (ulint)((index)->merge_threshold)) / 100)
/** A slot in the path array. We store here info on a search path down the /** A slot in the path array. We store here info on a search path down the
tree. Each slot contains data on a single level of the tree. */ tree. Each slot contains data on a single level of the tree. */

6
storage/innobase/include/buf0buddy.h

@ -48,7 +48,7 @@ buf_buddy_alloc(
the page resides */ the page resides */
ulint size, /*!< in: compressed page size ulint size, /*!< in: compressed page size
(between UNIV_ZIP_SIZE_MIN and (between UNIV_ZIP_SIZE_MIN and
UNIV_PAGE_SIZE) */
srv_page_size) */
bool* lru) /*!< in: pointer to a variable bool* lru) /*!< in: pointer to a variable
that will be assigned true if that will be assigned true if
storage was allocated from the storage was allocated from the
@ -67,14 +67,14 @@ buf_buddy_free(
void* buf, /*!< in: block to be freed, must not void* buf, /*!< in: block to be freed, must not
be pointed to by the buffer pool */ be pointed to by the buffer pool */
ulint size) /*!< in: block size, ulint size) /*!< in: block size,
up to UNIV_PAGE_SIZE */
up to srv_page_size */
MY_ATTRIBUTE((nonnull)); MY_ATTRIBUTE((nonnull));
/** Reallocate a block. /** Reallocate a block.
@param[in] buf_pool buffer pool instance @param[in] buf_pool buffer pool instance
@param[in] buf block to be reallocated, must be pointed @param[in] buf block to be reallocated, must be pointed
to by the buffer pool to by the buffer pool
@param[in] size block size, up to UNIV_PAGE_SIZE
@param[in] size block size, up to srv_page_size
@retval false if failed because of no free blocks. */ @retval false if failed because of no free blocks. */
bool bool
buf_buddy_realloc( buf_buddy_realloc(

10
storage/innobase/include/buf0buddy.ic

@ -96,9 +96,9 @@ buf_buddy_alloc(
the page resides */ the page resides */
ulint size, /*!< in: compressed page size ulint size, /*!< in: compressed page size
(between UNIV_ZIP_SIZE_MIN and (between UNIV_ZIP_SIZE_MIN and
UNIV_PAGE_SIZE) */
srv_page_size) */
bool* lru) /*!< in: pointer to a variable bool* lru) /*!< in: pointer to a variable
that will be assigned TRUE if
that will be assigned true if
storage was allocated from the storage was allocated from the
LRU list and buf_pool->mutex was LRU list and buf_pool->mutex was
temporarily released */ temporarily released */
@ -106,7 +106,7 @@ buf_buddy_alloc(
ut_ad(buf_pool_mutex_own(buf_pool)); ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(ut_is_2pow(size)); ut_ad(ut_is_2pow(size));
ut_ad(size >= UNIV_ZIP_SIZE_MIN); ut_ad(size >= UNIV_ZIP_SIZE_MIN);
ut_ad(size <= UNIV_PAGE_SIZE);
ut_ad(size <= srv_page_size);
return((byte*) buf_buddy_alloc_low(buf_pool, buf_buddy_get_slot(size), return((byte*) buf_buddy_alloc_low(buf_pool, buf_buddy_get_slot(size),
lru)); lru));
@ -123,12 +123,12 @@ buf_buddy_free(
void* buf, /*!< in: block to be freed, must not void* buf, /*!< in: block to be freed, must not
be pointed to by the buffer pool */ be pointed to by the buffer pool */
ulint size) /*!< in: block size, ulint size) /*!< in: block size,
up to UNIV_PAGE_SIZE */
up to srv_page_size */
{ {
ut_ad(buf_pool_mutex_own(buf_pool)); ut_ad(buf_pool_mutex_own(buf_pool));
ut_ad(ut_is_2pow(size)); ut_ad(ut_is_2pow(size));
ut_ad(size >= UNIV_ZIP_SIZE_MIN); ut_ad(size >= UNIV_ZIP_SIZE_MIN);
ut_ad(size <= UNIV_PAGE_SIZE);
ut_ad(size <= srv_page_size);
buf_buddy_free_low(buf_pool, buf, buf_buddy_get_slot(size)); buf_buddy_free_low(buf_pool, buf, buf_buddy_get_slot(size));
} }

8
storage/innobase/include/buf0buf.h

@ -1577,7 +1577,7 @@ public:
bool encrypted; /*!< page is still encrypted */ bool encrypted; /*!< page is still encrypted */
ulint real_size; /*!< Real size of the page ulint real_size; /*!< Real size of the page
Normal pages == UNIV_PAGE_SIZE
Normal pages == srv_page_size
page compressed pages, payload page compressed pages, payload
size alligned to sector boundary. size alligned to sector boundary.
*/ */
@ -1712,9 +1712,9 @@ struct buf_block_t{
buf_pool->page_hash can point buf_pool->page_hash can point
to buf_page_t or buf_block_t */ to buf_page_t or buf_block_t */
byte* frame; /*!< pointer to buffer frame which byte* frame; /*!< pointer to buffer frame which
is of size UNIV_PAGE_SIZE, and
is of size srv_page_size, and
aligned to an address divisible by aligned to an address divisible by
UNIV_PAGE_SIZE */
srv_page_size */
BPageLock lock; /*!< read-write lock of the buffer BPageLock lock; /*!< read-write lock of the buffer
frame */ frame */
UT_LIST_NODE_T(buf_block_t) unzip_LRU; UT_LIST_NODE_T(buf_block_t) unzip_LRU;
@ -1874,7 +1874,7 @@ struct buf_block_t{
/**********************************************************************//** /**********************************************************************//**
Compute the hash fold value for blocks in buf_pool->zip_hash. */ Compute the hash fold value for blocks in buf_pool->zip_hash. */
/* @{ */ /* @{ */
#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / UNIV_PAGE_SIZE)
#define BUF_POOL_ZIP_FOLD_PTR(ptr) ((ulint) (ptr) / srv_page_size)
#define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame) #define BUF_POOL_ZIP_FOLD(b) BUF_POOL_ZIP_FOLD_PTR((b)->frame)
#define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b)) #define BUF_POOL_ZIP_FOLD_BPAGE(b) BUF_POOL_ZIP_FOLD((buf_block_t*) (b))
/* @} */ /* @} */

10
storage/innobase/include/buf0buf.ic

@ -115,7 +115,7 @@ ulint
buf_pool_get_n_pages(void) buf_pool_get_n_pages(void)
/*======================*/ /*======================*/
{ {
return(buf_pool_get_curr_size() / UNIV_PAGE_SIZE);
return(buf_pool_get_curr_size() / srv_page_size);
} }
/********************************************************************//** /********************************************************************//**
@ -761,7 +761,7 @@ buf_frame_align(
ut_ad(ptr); ut_ad(ptr);
frame = (buf_frame_t*) ut_align_down(ptr, UNIV_PAGE_SIZE);
frame = (buf_frame_t*) ut_align_down(ptr, srv_page_size);
return(frame); return(frame);
} }
@ -778,11 +778,11 @@ buf_ptr_get_fsp_addr(
fil_addr_t* addr) /*!< out: page offset and byte offset */ fil_addr_t* addr) /*!< out: page offset and byte offset */
{ {
const page_t* page = (const page_t*) ut_align_down(ptr, const page_t* page = (const page_t*) ut_align_down(ptr,
UNIV_PAGE_SIZE);
srv_page_size);
*space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); *space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
addr->page = mach_read_from_4(page + FIL_PAGE_OFFSET); addr->page = mach_read_from_4(page + FIL_PAGE_OFFSET);
addr->boffset = ut_align_offset(ptr, UNIV_PAGE_SIZE);
addr->boffset = ut_align_offset(ptr, srv_page_size);
} }
/**********************************************************************//** /**********************************************************************//**
@ -867,7 +867,7 @@ buf_frame_copy(
{ {
ut_ad(buf && frame); ut_ad(buf && frame);
ut_memcpy(buf, frame, UNIV_PAGE_SIZE);
ut_memcpy(buf, frame, srv_page_size);
return(buf); return(buf);
} }

2
storage/innobase/include/buf0checksum.h

@ -36,7 +36,7 @@ when it is written to a file and also checked for a match when reading from
the file. When reading we allow both normal CRC32 and CRC-legacy-big-endian the file. When reading we allow both normal CRC32 and CRC-legacy-big-endian
variants. Note that we must be careful to calculate the same value on 32-bit variants. Note that we must be careful to calculate the same value on 32-bit
and 64-bit architectures. and 64-bit architectures.
@param[in] page buffer page (UNIV_PAGE_SIZE bytes)
@param[in] page buffer page (srv_page_size bytes)
@param[in] use_legacy_big_endian if true then use big endian @param[in] use_legacy_big_endian if true then use big endian
byteorder when converting byte strings to integers byteorder when converting byte strings to integers
@return checksum */ @return checksum */

4
storage/innobase/include/buf0dblwr.h

@ -131,7 +131,7 @@ struct buf_dblwr_t{
doublewrite block (64 pages) */ doublewrite block (64 pages) */
ulint block2; /*!< page number of the second block */ ulint block2; /*!< page number of the second block */
ulint first_free;/*!< first free position in write_buf ulint first_free;/*!< first free position in write_buf
measured in units of UNIV_PAGE_SIZE */
measured in units of srv_page_size */
ulint b_reserved;/*!< number of slots currently reserved ulint b_reserved;/*!< number of slots currently reserved
for batch flush. */ for batch flush. */
os_event_t b_event;/*!< event where threads wait for a os_event_t b_event;/*!< event where threads wait for a
@ -150,7 +150,7 @@ struct buf_dblwr_t{
buffer. */ buffer. */
byte* write_buf;/*!< write buffer used in writing to the byte* write_buf;/*!< write buffer used in writing to the
doublewrite buffer, aligned to an doublewrite buffer, aligned to an
address divisible by UNIV_PAGE_SIZE
address divisible by srv_page_size
(which is required by Windows aio) */ (which is required by Windows aio) */
byte* write_buf_unaligned;/*!< pointer to write_buf, byte* write_buf_unaligned;/*!< pointer to write_buf,
but unaligned */ but unaligned */

4
storage/innobase/include/buf0types.h

@ -113,7 +113,7 @@ is_checksum_strict(ulint algo)
#define BUF_BUDDY_LOW (1U << BUF_BUDDY_LOW_SHIFT) #define BUF_BUDDY_LOW (1U << BUF_BUDDY_LOW_SHIFT)
/** Actual number of buddy sizes based on current page size */ /** Actual number of buddy sizes based on current page size */
#define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
#define BUF_BUDDY_SIZES (srv_page_size_shift - BUF_BUDDY_LOW_SHIFT)
/** Maximum number of buddy sizes based on the max page size */ /** Maximum number of buddy sizes based on the max page size */
#define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX \ #define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX \
@ -121,7 +121,7 @@ is_checksum_strict(ulint algo)
/** twice the maximum block size of the buddy system; /** twice the maximum block size of the buddy system;
the underlying memory is aligned by this amount: the underlying memory is aligned by this amount:
this must be equal to UNIV_PAGE_SIZE */
this must be equal to srv_page_size */
#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES) #define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
/* @} */ /* @} */

8
storage/innobase/include/dict0dict.ic

@ -595,8 +595,8 @@ dict_tf_is_valid_not_redundant(ulint flags)
for the uncompressed page format */ for the uncompressed page format */
return(false); return(false);
} else if (zip_ssize > PAGE_ZIP_SSIZE_MAX } else if (zip_ssize > PAGE_ZIP_SSIZE_MAX
|| zip_ssize > UNIV_PAGE_SIZE_SHIFT
|| UNIV_PAGE_SIZE_SHIFT > UNIV_ZIP_SIZE_SHIFT_MAX) {
|| zip_ssize > srv_page_size_shift
|| srv_page_size_shift > UNIV_ZIP_SIZE_SHIFT_MAX) {
/* KEY_BLOCK_SIZE is out of bounds, or /* KEY_BLOCK_SIZE is out of bounds, or
ROW_FORMAT=COMPRESSED is not supported with this ROW_FORMAT=COMPRESSED is not supported with this
innodb_page_size (only up to 16KiB) */ innodb_page_size (only up to 16KiB) */
@ -852,7 +852,7 @@ dict_tf_get_page_size(
ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX);
return(page_size_t(zip_size, univ_page_size.logical(), true));
return(page_size_t(zip_size, srv_page_size, true));
} }
/*********************************************************************//** /*********************************************************************//**
@ -1182,7 +1182,7 @@ ulint
dict_index_get_space_reserve(void) dict_index_get_space_reserve(void)
/*==============================*/ /*==============================*/
{ {
return(UNIV_PAGE_SIZE / 16);
return(srv_page_size / 16);
} }
/********************************************************************//** /********************************************************************//**

6
storage/innobase/include/fsp0fsp.h

@ -45,8 +45,8 @@ Created 12/18/1995 Heikki Tuuri
/** @return the PAGE_SSIZE flags for the current innodb_page_size */ /** @return the PAGE_SSIZE flags for the current innodb_page_size */
#define FSP_FLAGS_PAGE_SSIZE() \ #define FSP_FLAGS_PAGE_SSIZE() \
((UNIV_PAGE_SIZE == UNIV_PAGE_SIZE_ORIG) ? \
0 : (UNIV_PAGE_SIZE_SHIFT - UNIV_ZIP_SIZE_SHIFT_MIN + 1) \
((srv_page_size == UNIV_PAGE_SIZE_ORIG) ? \
0 : (srv_page_size_shift - UNIV_ZIP_SIZE_SHIFT_MIN + 1) \
<< FSP_FLAGS_POS_PAGE_SSIZE) << FSP_FLAGS_POS_PAGE_SSIZE)
/* @defgroup Compatibility macros for MariaDB 10.1.0 through 10.1.20; /* @defgroup Compatibility macros for MariaDB 10.1.0 through 10.1.20;
@ -318,7 +318,7 @@ UNIV_INLINE
ulint ulint
fsp_get_extent_size_in_pages(const page_size_t& page_size) fsp_get_extent_size_in_pages(const page_size_t& page_size)
{ {
return(FSP_EXTENT_SIZE * UNIV_PAGE_SIZE / page_size.physical());
return(FSP_EXTENT_SIZE * srv_page_size / page_size.physical());
} }
/**********************************************************************//** /**********************************************************************//**

4
storage/innobase/include/fsp0fsp.ic

@ -105,8 +105,8 @@ xdes_calc_descriptor_page(
# endif # endif
#endif /* !DOXYGEN */ #endif /* !DOXYGEN */
ut_ad(UNIV_PAGE_SIZE > XDES_ARR_OFFSET
+ (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE)
ut_ad(srv_page_size > XDES_ARR_OFFSET
+ (srv_page_size / FSP_EXTENT_SIZE)
* XDES_SIZE); * XDES_SIZE);
ut_ad(UNIV_ZIP_SIZE_MIN > XDES_ARR_OFFSET ut_ad(UNIV_ZIP_SIZE_MIN > XDES_ARR_OFFSET
+ (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE) + (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE)

2
storage/innobase/include/fsp0sysspace.h

@ -140,7 +140,7 @@ public:
ulint get_autoextend_increment() const ulint get_autoextend_increment() const
{ {
return(sys_tablespace_auto_extend_increment return(sys_tablespace_auto_extend_increment
* ((1024 * 1024) / UNIV_PAGE_SIZE));
* ((1024 * 1024) / srv_page_size));
} }
/** /**

14
storage/innobase/include/fsp0types.h

@ -59,11 +59,11 @@ page size | file space extent size
32 KiB | 64 pages = 2 MiB 32 KiB | 64 pages = 2 MiB
64 KiB | 64 pages = 4 MiB 64 KiB | 64 pages = 4 MiB
*/ */
#define FSP_EXTENT_SIZE ((UNIV_PAGE_SIZE <= (16384) ? \
(1048576 / UNIV_PAGE_SIZE) : \
((UNIV_PAGE_SIZE <= (32768)) ? \
(2097152 / UNIV_PAGE_SIZE) : \
(4194304 / UNIV_PAGE_SIZE))))
#define FSP_EXTENT_SIZE ((srv_page_size <= (16384) ? \
(1048576 / srv_page_size) : \
((srv_page_size <= (32768)) ? \
(2097152 / srv_page_size) : \
(4194304 / srv_page_size))))
/** File space extent size (four megabyte) in pages for MAX page size */ /** File space extent size (four megabyte) in pages for MAX page size */
#define FSP_EXTENT_SIZE_MAX (4194304 / UNIV_PAGE_SIZE_MAX) #define FSP_EXTENT_SIZE_MAX (4194304 / UNIV_PAGE_SIZE_MAX)
@ -151,8 +151,8 @@ enum fsp_reserve_t {
/* Number of pages described in a single descriptor page: currently each page /* Number of pages described in a single descriptor page: currently each page
description takes less than 1 byte; a descriptor page is repeated every description takes less than 1 byte; a descriptor page is repeated every
this many file pages */ this many file pages */
/* #define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE */
/* This has been replaced with either UNIV_PAGE_SIZE or page_zip->size. */
/* #define XDES_DESCRIBED_PER_PAGE srv_page_size */
/* This has been replaced with either srv_page_size or page_zip->size. */
/** @name The space low address page map /** @name The space low address page map
The pages at FSP_XDES_OFFSET and FSP_IBUF_BITMAP_OFFSET are repeated The pages at FSP_XDES_OFFSET and FSP_IBUF_BITMAP_OFFSET are repeated

2
storage/innobase/include/fut0fut.ic

@ -48,7 +48,7 @@ fut_get_ptr(
buf_block_t* block; buf_block_t* block;
byte* ptr = NULL; byte* ptr = NULL;
ut_ad(addr.boffset < UNIV_PAGE_SIZE);
ut_ad(addr.boffset < srv_page_size);
ut_ad((rw_latch == RW_S_LATCH) ut_ad((rw_latch == RW_S_LATCH)
|| (rw_latch == RW_X_LATCH) || (rw_latch == RW_X_LATCH)
|| (rw_latch == RW_SX_LATCH)); || (rw_latch == RW_SX_LATCH));

4
storage/innobase/include/fut0lst.ic

@ -58,7 +58,7 @@ flst_write_addr(
MTR_MEMO_PAGE_X_FIX MTR_MEMO_PAGE_X_FIX
| MTR_MEMO_PAGE_SX_FIX)); | MTR_MEMO_PAGE_SX_FIX));
ut_a(addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA); ut_a(addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA);
ut_a(ut_align_offset(faddr, UNIV_PAGE_SIZE) >= FIL_PAGE_DATA);
ut_a(ut_align_offset(faddr, srv_page_size) >= FIL_PAGE_DATA);
mlog_write_ulint(faddr + FIL_ADDR_PAGE, addr.page, MLOG_4BYTES, mtr); mlog_write_ulint(faddr + FIL_ADDR_PAGE, addr.page, MLOG_4BYTES, mtr);
mlog_write_ulint(faddr + FIL_ADDR_BYTE, addr.boffset, mlog_write_ulint(faddr + FIL_ADDR_BYTE, addr.boffset,
@ -83,7 +83,7 @@ flst_read_addr(
addr.boffset = mtr_read_ulint(faddr + FIL_ADDR_BYTE, MLOG_2BYTES, addr.boffset = mtr_read_ulint(faddr + FIL_ADDR_BYTE, MLOG_2BYTES,
mtr); mtr);
ut_a(addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA); ut_a(addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA);
ut_a(ut_align_offset(faddr, UNIV_PAGE_SIZE) >= FIL_PAGE_DATA);
ut_a(ut_align_offset(faddr, srv_page_size) >= FIL_PAGE_DATA);
return(addr); return(addr);
} }

2
storage/innobase/include/ibuf0ibuf.ic

@ -28,7 +28,7 @@ Created 7/19/1997 Heikki Tuuri
#include "fsp0types.h" #include "fsp0types.h"
#include "buf0lru.h" #include "buf0lru.h"
/** An index page must contain at least UNIV_PAGE_SIZE /
/** An index page must contain at least srv_page_size /
IBUF_PAGE_SIZE_PER_FREE_SPACE bytes of free space for ibuf to try to IBUF_PAGE_SIZE_PER_FREE_SPACE bytes of free space for ibuf to try to
buffer inserts to this page. If there is this much of free space, the buffer inserts to this page. If there is this much of free space, the
corresponding bits are set in the ibuf bitmap. */ corresponding bits are set in the ibuf bitmap. */

6
storage/innobase/include/log0log.h

@ -50,8 +50,8 @@ struct log_group_t;
/* Margin for the free space in the smallest log group, before a new query /* Margin for the free space in the smallest log group, before a new query
step which modifies the database, is started */ step which modifies the database, is started */
#define LOG_CHECKPOINT_FREE_PER_THREAD (4 * UNIV_PAGE_SIZE)
#define LOG_CHECKPOINT_EXTRA_FREE (8 * UNIV_PAGE_SIZE)
#define LOG_CHECKPOINT_FREE_PER_THREAD (4 * srv_page_size)
#define LOG_CHECKPOINT_EXTRA_FREE (8 * srv_page_size)
typedef ulint (*log_checksum_func_t)(const byte* log_block); typedef ulint (*log_checksum_func_t)(const byte* log_block);
@ -422,7 +422,7 @@ extern my_bool innodb_log_checksums;
/* The counting of lsn's starts from this value: this must be non-zero */ /* The counting of lsn's starts from this value: this must be non-zero */
#define LOG_START_LSN ((lsn_t) (16 * OS_FILE_LOG_BLOCK_SIZE)) #define LOG_START_LSN ((lsn_t) (16 * OS_FILE_LOG_BLOCK_SIZE))
#define LOG_BUFFER_SIZE (srv_log_buffer_size * UNIV_PAGE_SIZE)
#define LOG_BUFFER_SIZE (srv_log_buffer_size * srv_page_size)
/* Offsets of a log block header */ /* Offsets of a log block header */
#define LOG_BLOCK_HDR_NO 0 /* block number which must be > 0 and #define LOG_BLOCK_HDR_NO 0 /* block number which must be > 0 and

2
storage/innobase/include/log0recv.h

@ -346,7 +346,7 @@ times! */
/** Size of block reads when the log groups are scanned forward to do a /** Size of block reads when the log groups are scanned forward to do a
roll-forward */ roll-forward */
#define RECV_SCAN_SIZE (4 * UNIV_PAGE_SIZE)
#define RECV_SCAN_SIZE (4 * srv_page_size)
/** This many frames must be left free in the buffer pool when we scan /** This many frames must be left free in the buffer pool when we scan
the log and store the scanned log records in the buffer pool: we will the log and store the scanned log records in the buffer pool: we will

4
storage/innobase/include/mem0mem.h

@ -71,11 +71,11 @@ allocations of small buffers. */
#define MEM_BLOCK_START_SIZE 64 #define MEM_BLOCK_START_SIZE 64
#define MEM_BLOCK_STANDARD_SIZE \ #define MEM_BLOCK_STANDARD_SIZE \
(UNIV_PAGE_SIZE >= 16384 ? 8000 : MEM_MAX_ALLOC_IN_BUF)
(srv_page_size >= 16384 ? 8000 : MEM_MAX_ALLOC_IN_BUF)
/** If a memory heap is allowed to grow into the buffer pool, the following /** If a memory heap is allowed to grow into the buffer pool, the following
is the maximum size for a single allocated buffer: */ is the maximum size for a single allocated buffer: */
#define MEM_MAX_ALLOC_IN_BUF (UNIV_PAGE_SIZE - 200)
#define MEM_MAX_ALLOC_IN_BUF (srv_page_size - 200)
/** Space needed when allocating for a user a field of length N. /** Space needed when allocating for a user a field of length N.
The space is allocated only in multiples of UNIV_MEM_ALIGNMENT. */ The space is allocated only in multiples of UNIV_MEM_ALIGNMENT. */

2
storage/innobase/include/mem0mem.ic

@ -548,7 +548,7 @@ mem_heap_get_size(
size = heap->total_size; size = heap->total_size;
if (heap->free_block) { if (heap->free_block) {
size += UNIV_PAGE_SIZE;
size += srv_page_size;
} }
return(size); return(size);

2
storage/innobase/include/mtr0log.ic

@ -225,7 +225,7 @@ mlog_write_initial_log_record_fast(
ut_ad(log_ptr); ut_ad(log_ptr);
ut_d(mtr->memo_modify_page(ptr)); ut_d(mtr->memo_modify_page(ptr));
page = (const byte*) ut_align_down(ptr, UNIV_PAGE_SIZE);
page = (const byte*) ut_align_down(ptr, srv_page_size);
space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
offset = mach_read_from_4(page + FIL_PAGE_OFFSET); offset = mach_read_from_4(page + FIL_PAGE_OFFSET);

12
storage/innobase/include/page0page.h

@ -210,7 +210,7 @@ inline
page_t* page_t*
page_align(const void* ptr) page_align(const void* ptr)
{ {
return(static_cast<page_t*>(ut_align_down(ptr, UNIV_PAGE_SIZE)));
return(static_cast<page_t*>(ut_align_down(ptr, srv_page_size)));
} }
/** Gets the byte offset within a page frame. /** Gets the byte offset within a page frame.
@ -221,7 +221,7 @@ inline
ulint ulint
page_offset(const void* ptr) page_offset(const void* ptr)
{ {
return(ut_align_offset(ptr, UNIV_PAGE_SIZE));
return(ut_align_offset(ptr, srv_page_size));
} }
/** Determine whether an index page is not in ROW_FORMAT=REDUNDANT. /** Determine whether an index page is not in ROW_FORMAT=REDUNDANT.
@ -335,7 +335,7 @@ page_rec_is_user_rec_low(ulint offset)
compile_time_assert(PAGE_NEW_SUPREMUM < PAGE_OLD_SUPREMUM_END); compile_time_assert(PAGE_NEW_SUPREMUM < PAGE_OLD_SUPREMUM_END);
compile_time_assert(PAGE_OLD_SUPREMUM < PAGE_NEW_SUPREMUM_END); compile_time_assert(PAGE_OLD_SUPREMUM < PAGE_NEW_SUPREMUM_END);
ut_ad(offset >= PAGE_NEW_INFIMUM); ut_ad(offset >= PAGE_NEW_INFIMUM);
ut_ad(offset <= UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START);
ut_ad(offset <= srv_page_size - PAGE_EMPTY_DIR_START);
return(offset != PAGE_NEW_SUPREMUM return(offset != PAGE_NEW_SUPREMUM
&& offset != PAGE_NEW_INFIMUM && offset != PAGE_NEW_INFIMUM
@ -351,7 +351,7 @@ bool
page_rec_is_supremum_low(ulint offset) page_rec_is_supremum_low(ulint offset)
{ {
ut_ad(offset >= PAGE_NEW_INFIMUM); ut_ad(offset >= PAGE_NEW_INFIMUM);
ut_ad(offset <= UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START);
ut_ad(offset <= srv_page_size - PAGE_EMPTY_DIR_START);
return(offset == PAGE_NEW_SUPREMUM || offset == PAGE_OLD_SUPREMUM); return(offset == PAGE_NEW_SUPREMUM || offset == PAGE_OLD_SUPREMUM);
} }
@ -363,7 +363,7 @@ bool
page_rec_is_infimum_low(ulint offset) page_rec_is_infimum_low(ulint offset)
{ {
ut_ad(offset >= PAGE_NEW_INFIMUM); ut_ad(offset >= PAGE_NEW_INFIMUM);
ut_ad(offset <= UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START);
ut_ad(offset <= srv_page_size - PAGE_EMPTY_DIR_START);
return(offset == PAGE_NEW_INFIMUM || offset == PAGE_OLD_INFIMUM); return(offset == PAGE_NEW_INFIMUM || offset == PAGE_OLD_INFIMUM);
} }
@ -663,7 +663,7 @@ page_dir_get_nth_slot(
ulint n); /*!< in: position */ ulint n); /*!< in: position */
#else /* UNIV_DEBUG */ #else /* UNIV_DEBUG */
# define page_dir_get_nth_slot(page, n) \ # define page_dir_get_nth_slot(page, n) \
((page) + (UNIV_PAGE_SIZE - PAGE_DIR \
((page) + (srv_page_size - PAGE_DIR \
- (n + 1) * PAGE_DIR_SLOT_SIZE)) - (n + 1) * PAGE_DIR_SLOT_SIZE))
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
/**************************************************************//** /**************************************************************//**

14
storage/innobase/include/page0page.ic

@ -172,8 +172,8 @@ page_header_set_field(
{ {
ut_ad(page); ut_ad(page);
ut_ad(field <= PAGE_N_RECS); ut_ad(field <= PAGE_N_RECS);
ut_ad(field == PAGE_N_HEAP || val < UNIV_PAGE_SIZE);
ut_ad(field != PAGE_N_HEAP || (val & 0x7fff) < UNIV_PAGE_SIZE);
ut_ad(field == PAGE_N_HEAP || val < srv_page_size);
ut_ad(field != PAGE_N_HEAP || (val & 0x7fff) < srv_page_size);
mach_write_to_2(page + PAGE_HEADER + field, val); mach_write_to_2(page + PAGE_HEADER + field, val);
if (page_zip) { if (page_zip) {
@ -521,7 +521,7 @@ page_dir_get_nth_slot(
ut_ad(page_dir_get_n_slots(page) > n); ut_ad(page_dir_get_n_slots(page) > n);
return((page_dir_slot_t*) return((page_dir_slot_t*)
page + UNIV_PAGE_SIZE - PAGE_DIR
page + srv_page_size - PAGE_DIR
- (n + 1) * PAGE_DIR_SLOT_SIZE); - (n + 1) * PAGE_DIR_SLOT_SIZE);
} }
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
@ -640,7 +640,7 @@ page_rec_get_next_low(
offs = rec_get_next_offs(rec, comp); offs = rec_get_next_offs(rec, comp);
if (offs >= UNIV_PAGE_SIZE) {
if (offs >= srv_page_size) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Next record offset is nonsensical %lu" "InnoDB: Next record offset is nonsensical %lu"
" in record at offset %lu\n" " in record at offset %lu\n"
@ -852,7 +852,7 @@ page_get_data_size(
? PAGE_NEW_SUPREMUM_END ? PAGE_NEW_SUPREMUM_END
: PAGE_OLD_SUPREMUM_END) : PAGE_OLD_SUPREMUM_END)
- page_header_get_field(page, PAGE_GARBAGE); - page_header_get_field(page, PAGE_GARBAGE);
ut_ad(ret < UNIV_PAGE_SIZE);
ut_ad(ret < srv_page_size);
return(ret); return(ret);
} }
@ -900,13 +900,13 @@ page_get_free_space_of_empty(
ulint comp) /*!< in: nonzero=compact page layout */ ulint comp) /*!< in: nonzero=compact page layout */
{ {
if (comp) { if (comp) {
return((ulint)(UNIV_PAGE_SIZE
return((ulint)(srv_page_size
- PAGE_NEW_SUPREMUM_END - PAGE_NEW_SUPREMUM_END
- PAGE_DIR - PAGE_DIR
- 2 * PAGE_DIR_SLOT_SIZE)); - 2 * PAGE_DIR_SLOT_SIZE));
} }
return((ulint)(UNIV_PAGE_SIZE
return((ulint)(srv_page_size
- PAGE_OLD_SUPREMUM_END - PAGE_OLD_SUPREMUM_END
- PAGE_DIR - PAGE_DIR
- 2 * PAGE_DIR_SLOT_SIZE)); - 2 * PAGE_DIR_SLOT_SIZE));

2
storage/innobase/include/page0zip.ic

@ -120,7 +120,7 @@ page_zip_get_size(
size = (UNIV_ZIP_SIZE_MIN >> 1) << page_zip->ssize; size = (UNIV_ZIP_SIZE_MIN >> 1) << page_zip->ssize;
ut_ad(size >= UNIV_ZIP_SIZE_MIN); ut_ad(size >= UNIV_ZIP_SIZE_MIN);
ut_ad(size <= UNIV_PAGE_SIZE);
ut_ad(size <= srv_page_size);
return(size); return(size);
} }

38
storage/innobase/include/rem0rec.ic

@ -61,7 +61,7 @@ most significant bytes and bits are written below less significant.
we can calculate the offset of the next we can calculate the offset of the next
record with the formula: record with the formula:
relative_offset + offset_of_this_record relative_offset + offset_of_this_record
mod UNIV_PAGE_SIZE
mod srv_page_size
3 3 bits status: 3 3 bits status:
000=REC_STATUS_ORDINARY 000=REC_STATUS_ORDINARY
001=REC_STATUS_NODE_PTR 001=REC_STATUS_NODE_PTR
@ -254,13 +254,13 @@ rec_get_next_ptr_const(
as signed 16-bit integer in 2's complement arithmetics. as signed 16-bit integer in 2's complement arithmetics.
If all platforms defined int16_t in the standard headers, If all platforms defined int16_t in the standard headers,
the expression could be written simpler as the expression could be written simpler as
(int16_t) field_value + ut_align_offset(...) < UNIV_PAGE_SIZE
(int16_t) field_value + ut_align_offset(...) < srv_page_size
*/ */
ut_ad((field_value >= 32768 ut_ad((field_value >= 32768
? field_value - 65536 ? field_value - 65536
: field_value) : field_value)
+ ut_align_offset(rec, UNIV_PAGE_SIZE)
< UNIV_PAGE_SIZE);
+ ut_align_offset(rec, srv_page_size)
< srv_page_size);
#endif #endif
/* There must be at least REC_N_NEW_EXTRA_BYTES + 1 /* There must be at least REC_N_NEW_EXTRA_BYTES + 1
between each record. */ between each record. */
@ -268,12 +268,12 @@ rec_get_next_ptr_const(
&& field_value < 32768) && field_value < 32768)
|| field_value < (uint16) -REC_N_NEW_EXTRA_BYTES); || field_value < (uint16) -REC_N_NEW_EXTRA_BYTES);
return((byte*) ut_align_down(rec, UNIV_PAGE_SIZE)
+ ut_align_offset(rec + field_value, UNIV_PAGE_SIZE));
return((byte*) ut_align_down(rec, srv_page_size)
+ ut_align_offset(rec + field_value, srv_page_size));
} else { } else {
ut_ad(field_value < UNIV_PAGE_SIZE);
ut_ad(field_value < srv_page_size);
return((byte*) ut_align_down(rec, UNIV_PAGE_SIZE)
return((byte*) ut_align_down(rec, srv_page_size)
+ field_value); + field_value);
} }
} }
@ -322,13 +322,13 @@ rec_get_next_offs(
as signed 16-bit integer in 2's complement arithmetics. as signed 16-bit integer in 2's complement arithmetics.
If all platforms defined int16_t in the standard headers, If all platforms defined int16_t in the standard headers,
the expression could be written simpler as the expression could be written simpler as
(int16_t) field_value + ut_align_offset(...) < UNIV_PAGE_SIZE
(int16_t) field_value + ut_align_offset(...) < srv_page_size
*/ */
ut_ad((field_value >= 32768 ut_ad((field_value >= 32768
? field_value - 65536 ? field_value - 65536
: field_value) : field_value)
+ ut_align_offset(rec, UNIV_PAGE_SIZE)
< UNIV_PAGE_SIZE);
+ ut_align_offset(rec, srv_page_size)
< srv_page_size);
#endif #endif
if (field_value == 0) { if (field_value == 0) {
@ -341,9 +341,9 @@ rec_get_next_offs(
&& field_value < 32768) && field_value < 32768)
|| field_value < (uint16) -REC_N_NEW_EXTRA_BYTES); || field_value < (uint16) -REC_N_NEW_EXTRA_BYTES);
return(ut_align_offset(rec + field_value, UNIV_PAGE_SIZE));
return(ut_align_offset(rec + field_value, srv_page_size));
} else { } else {
ut_ad(field_value < UNIV_PAGE_SIZE);
ut_ad(field_value < srv_page_size);
return(field_value); return(field_value);
} }
@ -360,7 +360,7 @@ rec_set_next_offs_old(
ulint next) /*!< in: offset of the next record */ ulint next) /*!< in: offset of the next record */
{ {
ut_ad(rec); ut_ad(rec);
ut_ad(UNIV_PAGE_SIZE > next);
ut_ad(srv_page_size > next);
#if REC_NEXT_MASK != 0xFFFFUL #if REC_NEXT_MASK != 0xFFFFUL
# error "REC_NEXT_MASK != 0xFFFFUL" # error "REC_NEXT_MASK != 0xFFFFUL"
#endif #endif
@ -384,7 +384,7 @@ rec_set_next_offs_new(
ulint field_value; ulint field_value;
ut_ad(rec); ut_ad(rec);
ut_ad(UNIV_PAGE_SIZE > next);
ut_ad(srv_page_size > next);
if (!next) { if (!next) {
field_value = 0; field_value = 0;
@ -395,7 +395,7 @@ rec_set_next_offs_new(
field_value = (ulint) field_value = (ulint)
((lint) next ((lint) next
- (lint) ut_align_offset(rec, UNIV_PAGE_SIZE));
- (lint) ut_align_offset(rec, srv_page_size));
field_value &= REC_NEXT_MASK; field_value &= REC_NEXT_MASK;
} }
@ -1198,7 +1198,7 @@ rec_get_nth_field_size(
os = rec_get_field_start_offs(rec, n); os = rec_get_field_start_offs(rec, n);
next_os = rec_get_field_start_offs(rec, n + 1); next_os = rec_get_field_start_offs(rec, n + 1);
ut_ad(next_os - os < UNIV_PAGE_SIZE);
ut_ad(next_os - os < srv_page_size);
return(next_os - os); return(next_os - os);
} }
@ -1300,7 +1300,7 @@ rec_offs_data_size(
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
size = rec_offs_base(offsets)[rec_offs_n_fields(offsets)] size = rec_offs_base(offsets)[rec_offs_n_fields(offsets)]
& REC_OFFS_MASK; & REC_OFFS_MASK;
ut_ad(size < UNIV_PAGE_SIZE);
ut_ad(size < srv_page_size);
return(size); return(size);
} }
@ -1318,7 +1318,7 @@ rec_offs_extra_size(
ulint size; ulint size;
ut_ad(rec_offs_validate(NULL, NULL, offsets)); ut_ad(rec_offs_validate(NULL, NULL, offsets));
size = *rec_offs_base(offsets) & REC_OFFS_MASK; size = *rec_offs_base(offsets) & REC_OFFS_MASK;
ut_ad(size < UNIV_PAGE_SIZE);
ut_ad(size < srv_page_size);
return(size); return(size);
} }

4
storage/innobase/include/row0merge.h

@ -61,11 +61,11 @@ struct ib_sequence_t;
/** @brief Block size for I/O operations in merge sort. /** @brief Block size for I/O operations in merge sort.
The minimum is UNIV_PAGE_SIZE, or page_get_free_space_of_empty()
The minimum is srv_page_size, or page_get_free_space_of_empty()
rounded to a power of 2. rounded to a power of 2.
When not creating a PRIMARY KEY that contains column prefixes, this When not creating a PRIMARY KEY that contains column prefixes, this
can be set as small as UNIV_PAGE_SIZE / 2. */
can be set as small as srv_page_size / 2. */
typedef byte row_merge_block_t; typedef byte row_merge_block_t;
/** @brief Secondary buffer for I/O operations of merge records. /** @brief Secondary buffer for I/O operations of merge records.

2
storage/innobase/include/srv0srv.h

@ -977,7 +977,7 @@ struct export_var_t{
ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */ ulint innodb_os_log_fsyncs; /*!< fil_n_log_flushes */
ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */ ulint innodb_os_log_pending_writes; /*!< srv_os_log_pending_writes */
ulint innodb_os_log_pending_fsyncs; /*!< fil_n_pending_log_flushes */ ulint innodb_os_log_pending_fsyncs; /*!< fil_n_pending_log_flushes */
ulint innodb_page_size; /*!< UNIV_PAGE_SIZE */
ulint innodb_page_size; /*!< srv_page_size */
ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */ ulint innodb_pages_created; /*!< buf_pool->stat.n_pages_created */
ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read*/ ulint innodb_pages_read; /*!< buf_pool->stat.n_pages_read*/
ulint innodb_page0_read; /*!< srv_stats.page0_read */ ulint innodb_page0_read; /*!< srv_stats.page0_read */

4
storage/innobase/include/trx0rec.ic

@ -64,8 +64,8 @@ trx_undo_rec_copy(
ulint len; ulint len;
len = mach_read_from_2(undo_rec) len = mach_read_from_2(undo_rec)
- ut_align_offset(undo_rec, UNIV_PAGE_SIZE);
ut_ad(len < UNIV_PAGE_SIZE);
- ut_align_offset(undo_rec, srv_page_size);
ut_ad(len < srv_page_size);
trx_undo_rec_t* rec = static_cast<trx_undo_rec_t*>( trx_undo_rec_t* rec = static_cast<trx_undo_rec_t*>(
mem_heap_dup(heap, undo_rec, len)); mem_heap_dup(heap, undo_rec, len));
mach_write_to_2(rec, len); mach_write_to_2(rec, len);

2
storage/innobase/include/trx0rseg.h

@ -113,7 +113,7 @@ trx_rseg_get_n_undo_tablespaces(
ulint* space_ids); /*!< out: array of space ids of ulint* space_ids); /*!< out: array of space ids of
UNDO tablespaces */ UNDO tablespaces */
/* Number of undo log slots in a rollback segment file copy */ /* Number of undo log slots in a rollback segment file copy */
#define TRX_RSEG_N_SLOTS (UNIV_PAGE_SIZE / 16)
#define TRX_RSEG_N_SLOTS (srv_page_size / 16)
/* Maximum number of transactions supported by a single rollback segment */ /* Maximum number of transactions supported by a single rollback segment */
#define TRX_RSEG_MAX_N_TRXS (TRX_RSEG_N_SLOTS / 2) #define TRX_RSEG_MAX_N_TRXS (TRX_RSEG_N_SLOTS / 2)

18
storage/innobase/include/trx0sys.h

@ -224,7 +224,7 @@ trx_sysf_rseg_get_page_no(const buf_block_t* sys_header, ulint rseg_id)
# error "UNIV_PAGE_SIZE_MIN < 4096" # error "UNIV_PAGE_SIZE_MIN < 4096"
#endif #endif
/** The offset of the MySQL binlog offset info in the trx system header */ /** The offset of the MySQL binlog offset info in the trx system header */
#define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 1000)
#define TRX_SYS_MYSQL_LOG_INFO (srv_page_size - 1000)
#define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 0 /*!< magic number which is #define TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 0 /*!< magic number which is
TRX_SYS_MYSQL_LOG_MAGIC_N TRX_SYS_MYSQL_LOG_MAGIC_N
if we have valid data in the if we have valid data in the
@ -233,7 +233,7 @@ trx_sysf_rseg_get_page_no(const buf_block_t* sys_header, ulint rseg_id)
within that file */ within that file */
#define TRX_SYS_MYSQL_LOG_NAME 12 /*!< MySQL log file name */ #define TRX_SYS_MYSQL_LOG_NAME 12 /*!< MySQL log file name */
/** Memory map TRX_SYS_PAGE_NO = 5 when UNIV_PAGE_SIZE = 4096
/** Memory map TRX_SYS_PAGE_NO = 5 when srv_page_size = 4096
0...37 FIL_HEADER 0...37 FIL_HEADER
38...45 TRX_SYS_TRX_ID_STORE 38...45 TRX_SYS_TRX_ID_STORE
@ -249,7 +249,7 @@ trx_sysf_rseg_get_page_no(const buf_block_t* sys_header, ulint rseg_id)
... ...
...1063 TRX_SYS_RSEG_PAGE_NO for slot 126 ...1063 TRX_SYS_RSEG_PAGE_NO for slot 126
(UNIV_PAGE_SIZE-3500 WSREP ::: FAIL would overwrite undo tablespace
(srv_page_size-3500 WSREP ::: FAIL would overwrite undo tablespace
space_id, page_no pairs :::) space_id, page_no pairs :::)
596 TRX_SYS_WSREP_XID_INFO TRX_SYS_WSREP_XID_MAGIC_N_FLD 596 TRX_SYS_WSREP_XID_INFO TRX_SYS_WSREP_XID_MAGIC_N_FLD
600 TRX_SYS_WSREP_XID_FORMAT 600 TRX_SYS_WSREP_XID_FORMAT
@ -259,7 +259,7 @@ space_id, page_no pairs :::)
739 TRX_SYS_WSREP_XID_DATA_END 739 TRX_SYS_WSREP_XID_DATA_END
FIXED WSREP XID info offsets for 4k page size 10.0.32-galera FIXED WSREP XID info offsets for 4k page size 10.0.32-galera
(UNIV_PAGE_SIZE-2500)
(srv_page_size-2500)
1596 TRX_SYS_WSREP_XID_INFO TRX_SYS_WSREP_XID_MAGIC_N_FLD 1596 TRX_SYS_WSREP_XID_INFO TRX_SYS_WSREP_XID_MAGIC_N_FLD
1600 TRX_SYS_WSREP_XID_FORMAT 1600 TRX_SYS_WSREP_XID_FORMAT
1604 TRX_SYS_WSREP_XID_GTRID_LEN 1604 TRX_SYS_WSREP_XID_GTRID_LEN
@ -267,19 +267,19 @@ FIXED WSREP XID info offsets for 4k page size 10.0.32-galera
1612 TRX_SYS_WSREP_XID_DATA (len = 128) 1612 TRX_SYS_WSREP_XID_DATA (len = 128)
1739 TRX_SYS_WSREP_XID_DATA_END 1739 TRX_SYS_WSREP_XID_DATA_END
(UNIV_PAGE_SIZE - 2000 MYSQL MASTER LOG)
(srv_page_size - 2000 MYSQL MASTER LOG)
2096 TRX_SYS_MYSQL_MASTER_LOG_INFO TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 2096 TRX_SYS_MYSQL_MASTER_LOG_INFO TRX_SYS_MYSQL_LOG_MAGIC_N_FLD
2100 TRX_SYS_MYSQL_LOG_OFFSET_HIGH 2100 TRX_SYS_MYSQL_LOG_OFFSET_HIGH
2104 TRX_SYS_MYSQL_LOG_OFFSET_LOW 2104 TRX_SYS_MYSQL_LOG_OFFSET_LOW
2108 TRX_SYS_MYSQL_LOG_NAME 2108 TRX_SYS_MYSQL_LOG_NAME
(UNIV_PAGE_SIZE - 1000 MYSQL LOG)
(srv_page_size - 1000 MYSQL LOG)
3096 TRX_SYS_MYSQL_LOG_INFO TRX_SYS_MYSQL_LOG_MAGIC_N_FLD 3096 TRX_SYS_MYSQL_LOG_INFO TRX_SYS_MYSQL_LOG_MAGIC_N_FLD
3100 TRX_SYS_MYSQL_LOG_OFFSET_HIGH 3100 TRX_SYS_MYSQL_LOG_OFFSET_HIGH
3104 TRX_SYS_MYSQL_LOG_OFFSET_LOW 3104 TRX_SYS_MYSQL_LOG_OFFSET_LOW
3108 TRX_SYS_MYSQL_LOG_NAME 3108 TRX_SYS_MYSQL_LOG_NAME
(UNIV_PAGE_SIZE - 200 DOUBLEWRITE)
(srv_page_size - 200 DOUBLEWRITE)
3896 TRX_SYS_DOUBLEWRITE TRX_SYS_DOUBLEWRITE_FSEG 3896 TRX_SYS_DOUBLEWRITE TRX_SYS_DOUBLEWRITE_FSEG
3906 TRX_SYS_DOUBLEWRITE_MAGIC 3906 TRX_SYS_DOUBLEWRITE_MAGIC
3910 TRX_SYS_DOUBLEWRITE_BLOCK1 3910 TRX_SYS_DOUBLEWRITE_BLOCK1
@ -287,7 +287,7 @@ FIXED WSREP XID info offsets for 4k page size 10.0.32-galera
3918 TRX_SYS_DOUBLEWRITE_REPEAT 3918 TRX_SYS_DOUBLEWRITE_REPEAT
3930 TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N 3930 TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N
(UNIV_PAGE_SIZE - 8, TAILER)
(srv_page_size - 8, TAILER)
4088..4096 FIL_TAILER 4088..4096 FIL_TAILER
*/ */
@ -308,7 +308,7 @@ FIXED WSREP XID info offsets for 4k page size 10.0.32-galera
/** Doublewrite buffer */ /** Doublewrite buffer */
/* @{ */ /* @{ */
/** The offset of the doublewrite buffer header on the trx system header page */ /** The offset of the doublewrite buffer header on the trx system header page */
#define TRX_SYS_DOUBLEWRITE (UNIV_PAGE_SIZE - 200)
#define TRX_SYS_DOUBLEWRITE (srv_page_size - 200)
/*-------------------------------------------------------------*/ /*-------------------------------------------------------------*/
#define TRX_SYS_DOUBLEWRITE_FSEG 0 /*!< fseg header of the fseg #define TRX_SYS_DOUBLEWRITE_FSEG 0 /*!< fseg header of the fseg
containing the doublewrite containing the doublewrite

2
storage/innobase/include/trx0undo.h

@ -421,7 +421,7 @@ struct trx_undo_t {
at most this many bytes used; we must leave space at least for one new undo at most this many bytes used; we must leave space at least for one new undo
log header on the page */ log header on the page */
#define TRX_UNDO_PAGE_REUSE_LIMIT (3 * UNIV_PAGE_SIZE / 4)
#define TRX_UNDO_PAGE_REUSE_LIMIT (3 * srv_page_size / 4)
/* An update undo log segment may contain several undo logs on its first page /* An update undo log segment may contain several undo logs on its first page
if the undo logs took so little space that the segment could be cached and if the undo logs took so little space that the segment could be cached and

2
storage/innobase/include/trx0undo.ic

@ -220,7 +220,7 @@ trx_undo_page_get_next_rec(
ulint end; ulint end;
ulint next; ulint next;
undo_page = (page_t*) ut_align_down(rec, UNIV_PAGE_SIZE);
undo_page = (page_t*) ut_align_down(rec, srv_page_size);
end = trx_undo_page_get_end(undo_page, page_no, offset); end = trx_undo_page_get_end(undo_page, page_no, offset);

12
storage/innobase/include/univ.i

@ -275,9 +275,6 @@ management to ensure correct alignment for doubles etc. */
======================== ========================
*/ */
/** The 2-logarithm of UNIV_PAGE_SIZE: */
#define UNIV_PAGE_SIZE_SHIFT srv_page_size_shift
#ifdef HAVE_LZO #ifdef HAVE_LZO
#define IF_LZO(A,B) A #define IF_LZO(A,B) A
#else #else
@ -314,9 +311,6 @@ management to ensure correct alignment for doubles etc. */
#define IF_PUNCH_HOLE(A,B) B #define IF_PUNCH_HOLE(A,B) B
#endif #endif
/** The universal page size of the database */
#define UNIV_PAGE_SIZE ((ulint) srv_page_size)
/** log2 of smallest compressed page size (1<<10 == 1024 bytes) /** log2 of smallest compressed page size (1<<10 == 1024 bytes)
Note: This must never change! */ Note: This must never change! */
#define UNIV_ZIP_SIZE_SHIFT_MIN 10 #define UNIV_ZIP_SIZE_SHIFT_MIN 10
@ -359,13 +353,13 @@ and 2 bits for flags. This limits the uncompressed page size to 16k.
/** Largest possible ssize for an uncompressed page. /** Largest possible ssize for an uncompressed page.
(The convention 'ssize' is used for 'log2 minus 9' or the number of (The convention 'ssize' is used for 'log2 minus 9' or the number of
shifts starting with 512.) shifts starting with 512.)
This max number varies depending on UNIV_PAGE_SIZE. */
This max number varies depending on srv_page_size. */
#define UNIV_PAGE_SSIZE_MAX \ #define UNIV_PAGE_SSIZE_MAX \
static_cast<ulint>(UNIV_PAGE_SIZE_SHIFT - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
ulint(srv_page_size_shift - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
/** Smallest possible ssize for an uncompressed page. */ /** Smallest possible ssize for an uncompressed page. */
#define UNIV_PAGE_SSIZE_MIN \ #define UNIV_PAGE_SSIZE_MIN \
static_cast<ulint>(UNIV_PAGE_SIZE_SHIFT_MIN - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
ulint(UNIV_PAGE_SIZE_SHIFT_MIN - UNIV_ZIP_SIZE_SHIFT_MIN + 1)
/** Maximum number of parallel threads in a parallelized operation */ /** Maximum number of parallel threads in a parallelized operation */
#define UNIV_MAX_PARALLELISM 32 #define UNIV_MAX_PARALLELISM 32

30
storage/innobase/log/log0log.cc

@ -106,7 +106,7 @@ static time_t log_last_margine_warning_time;
/* Margins for free space in the log buffer after a log entry is catenated */ /* Margins for free space in the log buffer after a log entry is catenated */
#define LOG_BUF_FLUSH_RATIO 2 #define LOG_BUF_FLUSH_RATIO 2
#define LOG_BUF_FLUSH_MARGIN (LOG_BUF_WRITE_MARGIN + 4 * UNIV_PAGE_SIZE)
#define LOG_BUF_FLUSH_MARGIN (LOG_BUF_WRITE_MARGIN + 4 * srv_page_size)
/* This parameter controls asynchronous making of a new checkpoint; the value /* This parameter controls asynchronous making of a new checkpoint; the value
should be bigger than LOG_POOL_PREFLUSH_RATIO_SYNC */ should be bigger than LOG_POOL_PREFLUSH_RATIO_SYNC */
@ -184,7 +184,7 @@ log_buffer_extend(
log_mutex_enter_all(); log_mutex_enter_all();
if (srv_log_buffer_size > len / UNIV_PAGE_SIZE) {
if (srv_log_buffer_size > len / srv_page_size) {
/* Already extended enough by the others */ /* Already extended enough by the others */
log_mutex_exit_all(); log_mutex_exit_all();
return; return;
@ -234,7 +234,7 @@ log_buffer_extend(
ut_free_dodump(log_sys->buf, log_sys->buf_size * 2); ut_free_dodump(log_sys->buf, log_sys->buf_size * 2);
/* reallocate log buffer */ /* reallocate log buffer */
srv_log_buffer_size = len / UNIV_PAGE_SIZE + 1;
srv_log_buffer_size = len / srv_page_size + 1;
log_sys->buf_size = LOG_BUFFER_SIZE; log_sys->buf_size = LOG_BUFFER_SIZE;
log_sys->buf = static_cast<byte*>( log_sys->buf = static_cast<byte*>(
@ -722,7 +722,7 @@ log_sys_init()
log_sys->lsn = LOG_START_LSN; log_sys->lsn = LOG_START_LSN;
ut_a(LOG_BUFFER_SIZE >= 16 * OS_FILE_LOG_BLOCK_SIZE); ut_a(LOG_BUFFER_SIZE >= 16 * OS_FILE_LOG_BLOCK_SIZE);
ut_a(LOG_BUFFER_SIZE >= 4 * UNIV_PAGE_SIZE);
ut_a(LOG_BUFFER_SIZE >= 4 * srv_page_size);
log_sys->buf_size = LOG_BUFFER_SIZE; log_sys->buf_size = LOG_BUFFER_SIZE;
@ -895,13 +895,12 @@ log_group_file_header_flush(
srv_stats.os_log_pending_writes.inc(); srv_stats.os_log_pending_writes.inc();
const ulint page_no
= (ulint) (dest_offset / univ_page_size.physical());
const ulint page_no = ulint(dest_offset / srv_page_size);
fil_io(IORequestLogWrite, true, fil_io(IORequestLogWrite, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no), page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size, univ_page_size,
(ulint) (dest_offset % univ_page_size.physical()),
ulint(dest_offset % srv_page_size),
OS_FILE_LOG_BLOCK_SIZE, buf, group); OS_FILE_LOG_BLOCK_SIZE, buf, group);
srv_stats.os_log_pending_writes.dec(); srv_stats.os_log_pending_writes.dec();
@ -1016,15 +1015,14 @@ loop:
srv_stats.os_log_pending_writes.inc(); srv_stats.os_log_pending_writes.inc();
ut_a(next_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
ut_a(next_offset / srv_page_size <= ULINT_MAX);
const ulint page_no
= (ulint) (next_offset / univ_page_size.physical());
const ulint page_no = ulint(next_offset / srv_page_size);
fil_io(IORequestLogWrite, true, fil_io(IORequestLogWrite, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no), page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size, univ_page_size,
(ulint) (next_offset % UNIV_PAGE_SIZE), write_len, buf,
ulint(next_offset % srv_page_size), write_len, buf,
group); group);
srv_stats.os_log_pending_writes.dec(); srv_stats.os_log_pending_writes.dec();
@ -1261,7 +1259,7 @@ loop:
/* The first block in the unit was initialized /* The first block in the unit was initialized
after the last writing. after the last writing.
Needs to be written padded data once. */ Needs to be written padded data once. */
pad_size = std::min(
pad_size = std::min<ulint>(
ulint(write_ahead_size) - end_offset_in_unit, ulint(write_ahead_size) - end_offset_in_unit,
log_sys->buf_size - area_end); log_sys->buf_size - area_end);
::memset(write_buf + area_end, 0, pad_size); ::memset(write_buf + area_end, 0, pad_size);
@ -1524,8 +1522,8 @@ log_group_checkpoint(lsn_t end_lsn)
MONITOR_INC(MONITOR_LOG_IO); MONITOR_INC(MONITOR_LOG_IO);
ut_ad(LOG_CHECKPOINT_1 < univ_page_size.physical());
ut_ad(LOG_CHECKPOINT_2 < univ_page_size.physical());
ut_ad(LOG_CHECKPOINT_1 < srv_page_size);
ut_ad(LOG_CHECKPOINT_2 < srv_page_size);
if (log_sys->n_pending_checkpoint_writes++ == 0) { if (log_sys->n_pending_checkpoint_writes++ == 0) {
rw_lock_x_lock_gen(&log_sys->checkpoint_lock, rw_lock_x_lock_gen(&log_sys->checkpoint_lock,
@ -1566,8 +1564,8 @@ log_group_header_read(
fil_io(IORequestLogRead, true, fil_io(IORequestLogRead, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_id_t(SRV_LOG_SPACE_FIRST_ID,
header / univ_page_size.physical()),
univ_page_size, header % univ_page_size.physical(),
header / srv_page_size),
univ_page_size, header % srv_page_size,
OS_FILE_LOG_BLOCK_SIZE, log_sys->checkpoint_buf, NULL); OS_FILE_LOG_BLOCK_SIZE, log_sys->checkpoint_buf, NULL);
} }

24
storage/innobase/log/log0recv.cc

@ -62,7 +62,7 @@ Created 9/20/1997 Heikki Tuuri
#include "row0merge.h" #include "row0merge.h"
/** Log records are stored in the hash table in chunks at most of this size; /** Log records are stored in the hash table in chunks at most of this size;
this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */
this must be less than srv_page_size as it is stored in the buffer pool */
#define RECV_DATA_BLOCK_SIZE (MEM_MAX_ALLOC_IN_BUF - sizeof(recv_data_t)) #define RECV_DATA_BLOCK_SIZE (MEM_MAX_ALLOC_IN_BUF - sizeof(recv_data_t))
/** Read-ahead area in applying log records to file pages */ /** Read-ahead area in applying log records to file pages */
@ -673,15 +673,14 @@ loop:
MONITOR_INC(MONITOR_LOG_IO); MONITOR_INC(MONITOR_LOG_IO);
ut_a(source_offset / UNIV_PAGE_SIZE <= ULINT_MAX);
ut_a(source_offset / srv_page_size <= ULINT_MAX);
const ulint page_no
= (ulint) (source_offset / univ_page_size.physical());
const ulint page_no = ulint(source_offset / srv_page_size);
fil_io(IORequestLogRead, true, fil_io(IORequestLogRead, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no), page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size, univ_page_size,
(ulint) (source_offset % univ_page_size.physical()),
ulint(source_offset % srv_page_size),
len, buf, NULL); len, buf, NULL);
for (ulint l = 0; l < len; l += OS_FILE_LOG_BLOCK_SIZE, for (ulint l = 0; l < len; l += OS_FILE_LOG_BLOCK_SIZE,
@ -887,8 +886,7 @@ recv_log_format_0_recover(lsn_t lsn)
const lsn_t source_offset const lsn_t source_offset
= log_group_calc_lsn_offset(lsn, group); = log_group_calc_lsn_offset(lsn, group);
log_mutex_exit(); log_mutex_exit();
const ulint page_no
= (ulint) (source_offset / univ_page_size.physical());
const ulint page_no = ulint(source_offset / srv_page_size);
byte* buf = log_sys->buf; byte* buf = log_sys->buf;
static const char* NO_UPGRADE_RECOVERY_MSG = static const char* NO_UPGRADE_RECOVERY_MSG =
@ -898,9 +896,9 @@ recv_log_format_0_recover(lsn_t lsn)
fil_io(IORequestLogRead, true, fil_io(IORequestLogRead, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no), page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size, univ_page_size,
(ulint) ((source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1))
% univ_page_size.physical()),
OS_FILE_LOG_BLOCK_SIZE, buf, NULL);
ulint((source_offset & ~(OS_FILE_LOG_BLOCK_SIZE - 1))
% srv_page_size),
OS_FILE_LOG_BLOCK_SIZE, buf, NULL);
if (log_block_calc_checksum_format_0(buf) if (log_block_calc_checksum_format_0(buf)
!= log_block_get_checksum(buf) != log_block_get_checksum(buf)
@ -1598,7 +1596,7 @@ recv_add_to_hash_table(
prev_field = &(recv->data); prev_field = &(recv->data);
/* Store the log record body in chunks of less than UNIV_PAGE_SIZE:
/* Store the log record body in chunks of less than srv_page_size:
recv_sys->heap grows into the buffer pool, and bigger chunks could not recv_sys->heap grows into the buffer pool, and bigger chunks could not
be allocated */ be allocated */
@ -1811,7 +1809,7 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
end_lsn = recv->start_lsn + recv->len; end_lsn = recv->start_lsn + recv->len;
mach_write_to_8(FIL_PAGE_LSN + page, end_lsn); mach_write_to_8(FIL_PAGE_LSN + page, end_lsn);
mach_write_to_8(UNIV_PAGE_SIZE
mach_write_to_8(srv_page_size
- FIL_PAGE_END_LSN_OLD_CHKSUM - FIL_PAGE_END_LSN_OLD_CHKSUM
+ page, end_lsn); + page, end_lsn);
@ -2908,7 +2906,7 @@ recv_group_scan_log_recs(
lsn_t end_lsn; lsn_t end_lsn;
store_t store_to_hash = recv_sys->mlog_checkpoint_lsn == 0 store_t store_to_hash = recv_sys->mlog_checkpoint_lsn == 0
? STORE_NO : (last_phase ? STORE_IF_EXISTS : STORE_YES); ? STORE_NO : (last_phase ? STORE_IF_EXISTS : STORE_YES);
ulint available_mem = UNIV_PAGE_SIZE
ulint available_mem = srv_page_size
* (buf_pool_get_n_pages() * (buf_pool_get_n_pages()
- (recv_n_pool_free_frames * srv_buf_pool_instances)); - (recv_n_pool_free_frames * srv_buf_pool_instances));

8
storage/innobase/mem/mem0mem.cc

@ -219,7 +219,7 @@ mem_heap_validate(
break; break;
case MEM_HEAP_BUFFER: case MEM_HEAP_BUFFER:
case MEM_HEAP_BUFFER | MEM_HEAP_BTR_SEARCH: case MEM_HEAP_BUFFER | MEM_HEAP_BTR_SEARCH:
ut_ad(block->len <= UNIV_PAGE_SIZE);
ut_ad(block->len <= srv_page_size);
break; break;
default: default:
ut_error; ut_error;
@ -264,13 +264,13 @@ mem_heap_create_block_func(
/* In dynamic allocation, calculate the size: block header + data. */ /* In dynamic allocation, calculate the size: block header + data. */
len = MEM_BLOCK_HEADER_SIZE + MEM_SPACE_NEEDED(n); len = MEM_BLOCK_HEADER_SIZE + MEM_SPACE_NEEDED(n);
if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) {
if (type == MEM_HEAP_DYNAMIC || len < srv_page_size / 2) {
ut_ad(type == MEM_HEAP_DYNAMIC || n <= MEM_MAX_ALLOC_IN_BUF); ut_ad(type == MEM_HEAP_DYNAMIC || n <= MEM_MAX_ALLOC_IN_BUF);
block = static_cast<mem_block_t*>(ut_malloc_nokey(len)); block = static_cast<mem_block_t*>(ut_malloc_nokey(len));
} else { } else {
len = UNIV_PAGE_SIZE;
len = srv_page_size;
if ((type & MEM_HEAP_BTR_SEARCH) && heap) { if ((type & MEM_HEAP_BTR_SEARCH) && heap) {
/* We cannot allocate the block from the /* We cannot allocate the block from the
@ -412,7 +412,7 @@ mem_heap_block_free(
len = block->len; len = block->len;
block->magic_n = MEM_FREED_BLOCK_MAGIC_N; block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
if (type == MEM_HEAP_DYNAMIC || len < UNIV_PAGE_SIZE / 2) {
if (type == MEM_HEAP_DYNAMIC || len < srv_page_size / 2) {
ut_ad(!buf_block); ut_ad(!buf_block);
ut_free(block); ut_free(block);
} else { } else {

8
storage/innobase/mtr/mtr0log.cc

@ -144,7 +144,7 @@ mlog_parse_nbytes(
offset = mach_read_from_2(ptr); offset = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
if (offset >= UNIV_PAGE_SIZE) {
if (offset >= srv_page_size) {
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
return(NULL); return(NULL);
@ -312,7 +312,7 @@ mlog_write_string(
mtr_t* mtr) /*!< in: mini-transaction handle */ mtr_t* mtr) /*!< in: mini-transaction handle */
{ {
ut_ad(ptr && mtr); ut_ad(ptr && mtr);
ut_a(len < UNIV_PAGE_SIZE);
ut_a(len < srv_page_size);
memcpy(ptr, str, len); memcpy(ptr, str, len);
@ -332,7 +332,7 @@ mlog_log_string(
byte* log_ptr; byte* log_ptr;
ut_ad(ptr && mtr); ut_ad(ptr && mtr);
ut_ad(len <= UNIV_PAGE_SIZE);
ut_ad(len <= srv_page_size);
log_ptr = mlog_open(mtr, 30); log_ptr = mlog_open(mtr, 30);
@ -383,7 +383,7 @@ mlog_parse_string(
len = mach_read_from_2(ptr); len = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
if (offset >= UNIV_PAGE_SIZE || len + offset > UNIV_PAGE_SIZE) {
if (offset >= srv_page_size || len + offset > srv_page_size) {
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
return(NULL); return(NULL);

26
storage/innobase/os/os0file.cc

@ -2301,23 +2301,23 @@ AIO::is_linux_native_aio_supported()
memset(&io_event, 0x0, sizeof(io_event)); memset(&io_event, 0x0, sizeof(io_event));
byte* buf = static_cast<byte*>(ut_malloc_nokey(UNIV_PAGE_SIZE * 2));
byte* ptr = static_cast<byte*>(ut_align(buf, UNIV_PAGE_SIZE));
byte* buf = static_cast<byte*>(ut_malloc_nokey(srv_page_size * 2));
byte* ptr = static_cast<byte*>(ut_align(buf, srv_page_size));
struct iocb iocb; struct iocb iocb;
/* Suppress valgrind warning. */ /* Suppress valgrind warning. */
memset(buf, 0x00, UNIV_PAGE_SIZE * 2);
memset(buf, 0x00, srv_page_size * 2);
memset(&iocb, 0x0, sizeof(iocb)); memset(&iocb, 0x0, sizeof(iocb));
struct iocb* p_iocb = &iocb; struct iocb* p_iocb = &iocb;
if (!srv_read_only_mode) { if (!srv_read_only_mode) {
io_prep_pwrite(p_iocb, fd, ptr, UNIV_PAGE_SIZE, 0);
io_prep_pwrite(p_iocb, fd, ptr, srv_page_size, 0);
} else { } else {
ut_a(UNIV_PAGE_SIZE >= 512);
ut_a(srv_page_size >= 512);
io_prep_pread(p_iocb, fd, ptr, 512, 0); io_prep_pread(p_iocb, fd, ptr, 512, 0);
} }
@ -5329,16 +5329,16 @@ fallback:
/* Write up to 1 megabyte at a time. */ /* Write up to 1 megabyte at a time. */
ulint buf_size = ut_min( ulint buf_size = ut_min(
static_cast<ulint>(64), static_cast<ulint>(64),
static_cast<ulint>(size / UNIV_PAGE_SIZE));
static_cast<ulint>(size / srv_page_size));
buf_size *= UNIV_PAGE_SIZE;
buf_size *= srv_page_size;
/* Align the buffer for possible raw i/o */ /* Align the buffer for possible raw i/o */
byte* buf2; byte* buf2;
buf2 = static_cast<byte*>(ut_malloc_nokey(buf_size + UNIV_PAGE_SIZE));
buf2 = static_cast<byte*>(ut_malloc_nokey(buf_size + srv_page_size));
byte* buf = static_cast<byte*>(ut_align(buf2, UNIV_PAGE_SIZE));
byte* buf = static_cast<byte*>(ut_align(buf2, srv_page_size));
/* Write buffer full of zeros */ /* Write buffer full of zeros */
memset(buf, 0, buf_size); memset(buf, 0, buf_size);
@ -5561,7 +5561,7 @@ os_is_sparse_file_supported(os_file_t fh)
/* We don't know the FS block size, use the sector size. The FS /* We don't know the FS block size, use the sector size. The FS
will do the magic. */ will do the magic. */
err = os_file_punch_hole_posix(fh, 0, UNIV_PAGE_SIZE);
err = os_file_punch_hole_posix(fh, 0, srv_page_size);
return(err == DB_SUCCESS); return(err == DB_SUCCESS);
#endif /* _WIN32 */ #endif /* _WIN32 */
@ -6172,7 +6172,7 @@ AIO::reserve_slot(
doing simulated AIO */ doing simulated AIO */
ulint local_seg; ulint local_seg;
local_seg = (offset >> (UNIV_PAGE_SIZE_SHIFT + 6)) % m_n_segments;
local_seg = (offset >> (srv_page_size_shift + 6)) % m_n_segments;
for (;;) { for (;;) {
@ -6853,10 +6853,10 @@ public:
} }
m_ptr = static_cast<byte*>( m_ptr = static_cast<byte*>(
ut_malloc_nokey(len + UNIV_PAGE_SIZE));
ut_malloc_nokey(len + srv_page_size));
m_buf = static_cast<byte*>( m_buf = static_cast<byte*>(
ut_align(m_ptr, UNIV_PAGE_SIZE));
ut_align(m_ptr, srv_page_size));
} else { } else {
len = first_slot()->len; len = first_slot()->len;

28
storage/innobase/page/page0cur.cc

@ -849,7 +849,7 @@ page_cur_insert_rec_write_log(
return; return;
} }
ut_a(rec_size < UNIV_PAGE_SIZE);
ut_a(rec_size < srv_page_size);
ut_ad(mtr->is_named_space(index->table->space)); ut_ad(mtr->is_named_space(index->table->space));
ut_ad(page_align(insert_rec) == page_align(cursor_rec)); ut_ad(page_align(insert_rec) == page_align(cursor_rec));
ut_ad(!page_rec_is_comp(insert_rec) ut_ad(!page_rec_is_comp(insert_rec)
@ -992,8 +992,8 @@ need_extra_info:
/* Write the mismatch index */ /* Write the mismatch index */
log_ptr += mach_write_compressed(log_ptr, i); log_ptr += mach_write_compressed(log_ptr, i);
ut_a(i < UNIV_PAGE_SIZE);
ut_a(extra_size < UNIV_PAGE_SIZE);
ut_a(i < srv_page_size);
ut_a(extra_size < srv_page_size);
} else { } else {
/* Write the record end segment length /* Write the record end segment length
and the extra info storage flag */ and the extra info storage flag */
@ -1010,7 +1010,7 @@ need_extra_info:
mlog_close(mtr, log_ptr + rec_size); mlog_close(mtr, log_ptr + rec_size);
} else { } else {
mlog_close(mtr, log_ptr); mlog_close(mtr, log_ptr);
ut_a(rec_size < UNIV_PAGE_SIZE);
ut_a(rec_size < srv_page_size);
mlog_catenate_string(mtr, ins_ptr, rec_size); mlog_catenate_string(mtr, ins_ptr, rec_size);
} }
} }
@ -1062,7 +1062,7 @@ page_cur_parse_insert_rec(
cursor_rec = page + offset; cursor_rec = page + offset;
if (offset >= UNIV_PAGE_SIZE) {
if (offset >= srv_page_size) {
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
@ -1077,7 +1077,7 @@ page_cur_parse_insert_rec(
return(NULL); return(NULL);
} }
if (end_seg_len >= UNIV_PAGE_SIZE << 1) {
if (end_seg_len >= srv_page_size << 1) {
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
return(NULL); return(NULL);
@ -1101,7 +1101,7 @@ page_cur_parse_insert_rec(
return(NULL); return(NULL);
} }
ut_a(origin_offset < UNIV_PAGE_SIZE);
ut_a(origin_offset < srv_page_size);
mismatch_index = mach_parse_compressed(&ptr, end_ptr); mismatch_index = mach_parse_compressed(&ptr, end_ptr);
@ -1110,7 +1110,7 @@ page_cur_parse_insert_rec(
return(NULL); return(NULL);
} }
ut_a(mismatch_index < UNIV_PAGE_SIZE);
ut_a(mismatch_index < srv_page_size);
} }
if (end_ptr < ptr + (end_seg_len >> 1)) { if (end_ptr < ptr + (end_seg_len >> 1)) {
@ -1152,7 +1152,7 @@ page_cur_parse_insert_rec(
/* Build the inserted record to buf */ /* Build the inserted record to buf */
if (UNIV_UNLIKELY(mismatch_index >= UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(mismatch_index >= srv_page_size)) {
ib::fatal() << "is_short " << is_short << ", " ib::fatal() << "is_short " << is_short << ", "
<< "info_and_status_bits " << info_and_status_bits << "info_and_status_bits " << info_and_status_bits
@ -2066,9 +2066,9 @@ page_copy_rec_list_end_to_created_page(
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/* To pass the debug tests we have to set these dummy values /* To pass the debug tests we have to set these dummy values
in the debug version */ in the debug version */
page_dir_set_n_slots(new_page, NULL, UNIV_PAGE_SIZE / 2);
page_dir_set_n_slots(new_page, NULL, srv_page_size / 2);
page_header_set_ptr(new_page, NULL, PAGE_HEAP_TOP, page_header_set_ptr(new_page, NULL, PAGE_HEAP_TOP,
new_page + UNIV_PAGE_SIZE - 1);
new_page + srv_page_size - 1);
#endif #endif
log_ptr = page_copy_rec_list_to_created_page_write_log(new_page, log_ptr = page_copy_rec_list_to_created_page_write_log(new_page,
index, mtr); index, mtr);
@ -2133,7 +2133,7 @@ page_copy_rec_list_end_to_created_page(
rec_size = rec_offs_size(offsets); rec_size = rec_offs_size(offsets);
ut_ad(heap_top < new_page + UNIV_PAGE_SIZE);
ut_ad(heap_top < new_page + srv_page_size);
heap_top += rec_size; heap_top += rec_size;
@ -2171,7 +2171,7 @@ page_copy_rec_list_end_to_created_page(
log_data_len = mtr->get_log()->size() - log_data_len; log_data_len = mtr->get_log()->size() - log_data_len;
ut_a(log_data_len < 100 * UNIV_PAGE_SIZE);
ut_a(log_data_len < 100 * srv_page_size);
if (log_ptr != NULL) { if (log_ptr != NULL) {
mach_write_to_4(log_ptr, log_data_len); mach_write_to_4(log_ptr, log_data_len);
@ -2255,7 +2255,7 @@ page_cur_parse_delete_rec(
offset = mach_read_from_2(ptr); offset = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
ut_a(offset <= UNIV_PAGE_SIZE);
ut_a(offset <= srv_page_size);
if (block) { if (block) {
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);

58
storage/innobase/page/page0page.cc

@ -99,13 +99,13 @@ page_dir_find_owner_slot(
while (rec_get_n_owned_new(r) == 0) { while (rec_get_n_owned_new(r) == 0) {
r = rec_get_next_ptr_const(r, TRUE); r = rec_get_next_ptr_const(r, TRUE);
ut_ad(r >= page + PAGE_NEW_SUPREMUM); ut_ad(r >= page + PAGE_NEW_SUPREMUM);
ut_ad(r < page + (UNIV_PAGE_SIZE - PAGE_DIR));
ut_ad(r < page + (srv_page_size - PAGE_DIR));
} }
} else { } else {
while (rec_get_n_owned_old(r) == 0) { while (rec_get_n_owned_old(r) == 0) {
r = rec_get_next_ptr_const(r, FALSE); r = rec_get_next_ptr_const(r, FALSE);
ut_ad(r >= page + PAGE_OLD_SUPREMUM); ut_ad(r >= page + PAGE_OLD_SUPREMUM);
ut_ad(r < page + (UNIV_PAGE_SIZE - PAGE_DIR));
ut_ad(r < page + (srv_page_size - PAGE_DIR));
} }
} }
@ -387,10 +387,10 @@ page_create_low(
sizeof infimum_supremum_compact); sizeof infimum_supremum_compact);
memset(page memset(page
+ PAGE_NEW_SUPREMUM_END, 0, + PAGE_NEW_SUPREMUM_END, 0,
UNIV_PAGE_SIZE - PAGE_DIR - PAGE_NEW_SUPREMUM_END);
page[UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE * 2 + 1]
srv_page_size - PAGE_DIR - PAGE_NEW_SUPREMUM_END);
page[srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE * 2 + 1]
= PAGE_NEW_SUPREMUM; = PAGE_NEW_SUPREMUM;
page[UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
page[srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
= PAGE_NEW_INFIMUM; = PAGE_NEW_INFIMUM;
} else { } else {
page[PAGE_HEADER + PAGE_N_HEAP + 1] = PAGE_HEAP_NO_USER_LOW; page[PAGE_HEADER + PAGE_N_HEAP + 1] = PAGE_HEAP_NO_USER_LOW;
@ -399,10 +399,10 @@ page_create_low(
sizeof infimum_supremum_redundant); sizeof infimum_supremum_redundant);
memset(page memset(page
+ PAGE_OLD_SUPREMUM_END, 0, + PAGE_OLD_SUPREMUM_END, 0,
UNIV_PAGE_SIZE - PAGE_DIR - PAGE_OLD_SUPREMUM_END);
page[UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE * 2 + 1]
srv_page_size - PAGE_DIR - PAGE_OLD_SUPREMUM_END);
page[srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE * 2 + 1]
= PAGE_OLD_SUPREMUM; = PAGE_OLD_SUPREMUM;
page[UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
page[srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
= PAGE_OLD_INFIMUM; = PAGE_OLD_INFIMUM;
} }
@ -594,7 +594,7 @@ page_copy_rec_list_end_no_locks(
btr_assert_not_corrupted(new_block, index); btr_assert_not_corrupted(new_block, index);
ut_a(page_is_comp(new_page) == page_rec_is_comp(rec)); ut_a(page_is_comp(new_page) == page_rec_is_comp(rec));
ut_a(mach_read_from_2(new_page + UNIV_PAGE_SIZE - 10) == (ulint)
ut_a(mach_read_from_2(new_page + srv_page_size - 10) == (ulint)
(page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM)); (page_is_comp(new_page) ? PAGE_NEW_INFIMUM : PAGE_OLD_INFIMUM));
const bool is_leaf = page_is_leaf(block->frame); const bool is_leaf = page_is_leaf(block->frame);
@ -1052,7 +1052,7 @@ page_delete_rec_list_end(
ulint* offsets = offsets_; ulint* offsets = offsets_;
rec_offs_init(offsets_); rec_offs_init(offsets_);
ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE);
ut_ad(size == ULINT_UNDEFINED || size < srv_page_size);
ut_ad(!page_zip || page_rec_is_comp(rec)); ut_ad(!page_zip || page_rec_is_comp(rec));
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index)); ut_a(!page_zip || page_zip_validate(page_zip, page, index));
@ -1159,8 +1159,8 @@ delete_all:
s = rec_offs_size(offsets); s = rec_offs_size(offsets);
ut_ad(ulint(rec2 - page) + s ut_ad(ulint(rec2 - page) + s
- rec_offs_extra_size(offsets) - rec_offs_extra_size(offsets)
< UNIV_PAGE_SIZE);
ut_ad(size + s < UNIV_PAGE_SIZE);
< srv_page_size);
ut_ad(size + s < srv_page_size);
size += s; size += s;
n_recs++; n_recs++;
@ -1177,7 +1177,7 @@ delete_all:
} }
} }
ut_ad(size < UNIV_PAGE_SIZE);
ut_ad(size < srv_page_size);
/* Update the page directory; there is no need to balance the number /* Update the page directory; there is no need to balance the number
of the records owned by the supremum record, as it is allowed to be of the records owned by the supremum record, as it is allowed to be
@ -1632,7 +1632,7 @@ page_rec_get_nth_const(
return(page_get_infimum_rec(page)); return(page_get_infimum_rec(page));
} }
ut_ad(nth < UNIV_PAGE_SIZE / (REC_N_NEW_EXTRA_BYTES + 1));
ut_ad(nth < srv_page_size / (REC_N_NEW_EXTRA_BYTES + 1));
for (i = 0;; i++) { for (i = 0;; i++) {
@ -1724,7 +1724,7 @@ page_rec_get_n_recs_before(
n--; n--;
ut_ad(n >= 0); ut_ad(n >= 0);
ut_ad((ulong) n < UNIV_PAGE_SIZE / (REC_N_NEW_EXTRA_BYTES + 1));
ut_ad((ulong) n < srv_page_size / (REC_N_NEW_EXTRA_BYTES + 1));
return((ulint) n); return((ulint) n);
} }
@ -2017,7 +2017,7 @@ page_simple_validate_old(
n_slots = page_dir_get_n_slots(page); n_slots = page_dir_get_n_slots(page);
if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) {
if (UNIV_UNLIKELY(n_slots > srv_page_size / 4)) {
ib::error() << "Nonsensical number " << n_slots ib::error() << "Nonsensical number " << n_slots
<< " of page dir slots"; << " of page dir slots";
@ -2093,7 +2093,7 @@ page_simple_validate_old(
if (UNIV_UNLIKELY if (UNIV_UNLIKELY
(rec_get_next_offs(rec, FALSE) < FIL_PAGE_DATA (rec_get_next_offs(rec, FALSE) < FIL_PAGE_DATA
|| rec_get_next_offs(rec, FALSE) >= UNIV_PAGE_SIZE)) {
|| rec_get_next_offs(rec, FALSE) >= srv_page_size)) {
ib::error() << "Next record offset nonsensical " ib::error() << "Next record offset nonsensical "
<< rec_get_next_offs(rec, FALSE) << " for rec " << rec_get_next_offs(rec, FALSE) << " for rec "
@ -2104,7 +2104,7 @@ page_simple_validate_old(
count++; count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page record list appears" ib::error() << "Page record list appears"
" to be circular " << count; " to be circular " << count;
goto func_exit; goto func_exit;
@ -2141,7 +2141,7 @@ page_simple_validate_old(
while (rec != NULL) { while (rec != NULL) {
if (UNIV_UNLIKELY(rec < page + FIL_PAGE_DATA if (UNIV_UNLIKELY(rec < page + FIL_PAGE_DATA
|| rec >= page + UNIV_PAGE_SIZE)) {
|| rec >= page + srv_page_size)) {
ib::error() << "Free list record has" ib::error() << "Free list record has"
" a nonsensical offset " << (rec - page); " a nonsensical offset " << (rec - page);
@ -2158,7 +2158,7 @@ page_simple_validate_old(
count++; count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page free list appears" ib::error() << "Page free list appears"
" to be circular " << count; " to be circular " << count;
goto func_exit; goto func_exit;
@ -2207,7 +2207,7 @@ page_simple_validate_new(
n_slots = page_dir_get_n_slots(page); n_slots = page_dir_get_n_slots(page);
if (UNIV_UNLIKELY(n_slots > UNIV_PAGE_SIZE / 4)) {
if (UNIV_UNLIKELY(n_slots > srv_page_size / 4)) {
ib::error() << "Nonsensical number " << n_slots ib::error() << "Nonsensical number " << n_slots
<< " of page dir slots"; << " of page dir slots";
@ -2284,7 +2284,7 @@ page_simple_validate_new(
if (UNIV_UNLIKELY if (UNIV_UNLIKELY
(rec_get_next_offs(rec, TRUE) < FIL_PAGE_DATA (rec_get_next_offs(rec, TRUE) < FIL_PAGE_DATA
|| rec_get_next_offs(rec, TRUE) >= UNIV_PAGE_SIZE)) {
|| rec_get_next_offs(rec, TRUE) >= srv_page_size)) {
ib::error() << "Next record offset nonsensical " ib::error() << "Next record offset nonsensical "
<< rec_get_next_offs(rec, TRUE) << rec_get_next_offs(rec, TRUE)
@ -2295,7 +2295,7 @@ page_simple_validate_new(
count++; count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page record list appears to be" ib::error() << "Page record list appears to be"
" circular " << count; " circular " << count;
goto func_exit; goto func_exit;
@ -2332,7 +2332,7 @@ page_simple_validate_new(
while (rec != NULL) { while (rec != NULL) {
if (UNIV_UNLIKELY(rec < page + FIL_PAGE_DATA if (UNIV_UNLIKELY(rec < page + FIL_PAGE_DATA
|| rec >= page + UNIV_PAGE_SIZE)) {
|| rec >= page + srv_page_size)) {
ib::error() << "Free list record has" ib::error() << "Free list record has"
" a nonsensical offset " << page_offset(rec); " a nonsensical offset " << page_offset(rec);
@ -2350,7 +2350,7 @@ page_simple_validate_new(
count++; count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page free list appears to be" ib::error() << "Page free list appears to be"
" circular " << count; " circular " << count;
goto func_exit; goto func_exit;
@ -2440,12 +2440,12 @@ page_validate(
ut_ad(srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN); ut_ad(srv_force_recovery >= SRV_FORCE_NO_UNDO_LOG_SCAN);
} }
heap = mem_heap_create(UNIV_PAGE_SIZE + 200);
heap = mem_heap_create(srv_page_size + 200);
/* The following buffer is used to check that the /* The following buffer is used to check that the
records in the page record heap do not overlap */ records in the page record heap do not overlap */
buf = static_cast<byte*>(mem_heap_zalloc(heap, UNIV_PAGE_SIZE));
buf = static_cast<byte*>(mem_heap_zalloc(heap, srv_page_size));
/* Check first that the record heap and the directory do not /* Check first that the record heap and the directory do not
overlap. */ overlap. */
@ -2548,7 +2548,7 @@ page_validate(
offs = page_offset(rec_get_start(rec, offsets)); offs = page_offset(rec_get_start(rec, offsets));
i = rec_offs_size(offsets); i = rec_offs_size(offsets);
if (UNIV_UNLIKELY(offs + i >= UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(offs + i >= srv_page_size)) {
ib::error() << "Record offset out of bounds"; ib::error() << "Record offset out of bounds";
goto func_exit; goto func_exit;
} }
@ -2656,7 +2656,7 @@ n_owned_zero:
count++; count++;
offs = page_offset(rec_get_start(rec, offsets)); offs = page_offset(rec_get_start(rec, offsets));
i = rec_offs_size(offsets); i = rec_offs_size(offsets);
if (UNIV_UNLIKELY(offs + i >= UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(offs + i >= srv_page_size)) {
ib::error() << "Record offset out of bounds"; ib::error() << "Record offset out of bounds";
goto func_exit; goto func_exit;
} }

82
storage/innobase/page/page0zip.cc

@ -695,7 +695,7 @@ page_zip_dir_encode(
heap_no = rec_get_heap_no_new(rec); heap_no = rec_get_heap_no_new(rec);
ut_a(heap_no >= PAGE_HEAP_NO_USER_LOW); ut_a(heap_no >= PAGE_HEAP_NO_USER_LOW);
ut_a(heap_no < n_heap); ut_a(heap_no < n_heap);
ut_a(offs < UNIV_PAGE_SIZE - PAGE_DIR);
ut_a(offs < srv_page_size - PAGE_DIR);
ut_a(offs >= PAGE_ZIP_START); ut_a(offs >= PAGE_ZIP_START);
#if PAGE_ZIP_DIR_SLOT_MASK & (PAGE_ZIP_DIR_SLOT_MASK + 1) #if PAGE_ZIP_DIR_SLOT_MASK & (PAGE_ZIP_DIR_SLOT_MASK + 1)
# error PAGE_ZIP_DIR_SLOT_MASK is not 1 less than a power of 2 # error PAGE_ZIP_DIR_SLOT_MASK is not 1 less than a power of 2
@ -1296,7 +1296,7 @@ page_zip_compress(
&& dict_table_is_comp(index->table) && dict_table_is_comp(index->table)
&& !dict_index_is_ibuf(index))); && !dict_index_is_ibuf(index)));
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(page, srv_page_size);
/* Check the data that will be omitted. */ /* Check the data that will be omitted. */
ut_a(!memcmp(page + (PAGE_NEW_INFIMUM - REC_N_NEW_EXTRA_BYTES), ut_a(!memcmp(page + (PAGE_NEW_INFIMUM - REC_N_NEW_EXTRA_BYTES),
@ -1347,8 +1347,8 @@ page_zip_compress(
if (logfile) { if (logfile) {
/* Write the uncompressed page to the log. */ /* Write the uncompressed page to the log. */
if (fwrite(page, 1, UNIV_PAGE_SIZE, logfile)
!= UNIV_PAGE_SIZE) {
if (fwrite(page, 1, srv_page_size, logfile)
!= srv_page_size) {
perror("fwrite"); perror("fwrite");
} }
/* Record the compressed size as zero. /* Record the compressed size as zero.
@ -1407,7 +1407,7 @@ page_zip_compress(
+ REC_OFFS_HEADER_SIZE + REC_OFFS_HEADER_SIZE
+ n_dense * ((sizeof *recs) + n_dense * ((sizeof *recs)
- PAGE_ZIP_DIR_SLOT_SIZE) - PAGE_ZIP_DIR_SLOT_SIZE)
+ UNIV_PAGE_SIZE * 4
+ srv_page_size * 4
+ (512 << MAX_MEM_LEVEL)); + (512 << MAX_MEM_LEVEL));
recs = static_cast<const rec_t**>( recs = static_cast<const rec_t**>(
@ -1424,7 +1424,7 @@ page_zip_compress(
page_zip_set_alloc(&c_stream, heap); page_zip_set_alloc(&c_stream, heap);
err = deflateInit2(&c_stream, static_cast<int>(level), err = deflateInit2(&c_stream, static_cast<int>(level),
Z_DEFLATED, UNIV_PAGE_SIZE_SHIFT,
Z_DEFLATED, srv_page_size_shift,
MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY);
ut_a(err == Z_OK); ut_a(err == Z_OK);
@ -1545,7 +1545,7 @@ page_zip_compress(
c_stream.avail_in = static_cast<uInt>( c_stream.avail_in = static_cast<uInt>(
page_header_get_field(page, PAGE_HEAP_TOP) page_header_get_field(page, PAGE_HEAP_TOP)
- (c_stream.next_in - page)); - (c_stream.next_in - page));
ut_a(c_stream.avail_in <= UNIV_PAGE_SIZE - PAGE_ZIP_START - PAGE_DIR);
ut_a(c_stream.avail_in <= srv_page_size - PAGE_ZIP_START - PAGE_DIR);
UNIV_MEM_ASSERT_RW(c_stream.next_in, c_stream.avail_in); UNIV_MEM_ASSERT_RW(c_stream.next_in, c_stream.avail_in);
err = deflate(&c_stream, Z_FINISH); err = deflate(&c_stream, Z_FINISH);
@ -1623,7 +1623,7 @@ err_exit:
/* Record the compressed size of the block. */ /* Record the compressed size of the block. */
byte sz[4]; byte sz[4];
mach_write_to_4(sz, c_stream.total_out); mach_write_to_4(sz, c_stream.total_out);
fseek(logfile, UNIV_PAGE_SIZE, SEEK_SET);
fseek(logfile, srv_page_size, SEEK_SET);
if (fwrite(sz, 1, sizeof sz, logfile) != sizeof sz) { if (fwrite(sz, 1, sizeof sz, logfile) != sizeof sz) {
perror("fwrite"); perror("fwrite");
} }
@ -1820,7 +1820,7 @@ page_zip_dir_decode(
/* Traverse the list of stored records in the sorting order, /* Traverse the list of stored records in the sorting order,
starting from the first user record. */ starting from the first user record. */
slot = page + (UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE);
slot = page + (srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE);
UNIV_PREFETCH_RW(slot); UNIV_PREFETCH_RW(slot);
/* Zero out the page trailer. */ /* Zero out the page trailer. */
@ -2326,7 +2326,7 @@ page_zip_decompress_node_ptrs(
d_stream->avail_out = static_cast<uInt>( d_stream->avail_out = static_cast<uInt>(
rec - REC_N_NEW_EXTRA_BYTES - d_stream->next_out); rec - REC_N_NEW_EXTRA_BYTES - d_stream->next_out);
ut_ad(d_stream->avail_out < UNIV_PAGE_SIZE
ut_ad(d_stream->avail_out < srv_page_size
- PAGE_ZIP_START - PAGE_DIR); - PAGE_ZIP_START - PAGE_DIR);
switch (inflate(d_stream, Z_SYNC_FLUSH)) { switch (inflate(d_stream, Z_SYNC_FLUSH)) {
case Z_STREAM_END: case Z_STREAM_END:
@ -2393,7 +2393,7 @@ page_zip_decompress_node_ptrs(
d_stream->avail_out = static_cast<uInt>( d_stream->avail_out = static_cast<uInt>(
page_header_get_field(page_zip->data, PAGE_HEAP_TOP) page_header_get_field(page_zip->data, PAGE_HEAP_TOP)
- page_offset(d_stream->next_out)); - page_offset(d_stream->next_out));
if (UNIV_UNLIKELY(d_stream->avail_out > UNIV_PAGE_SIZE
if (UNIV_UNLIKELY(d_stream->avail_out > srv_page_size
- PAGE_ZIP_START - PAGE_DIR)) { - PAGE_ZIP_START - PAGE_DIR)) {
page_zip_fail(("page_zip_decompress_node_ptrs:" page_zip_fail(("page_zip_decompress_node_ptrs:"
@ -2548,7 +2548,7 @@ page_zip_decompress_sec(
d_stream->avail_out = static_cast<uInt>( d_stream->avail_out = static_cast<uInt>(
page_header_get_field(page_zip->data, PAGE_HEAP_TOP) page_header_get_field(page_zip->data, PAGE_HEAP_TOP)
- page_offset(d_stream->next_out)); - page_offset(d_stream->next_out));
if (UNIV_UNLIKELY(d_stream->avail_out > UNIV_PAGE_SIZE
if (UNIV_UNLIKELY(d_stream->avail_out > srv_page_size
- PAGE_ZIP_START - PAGE_DIR)) { - PAGE_ZIP_START - PAGE_DIR)) {
page_zip_fail(("page_zip_decompress_sec:" page_zip_fail(("page_zip_decompress_sec:"
@ -2768,7 +2768,7 @@ page_zip_decompress_clust(
d_stream->avail_out =static_cast<uInt>( d_stream->avail_out =static_cast<uInt>(
rec - REC_N_NEW_EXTRA_BYTES - d_stream->next_out); rec - REC_N_NEW_EXTRA_BYTES - d_stream->next_out);
ut_ad(d_stream->avail_out < UNIV_PAGE_SIZE
ut_ad(d_stream->avail_out < srv_page_size
- PAGE_ZIP_START - PAGE_DIR); - PAGE_ZIP_START - PAGE_DIR);
err = inflate(d_stream, Z_SYNC_FLUSH); err = inflate(d_stream, Z_SYNC_FLUSH);
switch (err) { switch (err) {
@ -2878,7 +2878,7 @@ page_zip_decompress_clust(
d_stream->avail_out = static_cast<uInt>( d_stream->avail_out = static_cast<uInt>(
page_header_get_field(page_zip->data, PAGE_HEAP_TOP) page_header_get_field(page_zip->data, PAGE_HEAP_TOP)
- page_offset(d_stream->next_out)); - page_offset(d_stream->next_out));
if (UNIV_UNLIKELY(d_stream->avail_out > UNIV_PAGE_SIZE
if (UNIV_UNLIKELY(d_stream->avail_out > srv_page_size
- PAGE_ZIP_START - PAGE_DIR)) { - PAGE_ZIP_START - PAGE_DIR)) {
page_zip_fail(("page_zip_decompress_clust:" page_zip_fail(("page_zip_decompress_clust:"
@ -3052,7 +3052,7 @@ page_zip_decompress_low(
ulint* offsets; ulint* offsets;
ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_simple_validate(page_zip));
UNIV_MEM_ASSERT_W(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_W(page, srv_page_size);
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
/* The dense directory excludes the infimum and supremum records. */ /* The dense directory excludes the infimum and supremum records. */
@ -3065,7 +3065,7 @@ page_zip_decompress_low(
return(FALSE); return(FALSE);
} }
heap = mem_heap_create(n_dense * (3 * sizeof *recs) + UNIV_PAGE_SIZE);
heap = mem_heap_create(n_dense * (3 * sizeof *recs) + srv_page_size);
recs = static_cast<rec_t**>( recs = static_cast<rec_t**>(
mem_heap_alloc(heap, n_dense * sizeof *recs)); mem_heap_alloc(heap, n_dense * sizeof *recs));
@ -3097,9 +3097,9 @@ page_zip_decompress_low(
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
/* Clear the uncompressed page, except the header. */ /* Clear the uncompressed page, except the header. */
memset(PAGE_DATA + page, 0x55, UNIV_PAGE_SIZE - PAGE_DATA);
memset(PAGE_DATA + page, 0x55, srv_page_size - PAGE_DATA);
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
UNIV_MEM_INVALID(PAGE_DATA + page, UNIV_PAGE_SIZE - PAGE_DATA);
UNIV_MEM_INVALID(PAGE_DATA + page, srv_page_size - PAGE_DATA);
/* Copy the page directory. */ /* Copy the page directory. */
if (UNIV_UNLIKELY(!page_zip_dir_decode(page_zip, page, recs, if (UNIV_UNLIKELY(!page_zip_dir_decode(page_zip, page, recs,
@ -3132,9 +3132,9 @@ zlib_error:
d_stream.avail_in = static_cast<uInt>( d_stream.avail_in = static_cast<uInt>(
page_zip_get_size(page_zip) - (PAGE_DATA + 1)); page_zip_get_size(page_zip) - (PAGE_DATA + 1));
d_stream.next_out = page + PAGE_ZIP_START; d_stream.next_out = page + PAGE_ZIP_START;
d_stream.avail_out = uInt(UNIV_PAGE_SIZE - PAGE_ZIP_START);
d_stream.avail_out = uInt(srv_page_size - PAGE_ZIP_START);
if (UNIV_UNLIKELY(inflateInit2(&d_stream, UNIV_PAGE_SIZE_SHIFT)
if (UNIV_UNLIKELY(inflateInit2(&d_stream, srv_page_size_shift)
!= Z_OK)) { != Z_OK)) {
ut_error; ut_error;
} }
@ -3229,7 +3229,7 @@ err_exit:
} }
ut_a(page_is_comp(page)); ut_a(page_is_comp(page));
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(page, srv_page_size);
page_zip_fields_free(index); page_zip_fields_free(index);
mem_heap_free(heap); mem_heap_free(heap);
@ -3345,7 +3345,7 @@ page_zip_validate_low(
page_zip_fail(("page_zip_validate: page header\n")); page_zip_fail(("page_zip_validate: page header\n"));
page_zip_hexdump(page_zip, sizeof *page_zip); page_zip_hexdump(page_zip, sizeof *page_zip);
page_zip_hexdump(page_zip->data, page_zip_get_size(page_zip)); page_zip_hexdump(page_zip->data, page_zip_get_size(page_zip));
page_zip_hexdump(page, UNIV_PAGE_SIZE);
page_zip_hexdump(page, srv_page_size);
return(FALSE); return(FALSE);
} }
@ -3356,11 +3356,11 @@ page_zip_validate_low(
} }
/* page_zip_decompress() expects the uncompressed page to be /* page_zip_decompress() expects the uncompressed page to be
UNIV_PAGE_SIZE aligned. */
temp_page_buf = static_cast<byte*>(ut_malloc_nokey(2 * UNIV_PAGE_SIZE));
temp_page = static_cast<byte*>(ut_align(temp_page_buf, UNIV_PAGE_SIZE));
srv_page_size aligned. */
temp_page_buf = static_cast<byte*>(ut_malloc_nokey(2 * srv_page_size));
temp_page = static_cast<byte*>(ut_align(temp_page_buf, srv_page_size));
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(page, srv_page_size);
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
temp_page_zip = *page_zip; temp_page_zip = *page_zip;
@ -3393,7 +3393,7 @@ page_zip_validate_low(
valid = FALSE; valid = FALSE;
} }
if (memcmp(page + PAGE_HEADER, temp_page + PAGE_HEADER, if (memcmp(page + PAGE_HEADER, temp_page + PAGE_HEADER,
UNIV_PAGE_SIZE - PAGE_HEADER - FIL_PAGE_DATA_END)) {
srv_page_size - PAGE_HEADER - FIL_PAGE_DATA_END)) {
/* In crash recovery, the "minimum record" flag may be /* In crash recovery, the "minimum record" flag may be
set incorrectly until the mini-transaction is set incorrectly until the mini-transaction is
@ -3417,7 +3417,7 @@ page_zip_validate_low(
if (!memcmp(page + PAGE_HEADER, if (!memcmp(page + PAGE_HEADER,
temp_page + PAGE_HEADER, temp_page + PAGE_HEADER,
UNIV_PAGE_SIZE - PAGE_HEADER
srv_page_size - PAGE_HEADER
- FIL_PAGE_DATA_END)) { - FIL_PAGE_DATA_END)) {
/* Only the minimum record flag /* Only the minimum record flag
@ -3511,8 +3511,8 @@ func_exit:
if (!valid) { if (!valid) {
page_zip_hexdump(page_zip, sizeof *page_zip); page_zip_hexdump(page_zip, sizeof *page_zip);
page_zip_hexdump(page_zip->data, page_zip_get_size(page_zip)); page_zip_hexdump(page_zip->data, page_zip_get_size(page_zip));
page_zip_hexdump(page, UNIV_PAGE_SIZE);
page_zip_hexdump(temp_page, UNIV_PAGE_SIZE);
page_zip_hexdump(page, srv_page_size);
page_zip_hexdump(temp_page, srv_page_size);
} }
ut_free(temp_page_buf); ut_free(temp_page_buf);
return(valid); return(valid);
@ -3728,7 +3728,7 @@ page_zip_write_rec(
} }
ut_ad(rec_get_start((rec_t*) rec, offsets) >= page + PAGE_ZIP_START); ut_ad(rec_get_start((rec_t*) rec, offsets) >= page + PAGE_ZIP_START);
ut_ad(rec_get_end((rec_t*) rec, offsets) <= page + UNIV_PAGE_SIZE
ut_ad(rec_get_end((rec_t*) rec, offsets) <= page + srv_page_size
- PAGE_DIR - PAGE_DIR_SLOT_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE
* page_dir_get_n_slots(page)); * page_dir_get_n_slots(page));
@ -3894,8 +3894,8 @@ page_zip_parse_write_blob_ptr(
z_offset = mach_read_from_2(ptr + 2); z_offset = mach_read_from_2(ptr + 2);
if (offset < PAGE_ZIP_START if (offset < PAGE_ZIP_START
|| offset >= UNIV_PAGE_SIZE
|| z_offset >= UNIV_PAGE_SIZE) {
|| offset >= srv_page_size
|| z_offset >= srv_page_size) {
corrupt: corrupt:
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
@ -4036,8 +4036,8 @@ page_zip_parse_write_node_ptr(
z_offset = mach_read_from_2(ptr + 2); z_offset = mach_read_from_2(ptr + 2);
if (offset < PAGE_ZIP_START if (offset < PAGE_ZIP_START
|| offset >= UNIV_PAGE_SIZE
|| z_offset >= UNIV_PAGE_SIZE) {
|| offset >= srv_page_size
|| z_offset >= srv_page_size) {
corrupt: corrupt:
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
@ -4259,8 +4259,8 @@ page_zip_parse_write_trx_id(
uint z_offset = mach_read_from_2(ptr + 2); uint z_offset = mach_read_from_2(ptr + 2);
if (offset < PAGE_ZIP_START if (offset < PAGE_ZIP_START
|| offset >= UNIV_PAGE_SIZE
|| z_offset >= UNIV_PAGE_SIZE) {
|| offset >= srv_page_size
|| z_offset >= srv_page_size) {
corrupt: corrupt:
recv_sys->found_corrupt_log = TRUE; recv_sys->found_corrupt_log = TRUE;
@ -4778,7 +4778,7 @@ page_zip_reorganize(
ut_ad(!dict_index_is_ibuf(index)); ut_ad(!dict_index_is_ibuf(index));
ut_ad(!dict_table_is_temporary(index->table)); ut_ad(!dict_table_is_temporary(index->table));
/* Note that page_zip_validate(page_zip, page, index) may fail here. */ /* Note that page_zip_validate(page_zip, page, index) may fail here. */
UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(page, srv_page_size);
UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip));
/* Disable logging */ /* Disable logging */
@ -4866,9 +4866,9 @@ page_zip_copy_recs(
ut_a(dict_index_is_clust(index)); ut_a(dict_index_is_clust(index));
} }
UNIV_MEM_ASSERT_W(page, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_W(page, srv_page_size);
UNIV_MEM_ASSERT_W(page_zip->data, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_W(page_zip->data, page_zip_get_size(page_zip));
UNIV_MEM_ASSERT_RW(src, UNIV_PAGE_SIZE);
UNIV_MEM_ASSERT_RW(src, srv_page_size);
UNIV_MEM_ASSERT_RW(src_zip->data, page_zip_get_size(page_zip)); UNIV_MEM_ASSERT_RW(src_zip->data, page_zip_get_size(page_zip));
/* Copy those B-tree page header fields that are related to /* Copy those B-tree page header fields that are related to
@ -4881,7 +4881,7 @@ page_zip_copy_recs(
memcpy(PAGE_HEADER + page, PAGE_HEADER + src, memcpy(PAGE_HEADER + page, PAGE_HEADER + src,
PAGE_HEADER_PRIV_END); PAGE_HEADER_PRIV_END);
memcpy(PAGE_DATA + page, PAGE_DATA + src, memcpy(PAGE_DATA + page, PAGE_DATA + src,
UNIV_PAGE_SIZE - PAGE_DATA - FIL_PAGE_DATA_END);
srv_page_size - PAGE_DATA - FIL_PAGE_DATA_END);
memcpy(PAGE_HEADER + page_zip->data, PAGE_HEADER + src_zip->data, memcpy(PAGE_HEADER + page_zip->data, PAGE_HEADER + src_zip->data,
PAGE_HEADER_PRIV_END); PAGE_HEADER_PRIV_END);
memcpy(PAGE_DATA + page_zip->data, PAGE_DATA + src_zip->data, memcpy(PAGE_DATA + page_zip->data, PAGE_DATA + src_zip->data,

6
storage/innobase/rem/rem0rec.cc

@ -1048,7 +1048,7 @@ rec_get_nth_field_offs_old(
*len = next_os - os; *len = next_os - os;
ut_ad(*len < UNIV_PAGE_SIZE);
ut_ad(*len < srv_page_size);
return(os); return(os);
} }
@ -1985,7 +1985,7 @@ rec_validate_old(
for (i = 0; i < n_fields; i++) { for (i = 0; i < n_fields; i++) {
rec_get_nth_field_offs_old(rec, i, &len); rec_get_nth_field_offs_old(rec, i, &len);
if (!((len < UNIV_PAGE_SIZE) || (len == UNIV_SQL_NULL))) {
if (!((len < srv_page_size) || (len == UNIV_SQL_NULL))) {
ib::error() << "Record field " << i << " len " << len; ib::error() << "Record field " << i << " len " << len;
return(FALSE); return(FALSE);
} }
@ -2036,7 +2036,7 @@ rec_validate(
switch (len) { switch (len) {
default: default:
if (len >= UNIV_PAGE_SIZE) {
if (len >= srv_page_size) {
ib::error() << "Record field " << i ib::error() << "Record field " << i
<< " len " << len; << " len " << len;
return(FALSE); return(FALSE);

26
storage/innobase/row/row0import.cc

@ -404,7 +404,7 @@ public:
Called for every page in the tablespace. If the page was not Called for every page in the tablespace. If the page was not
updated then its state must be set to BUF_PAGE_NOT_USED. For updated then its state must be set to BUF_PAGE_NOT_USED. For
compressed tables the page descriptor memory will be at offset: compressed tables the page descriptor memory will be at offset:
block->frame + UNIV_PAGE_SIZE;
block->frame + srv_page_size;
@param offset - physical offset within the file @param offset - physical offset within the file
@param block - block read from file, note it is not from the buffer pool @param block - block read from file, note it is not from the buffer pool
@retval DB_SUCCESS or error code. */ @retval DB_SUCCESS or error code. */
@ -573,7 +573,7 @@ AbstractCallback::init(
ib::error() << "Page size " << m_page_size.physical() ib::error() << "Page size " << m_page_size.physical()
<< " of ibd file is not the same as the server page" << " of ibd file is not the same as the server page"
" size " << univ_page_size.physical();
" size " << srv_page_size;
return(DB_CORRUPTION); return(DB_CORRUPTION);
@ -2919,14 +2919,14 @@ row_import_read_v1(
const ulint logical_page_size = mach_read_from_4(ptr); const ulint logical_page_size = mach_read_from_4(ptr);
ptr += sizeof(ib_uint32_t); ptr += sizeof(ib_uint32_t);
if (logical_page_size != univ_page_size.logical()) {
if (logical_page_size != srv_page_size) {
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH, ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
"Tablespace to be imported has a different" "Tablespace to be imported has a different"
" page size than this server. Server page size" " page size than this server. Server page size"
" is " ULINTPF ", whereas tablespace page size"
" is %lu, whereas tablespace page size"
" is " ULINTPF, " is " ULINTPF,
univ_page_size.logical(),
srv_page_size,
logical_page_size); logical_page_size);
return(DB_ERROR); return(DB_ERROR);
@ -3598,8 +3598,8 @@ fil_tablespace_iterate(
We allocate an extra page in case it is a compressed table. One We allocate an extra page in case it is a compressed table. One
page is to ensure alignement. */ page is to ensure alignement. */
void* page_ptr = ut_malloc_nokey(3 * UNIV_PAGE_SIZE);
byte* page = static_cast<byte*>(ut_align(page_ptr, UNIV_PAGE_SIZE));
void* page_ptr = ut_malloc_nokey(3 * srv_page_size);
byte* page = static_cast<byte*>(ut_align(page_ptr, srv_page_size));
buf_block_t* block = reinterpret_cast<buf_block_t*> buf_block_t* block = reinterpret_cast<buf_block_t*>
(ut_zalloc_nokey(sizeof *block)); (ut_zalloc_nokey(sizeof *block));
@ -3615,7 +3615,7 @@ fil_tablespace_iterate(
request.disable_partial_io_warnings(); request.disable_partial_io_warnings();
err = os_file_read_no_error_handling(request, file, page, 0, err = os_file_read_no_error_handling(request, file, page, 0,
UNIV_PAGE_SIZE, 0);
srv_page_size, 0);
if (err == DB_SUCCESS) { if (err == DB_SUCCESS) {
err = callback.init(file_size, block); err = callback.init(file_size, block);
@ -3655,23 +3655,23 @@ fil_tablespace_iterate(
/* Add an extra page for compressed page scratch area. */ /* Add an extra page for compressed page scratch area. */
void* io_buffer = ut_malloc_nokey( void* io_buffer = ut_malloc_nokey(
(2 + iter.n_io_buffers) * UNIV_PAGE_SIZE);
(2 + iter.n_io_buffers) * srv_page_size);
iter.io_buffer = static_cast<byte*>( iter.io_buffer = static_cast<byte*>(
ut_align(io_buffer, UNIV_PAGE_SIZE));
ut_align(io_buffer, srv_page_size));
void* crypt_io_buffer = NULL; void* crypt_io_buffer = NULL;
if (iter.crypt_data) { if (iter.crypt_data) {
crypt_io_buffer = ut_malloc_nokey( crypt_io_buffer = ut_malloc_nokey(
(2 + iter.n_io_buffers) * UNIV_PAGE_SIZE);
(2 + iter.n_io_buffers) * srv_page_size);
iter.crypt_io_buffer = static_cast<byte*>( iter.crypt_io_buffer = static_cast<byte*>(
ut_align(crypt_io_buffer, UNIV_PAGE_SIZE));
ut_align(crypt_io_buffer, srv_page_size));
} }
if (block->page.zip.ssize) { if (block->page.zip.ssize) {
ut_ad(iter.n_io_buffers == 1); ut_ad(iter.n_io_buffers == 1);
block->frame = iter.io_buffer; block->frame = iter.io_buffer;
block->page.zip.data = block->frame + UNIV_PAGE_SIZE;
block->page.zip.data = block->frame + srv_page_size;
} }
err = fil_iterate(iter, block, callback); err = fil_iterate(iter, block, callback);

10
storage/innobase/row/row0log.cc

@ -2706,7 +2706,7 @@ row_log_progress_inc_per_block()
(usually 1MiB). */ (usually 1MiB). */
const ulint pages_per_block = std::max( const ulint pages_per_block = std::max(
static_cast<unsigned long>( static_cast<unsigned long>(
srv_sort_buf_size / univ_page_size.physical()),
srv_sort_buf_size / srv_page_size),
1UL); 1UL);
/* Multiply by an artificial factor of 6 to even the pace with /* Multiply by an artificial factor of 6 to even the pace with
@ -2796,8 +2796,8 @@ row_log_table_apply_ops(
offsets[0] = i; offsets[0] = i;
offsets[1] = dict_index_get_n_fields(index); offsets[1] = dict_index_get_n_fields(index);
heap = mem_heap_create(UNIV_PAGE_SIZE);
offsets_heap = mem_heap_create(UNIV_PAGE_SIZE);
heap = mem_heap_create(srv_page_size);
offsets_heap = mem_heap_create(srv_page_size);
has_index_lock = true; has_index_lock = true;
next_block: next_block:
@ -3674,8 +3674,8 @@ row_log_apply_ops(
offsets[0] = i; offsets[0] = i;
offsets[1] = dict_index_get_n_fields(index); offsets[1] = dict_index_get_n_fields(index);
offsets_heap = mem_heap_create(UNIV_PAGE_SIZE);
heap = mem_heap_create(UNIV_PAGE_SIZE);
offsets_heap = mem_heap_create(srv_page_size);
heap = mem_heap_create(srv_page_size);
has_index_lock = true; has_index_lock = true;
next_block: next_block:

4
storage/innobase/row/row0merge.cc

@ -819,9 +819,9 @@ row_merge_buf_add(
/* Record size can exceed page size while converting to /* Record size can exceed page size while converting to
redundant row format. But there is assert redundant row format. But there is assert
ut_ad(size < UNIV_PAGE_SIZE) in rec_offs_data_size().
ut_ad(size < srv_page_size) in rec_offs_data_size().
It may hit the assert before attempting to insert the row. */ It may hit the assert before attempting to insert the row. */
if (conv_heap != NULL && data_size > UNIV_PAGE_SIZE) {
if (conv_heap != NULL && data_size > srv_page_size) {
*err = DB_TOO_BIG_RECORD; *err = DB_TOO_BIG_RECORD;
} }

3
storage/innobase/row/row0mysql.cc

@ -4802,7 +4802,8 @@ row_scan_index_for_mysql(
return(DB_SUCCESS); return(DB_SUCCESS);
} }
ulint bufsize = ut_max(UNIV_PAGE_SIZE, prebuilt->mysql_row_len);
ulint bufsize = std::max<ulint>(srv_page_size,
prebuilt->mysql_row_len);
buf = static_cast<byte*>(ut_malloc_nokey(bufsize)); buf = static_cast<byte*>(ut_malloc_nokey(bufsize));
heap = mem_heap_create(100); heap = mem_heap_create(100);

2
storage/innobase/row/row0purge.cc

@ -811,7 +811,7 @@ skip_secondaries:
(dfield_get_data(&ufield->new_val)) (dfield_get_data(&ufield->new_val))
- undo_rec); - undo_rec);
ut_a(internal_offset < UNIV_PAGE_SIZE);
ut_a(internal_offset < srv_page_size);
trx_undo_decode_roll_ptr(node->roll_ptr, trx_undo_decode_roll_ptr(node->roll_ptr,
&is_insert, &rseg_id, &is_insert, &rseg_id,

2
storage/innobase/row/row0quiesce.cc

@ -394,7 +394,7 @@ row_quiesce_write_header(
byte* ptr = row; byte* ptr = row;
/* Write the system page size. */ /* Write the system page size. */
mach_write_to_4(ptr, UNIV_PAGE_SIZE);
mach_write_to_4(ptr, srv_page_size);
ptr += sizeof(ib_uint32_t); ptr += sizeof(ib_uint32_t);
/* Write the table->flags. */ /* Write the table->flags. */

13
storage/innobase/row/row0sel.cc

@ -2954,12 +2954,12 @@ row_sel_store_mysql_field_func(
if (DATA_LARGE_MTYPE(templ->type)) { if (DATA_LARGE_MTYPE(templ->type)) {
if (prebuilt->blob_heap == NULL) { if (prebuilt->blob_heap == NULL) {
prebuilt->blob_heap = mem_heap_create( prebuilt->blob_heap = mem_heap_create(
UNIV_PAGE_SIZE);
srv_page_size);
} }
heap = prebuilt->blob_heap; heap = prebuilt->blob_heap;
} else { } else {
heap = mem_heap_create(UNIV_PAGE_SIZE);
heap = mem_heap_create(srv_page_size);
} }
/* NOTE: if we are retrieving a big BLOB, we may /* NOTE: if we are retrieving a big BLOB, we may
@ -3042,7 +3042,7 @@ row_sel_store_mysql_field_func(
if (prebuilt->blob_heap == NULL) { if (prebuilt->blob_heap == NULL) {
prebuilt->blob_heap = mem_heap_create( prebuilt->blob_heap = mem_heap_create(
UNIV_PAGE_SIZE);
srv_page_size);
DBUG_PRINT("anna", ("blob_heap allocated: %p", DBUG_PRINT("anna", ("blob_heap allocated: %p",
prebuilt->blob_heap)); prebuilt->blob_heap));
} }
@ -4375,7 +4375,7 @@ row_search_mvcc(
&& dict_index_is_clust(index) && dict_index_is_clust(index)
&& !prebuilt->templ_contains_blob && !prebuilt->templ_contains_blob
&& !prebuilt->used_in_HANDLER && !prebuilt->used_in_HANDLER
&& (prebuilt->mysql_row_len < UNIV_PAGE_SIZE / 8)) {
&& (prebuilt->mysql_row_len < srv_page_size / 8)) {
mode = PAGE_CUR_GE; mode = PAGE_CUR_GE;
@ -4772,7 +4772,7 @@ rec_loop:
} }
} }
if (UNIV_UNLIKELY(next_offs >= UNIV_PAGE_SIZE - PAGE_DIR)) {
if (UNIV_UNLIKELY(next_offs >= srv_page_size - PAGE_DIR)) {
wrong_offs: wrong_offs:
if (srv_force_recovery == 0 || moves_up == FALSE) { if (srv_force_recovery == 0 || moves_up == FALSE) {
@ -5823,7 +5823,8 @@ row_count_rtree_recs(
prebuilt->search_tuple = entry; prebuilt->search_tuple = entry;
ulint bufsize = ut_max(UNIV_PAGE_SIZE, prebuilt->mysql_row_len);
ulint bufsize = std::max<ulint>(srv_page_size,
prebuilt->mysql_row_len);
buf = static_cast<byte*>(ut_malloc_nokey(bufsize)); buf = static_cast<byte*>(ut_malloc_nokey(bufsize));
ulint cnt = 1000; ulint cnt = 1000;

26
storage/innobase/row/row0trunc.cc

@ -352,8 +352,8 @@ public:
} }
ulint sz = UNIV_PAGE_SIZE;
void* buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
ulint sz = srv_page_size;
void* buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == 0) { if (buf == 0) {
os_file_close(handle); os_file_close(handle);
return(DB_OUT_OF_MEMORY); return(DB_OUT_OF_MEMORY);
@ -361,7 +361,7 @@ public:
/* Align the memory for file i/o if we might have O_DIRECT set*/ /* Align the memory for file i/o if we might have O_DIRECT set*/
byte* log_buf = static_cast<byte*>( byte* log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
lsn_t lsn = log_get_lsn(); lsn_t lsn = log_get_lsn();
@ -383,7 +383,7 @@ public:
ut_ad(err == DB_FAIL); ut_ad(err == DB_FAIL);
ut_free(buf); ut_free(buf);
sz *= 2; sz *= 2;
buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
buf = ut_zalloc_nokey(sz + srv_page_size);
DBUG_EXECUTE_IF("ib_err_trunc_oom_logging", DBUG_EXECUTE_IF("ib_err_trunc_oom_logging",
ut_free(buf); ut_free(buf);
buf = 0;); buf = 0;);
@ -392,7 +392,7 @@ public:
return(DB_OUT_OF_MEMORY); return(DB_OUT_OF_MEMORY);
} }
log_buf = static_cast<byte*>( log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
} }
} while (err != DB_SUCCESS); } while (err != DB_SUCCESS);
@ -664,8 +664,8 @@ TruncateLogParser::parse(
return(DB_IO_ERROR); return(DB_IO_ERROR);
} }
ulint sz = UNIV_PAGE_SIZE;
void* buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
ulint sz = srv_page_size;
void* buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == 0) { if (buf == 0) {
os_file_close(handle); os_file_close(handle);
return(DB_OUT_OF_MEMORY); return(DB_OUT_OF_MEMORY);
@ -674,7 +674,7 @@ TruncateLogParser::parse(
IORequest request(IORequest::READ); IORequest request(IORequest::READ);
/* Align the memory for file i/o if we might have O_DIRECT set*/ /* Align the memory for file i/o if we might have O_DIRECT set*/
byte* log_buf = static_cast<byte*>(ut_align(buf, UNIV_PAGE_SIZE));
byte* log_buf = static_cast<byte*>(ut_align(buf, srv_page_size));
do { do {
err = os_file_read(request, handle, log_buf, 0, sz); err = os_file_read(request, handle, log_buf, 0, sz);
@ -714,7 +714,7 @@ TruncateLogParser::parse(
sz *= 2; sz *= 2;
buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == 0) { if (buf == 0) {
os_file_close(handle); os_file_close(handle);
@ -725,7 +725,7 @@ TruncateLogParser::parse(
} }
log_buf = static_cast<byte*>( log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
} }
} while (err != DB_SUCCESS); } while (err != DB_SUCCESS);
@ -2199,10 +2199,10 @@ fil_recreate_tablespace(
byte* buf; byte* buf;
page_t* page; page_t* page;
buf = static_cast<byte*>(ut_zalloc_nokey(3 * UNIV_PAGE_SIZE));
buf = static_cast<byte*>(ut_zalloc_nokey(3 * srv_page_size));
/* Align the memory for file i/o */ /* Align the memory for file i/o */
page = static_cast<byte*>(ut_align(buf, UNIV_PAGE_SIZE));
page = static_cast<byte*>(ut_align(buf, srv_page_size));
flags |= FSP_FLAGS_PAGE_SSIZE(); flags |= FSP_FLAGS_PAGE_SSIZE();
@ -2213,7 +2213,7 @@ fil_recreate_tablespace(
page_zip_des_t page_zip; page_zip_des_t page_zip;
page_zip_set_size(&page_zip, page_size.physical()); page_zip_set_size(&page_zip, page_size.physical());
page_zip.data = page + UNIV_PAGE_SIZE;
page_zip.data = page + srv_page_size;
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
page_zip.m_start = page_zip.m_start =

2
storage/innobase/srv/srv0mon.cc

@ -1838,7 +1838,7 @@ srv_mon_process_existing_counter(
/* innodb_page_size */ /* innodb_page_size */
case MONITOR_OVLD_SRV_PAGE_SIZE: case MONITOR_OVLD_SRV_PAGE_SIZE:
value = UNIV_PAGE_SIZE;
value = srv_page_size;
break; break;
case MONITOR_OVLD_RWLOCK_S_SPIN_WAITS: case MONITOR_OVLD_RWLOCK_S_SPIN_WAITS:

6
storage/innobase/srv/srv0srv.cc

@ -1123,9 +1123,9 @@ srv_normalize_init_values(void)
srv_tmp_space.normalize(); srv_tmp_space.normalize();
srv_log_buffer_size /= UNIV_PAGE_SIZE;
srv_log_buffer_size /= srv_page_size;
srv_lock_table_size = 5 * (srv_buf_pool_size / UNIV_PAGE_SIZE);
srv_lock_table_size = 5 * (srv_buf_pool_size / srv_page_size);
} }
/*********************************************************************//** /*********************************************************************//**
@ -1538,7 +1538,7 @@ srv_export_innodb_status(void)
export_vars.innodb_have_atomic_builtins = 0; export_vars.innodb_have_atomic_builtins = 0;
#endif #endif
export_vars.innodb_page_size = UNIV_PAGE_SIZE;
export_vars.innodb_page_size = srv_page_size;
export_vars.innodb_log_waits = srv_stats.log_waits; export_vars.innodb_log_waits = srv_stats.log_waits;

6
storage/innobase/srv/srv0start.cc

@ -643,13 +643,13 @@ srv_undo_tablespace_create(
" be created"; " be created";
ib::info() << "Setting file " << name << " size to " ib::info() << "Setting file " << name << " size to "
<< (size >> (20 - UNIV_PAGE_SIZE_SHIFT)) << " MB";
<< (size >> (20 - srv_page_size_shift)) << " MB";
ib::info() << "Database physically writes the file full: " ib::info() << "Database physically writes the file full: "
<< "wait..."; << "wait...";
ret = os_file_set_size( ret = os_file_set_size(
name, fh, os_offset_t(size) << UNIV_PAGE_SIZE_SHIFT);
name, fh, os_offset_t(size) << srv_page_size_shift);
if (!ret) { if (!ret) {
ib::info() << "Error in creating " << name ib::info() << "Error in creating " << name
@ -726,7 +726,7 @@ srv_undo_tablespace_open(
ut_a(fil_validate()); ut_a(fil_validate());
ut_a(space); ut_a(space);
os_offset_t n_pages = size / UNIV_PAGE_SIZE;
os_offset_t n_pages = size / srv_page_size;
/* On 32-bit platforms, ulint is 32 bits and os_offset_t /* On 32-bit platforms, ulint is 32 bits and os_offset_t
is 64 bits. It is OK to cast the n_pages to ulint because is 64 bits. It is OK to cast the n_pages to ulint because

18
storage/innobase/trx/trx0purge.cc

@ -583,8 +583,8 @@ namespace undo {
return(DB_IO_ERROR); return(DB_IO_ERROR);
} }
ulint sz = UNIV_PAGE_SIZE;
void* buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
ulint sz = srv_page_size;
void* buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == NULL) { if (buf == NULL) {
os_file_close(handle); os_file_close(handle);
delete[] log_file_name; delete[] log_file_name;
@ -592,7 +592,7 @@ namespace undo {
} }
byte* log_buf = static_cast<byte*>( byte* log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
IORequest request(IORequest::WRITE); IORequest request(IORequest::WRITE);
@ -643,8 +643,8 @@ namespace undo {
return; return;
} }
ulint sz = UNIV_PAGE_SIZE;
void* buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
ulint sz = srv_page_size;
void* buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == NULL) { if (buf == NULL) {
os_file_close(handle); os_file_close(handle);
os_file_delete(innodb_log_file_key, log_file_name); os_file_delete(innodb_log_file_key, log_file_name);
@ -653,7 +653,7 @@ namespace undo {
} }
byte* log_buf = static_cast<byte*>( byte* log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
mach_write_to_4(log_buf, undo::s_magic); mach_write_to_4(log_buf, undo::s_magic);
@ -711,8 +711,8 @@ namespace undo {
return(false); return(false);
} }
ulint sz = UNIV_PAGE_SIZE;
void* buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
ulint sz = srv_page_size;
void* buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == NULL) { if (buf == NULL) {
os_file_close(handle); os_file_close(handle);
os_file_delete(innodb_log_file_key, os_file_delete(innodb_log_file_key,
@ -722,7 +722,7 @@ namespace undo {
} }
byte* log_buf = static_cast<byte*>( byte* log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
IORequest request(IORequest::READ); IORequest request(IORequest::READ);

12
storage/innobase/trx/trx0rec.cc

@ -63,7 +63,7 @@ static void trx_undof_page_add_undo_rec_log(const buf_block_t* undo_block,
{ {
ut_ad(old_free >= TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE); ut_ad(old_free >= TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
ut_ad(new_free >= old_free); ut_ad(new_free >= old_free);
ut_ad(new_free < UNIV_PAGE_SIZE);
ut_ad(new_free < srv_page_size);
ut_ad(mach_read_from_2(TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_FREE ut_ad(mach_read_from_2(TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_FREE
+ undo_block->frame) + undo_block->frame)
== new_free); == new_free);
@ -176,7 +176,7 @@ trx_undo_page_set_next_prev_and_add(
offset value within undo_page.*/ offset value within undo_page.*/
ut_ad(ptr > undo_block->frame); ut_ad(ptr > undo_block->frame);
ut_ad(ptr < undo_block->frame + UNIV_PAGE_SIZE);
ut_ad(ptr < undo_block->frame + srv_page_size);
if (UNIV_UNLIKELY(trx_undo_left(undo_block, ptr) < 2)) { if (UNIV_UNLIKELY(trx_undo_left(undo_block, ptr) < 2)) {
return(0); return(0);
@ -488,7 +488,7 @@ trx_undo_page_report_insert(
+ undo_block->frame); + undo_block->frame);
ptr = undo_block->frame + first_free; ptr = undo_block->frame + first_free;
ut_ad(first_free <= UNIV_PAGE_SIZE);
ut_ad(first_free <= srv_page_size);
if (trx_undo_left(undo_block, ptr) < 2 + 1 + 11 + 11) { if (trx_undo_left(undo_block, ptr) < 2 + 1 + 11 + 11) {
/* Not enough space for writing the general parameters */ /* Not enough space for writing the general parameters */
@ -893,7 +893,7 @@ trx_undo_page_report_modify(
+ undo_block->frame); + undo_block->frame);
ptr = undo_block->frame + first_free; ptr = undo_block->frame + first_free;
ut_ad(first_free <= UNIV_PAGE_SIZE);
ut_ad(first_free <= srv_page_size);
if (trx_undo_left(undo_block, ptr) < 50) { if (trx_undo_left(undo_block, ptr) < 50) {
/* NOTE: the value 50 must be big enough so that the general /* NOTE: the value 50 must be big enough so that the general
@ -1840,7 +1840,7 @@ trx_undo_erase_page_end(page_t* undo_page)
first_free = mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR first_free = mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR
+ TRX_UNDO_PAGE_FREE); + TRX_UNDO_PAGE_FREE);
memset(undo_page + first_free, 0, memset(undo_page + first_free, 0,
(UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) - first_free);
(srv_page_size - FIL_PAGE_DATA_END) - first_free);
return(first_free != TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE); return(first_free != TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
} }
@ -1861,7 +1861,7 @@ trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table,
+ block->frame; + block->frame;
ulint first_free = mach_read_from_2(ptr_first_free); ulint first_free = mach_read_from_2(ptr_first_free);
ut_ad(first_free >= TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE); ut_ad(first_free >= TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
ut_ad(first_free <= UNIV_PAGE_SIZE);
ut_ad(first_free <= srv_page_size);
byte* start = block->frame + first_free; byte* start = block->frame + first_free;
size_t len = strlen(table->name.m_name); size_t len = strlen(table->name.m_name);
const size_t fixed = 2 + 1 + 11 + 11 + 2; const size_t fixed = 2 + 1 + 11 + 11 + 2;

2
storage/innobase/trx/trx0rseg.cc

@ -254,7 +254,7 @@ void trx_rseg_format_upgrade(trx_rsegf_t* rseg_header, mtr_t* mtr)
/* Clear also possible garbage at the end of the page. Old /* Clear also possible garbage at the end of the page. Old
InnoDB versions did not initialize unused parts of pages. */ InnoDB versions did not initialize unused parts of pages. */
byte* b = rseg_header + TRX_RSEG_MAX_TRX_ID + 8; byte* b = rseg_header + TRX_RSEG_MAX_TRX_ID + 8;
ulint len = UNIV_PAGE_SIZE
ulint len = srv_page_size
- (FIL_PAGE_DATA_END - (FIL_PAGE_DATA_END
+ TRX_RSEG + TRX_RSEG_MAX_TRX_ID + 8); + TRX_RSEG + TRX_RSEG_MAX_TRX_ID + 8);
memset(b, 0, len); memset(b, 0, len);

6
storage/innobase/trx/trx0sys.cc

@ -192,12 +192,12 @@ trx_sysf_create(
compile_time_assert(256 >= TRX_SYS_N_RSEGS); compile_time_assert(256 >= TRX_SYS_N_RSEGS);
memset(ptr, 0xff, 256 * TRX_SYS_RSEG_SLOT_SIZE); memset(ptr, 0xff, 256 * TRX_SYS_RSEG_SLOT_SIZE);
ptr += 256 * TRX_SYS_RSEG_SLOT_SIZE; ptr += 256 * TRX_SYS_RSEG_SLOT_SIZE;
ut_a(ptr <= page + (UNIV_PAGE_SIZE - FIL_PAGE_DATA_END));
ut_a(ptr <= page + (srv_page_size - FIL_PAGE_DATA_END));
/* Initialize all of the page. This part used to be uninitialized. */ /* Initialize all of the page. This part used to be uninitialized. */
memset(ptr, 0, UNIV_PAGE_SIZE - FIL_PAGE_DATA_END + page - ptr);
memset(ptr, 0, srv_page_size - FIL_PAGE_DATA_END + page - ptr);
mlog_log_string(TRX_SYS + page, UNIV_PAGE_SIZE - FIL_PAGE_DATA_END
mlog_log_string(TRX_SYS + page, srv_page_size - FIL_PAGE_DATA_END
- TRX_SYS, mtr); - TRX_SYS, mtr);
/* Create the first rollback segment in the SYSTEM tablespace */ /* Create the first rollback segment in the SYSTEM tablespace */

4
storage/innobase/trx/trx0undo.cc

@ -222,7 +222,7 @@ trx_undo_page_get_prev_rec(trx_undo_rec_t* rec, ulint page_no, ulint offset)
page_t* undo_page; page_t* undo_page;
ulint start; ulint start;
undo_page = (page_t*) ut_align_down(rec, UNIV_PAGE_SIZE);
undo_page = (page_t*) ut_align_down(rec, srv_page_size);
start = trx_undo_page_get_start(undo_page, page_no, offset); start = trx_undo_page_get_start(undo_page, page_no, offset);
@ -615,7 +615,7 @@ trx_undo_header_create(
new_free = free + TRX_UNDO_LOG_OLD_HDR_SIZE; new_free = free + TRX_UNDO_LOG_OLD_HDR_SIZE;
ut_a(free + TRX_UNDO_LOG_XA_HDR_SIZE < UNIV_PAGE_SIZE - 100);
ut_a(free + TRX_UNDO_LOG_XA_HDR_SIZE < srv_page_size - 100);
mach_write_to_2(page_hdr + TRX_UNDO_PAGE_START, new_free); mach_write_to_2(page_hdr + TRX_UNDO_PAGE_START, new_free);

Loading…
Cancel
Save