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 */
cursor->buf_size = XB_FIL_CUR_PAGES * page_size.physical();
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 *>
(ut_align(cursor->orig_buf, UNIV_PAGE_SIZE));
(ut_align(cursor->orig_buf, srv_page_size));
cursor->buf_read = 0;
cursor->buf_npages = 0;
@ -258,7 +258,7 @@ xb_fil_cur_read(
ib_int64_t offset;
ib_int64_t to_read;
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,
&offset, &to_read);

25
extra/mariabackup/xtrabackup.cc

@ -3061,12 +3061,13 @@ static dberr_t xb_assign_undo_space_start()
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:
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");
error = DB_ERROR;
goto func_exit;
@ -3591,8 +3592,8 @@ xb_normalize_init_values(void)
/*==========================*/
{
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,
FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE);
FIL_IBD_FILE_INITIAL_SIZE * srv_page_size);
if (!ret) {
msg("mariabackup: cannot set size for file %s\n", path);
os_file_close(*file);
@ -4256,11 +4257,11 @@ xb_space_create_file(
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 */
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);
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);
ret = os_file_write(IORequestWrite, path, *file, page, 0,
UNIV_PAGE_SIZE);
srv_page_size);
} else {
page_zip_des_t page_zip;
ulint zip_size = page_size.physical();
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);
#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(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);
}
#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);
if (offset < FIL_PAGE_DATA
|| offset > UNIV_PAGE_SIZE - FIL_PAGE_DATA_END) {
|| offset > srv_page_size - FIL_PAGE_DATA_END) {
return(FALSE);
@ -755,7 +755,7 @@ btr_page_free_low(
// TODO(jonaso): scrub only what is actually needed
page_t* page = buf_block_get_frame(block);
memset(page + PAGE_HEADER, 0,
UNIV_PAGE_SIZE - PAGE_HEADER);
srv_page_size - PAGE_HEADER);
#ifdef UNIV_DEBUG_SCRUBBING
fprintf(stderr,
"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,
PAGE_HEADER + PAGE_N_RECS + temp_page,
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));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
memcpy(PAGE_HEADER + page, PAGE_HEADER + temp_page,
PAGE_N_RECS - PAGE_N_DIR_SLOTS);
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
ut_a(!memcmp(page, temp_page, UNIV_PAGE_SIZE));
ut_a(!memcmp(page, temp_page, srv_page_size));
#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
goto func_exit;
@ -4173,7 +4173,7 @@ retry:
write the bits accurately in a separate
mini-transaction. */
ibuf_update_free_bits_if_full(merge_block,
UNIV_PAGE_SIZE,
srv_page_size,
ULINT_UNDEFINED);
}
}

10
storage/innobase/btr/btr0bulk.cc

@ -140,16 +140,16 @@ PageBulk::init()
m_reserved_space = dict_index_get_space_reserve();
} else {
m_reserved_space =
UNIV_PAGE_SIZE * (100 - innobase_fill_factor) / 100;
srv_page_size * (100 - innobase_fill_factor) / 100;
}
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_rec_no = page_header_get_field(new_page, PAGE_N_RECS);
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);
}
@ -212,7 +212,7 @@ PageBulk::insert(
- page_dir_calc_reserved_space(m_rec_no);
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_heap_top += rec_size;
@ -234,7 +234,7 @@ PageBulk::finish()
/* To pass the debug tests we have to set these dummy values
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
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
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 */
/* @{ */
@ -959,7 +959,7 @@ btr_cur_search_to_nth_level_func(
page_cur_mode_t search_mode = PAGE_CUR_UNSUPP;
ulint buf_mode;
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;
btr_op_t btr_op;
ulint root_height = 0; /* remove warning */
@ -2244,7 +2244,7 @@ btr_cur_open_at_index_side_func(
mtr_t* mtr) /*!< in/out: mini-transaction */
{
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 root_height = 0; /* remove warning */
rec_t* node_ptr;
@ -2615,7 +2615,7 @@ btr_cur_open_at_rnd_pos_func(
mtr_t* mtr) /*!< in: mtr */
{
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;
rec_t* node_ptr;
ulint savepoint;
@ -3709,7 +3709,7 @@ btr_cur_parse_update_in_place(
rec_offset = mach_read_from_2(ptr);
ptr += 2;
ut_a(rec_offset <= UNIV_PAGE_SIZE);
ut_a(rec_offset <= srv_page_size);
heap = mem_heap_create(256);
@ -4937,7 +4937,7 @@ btr_cur_parse_del_mark_set_clust_rec(
offset = mach_read_from_2(ptr);
ptr += 2;
ut_a(offset <= UNIV_PAGE_SIZE);
ut_a(offset <= srv_page_size);
/* In delete-marked records, DB_TRX_ID must
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);
ptr += 2;
ut_a(offset <= UNIV_PAGE_SIZE);
ut_a(offset <= srv_page_size);
if (page) {
rec = page + offset;
@ -6710,11 +6710,11 @@ btr_rec_get_externally_stored_len(
+ BTR_EXTERN_LEN + 4);
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
// the to_page.
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 - page_diff : 0;
}
@ -529,7 +529,7 @@ btr_defragment_merge_pages(
} else {
ibuf_update_free_bits_if_full(
to_block,
UNIV_PAGE_SIZE,
srv_page_size,
ULINT_UNDEFINED);
}
}

2
storage/innobase/btr/btr0scrub.cc

@ -668,7 +668,7 @@ btr_scrub_free_page(
* it will be found by scrubbing thread again
*/
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,
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(BUF_BUDDY_LOW <= UNIV_ZIP_SIZE_MIN);
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));
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
void
buf_buddy_block_free(
@ -390,7 +390,7 @@ buf_buddy_block_free(
ut_ad(buf_pool_mutex_own(buf_pool));
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,
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);
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;
buf_page_mutex_enter(block);
@ -432,7 +432,7 @@ buf_buddy_block_register(
buf_block_set_state(block, BUF_BLOCK_MEMORY);
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_zip_hash);
@ -765,7 +765,7 @@ func_exit:
@param[in] buf_pool buffer pool instance
@param[in] buf block to be reallocated, must be pointed
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. */
bool
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 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
pool. The buddy allocator is solely used for allocating control
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 */
buf_pools_list_size->LRU_bytes += buf_pool->stat.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_pool->stat.flush_list_bytes;
}
@ -854,7 +854,7 @@ buf_page_is_corrupted(
ib::info() << "Log sequence number at the start "
<< mach_read_from_4(read_buf + FIL_PAGE_LSN + 4)
<< " 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";
#endif /* UNIV_INNOCHECKSUM */
return(true);
@ -1461,7 +1461,7 @@ buf_block_init(
buf_block_t* block, /*!< in: pointer to control block */
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
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,
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. */
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););
@ -1581,12 +1583,12 @@ buf_chunk_init(
chunk->blocks = (buf_block_t*) chunk->mem;
/* 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
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);
/* Subtract the space needed for block descriptors. */
@ -1594,7 +1596,7 @@ buf_chunk_init(
ulint size = chunk->size;
while (frame < (byte*) (chunk->blocks + size)) {
frame += UNIV_PAGE_SIZE;
frame += srv_page_size;
size--;
}
@ -1610,7 +1612,7 @@ buf_chunk_init(
for (i = chunk->size; i--; ) {
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 */
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);
block++;
frame += UNIV_PAGE_SIZE;
frame += srv_page_size;
}
buf_pool_register_chunk(chunk);
@ -1863,7 +1865,7 @@ buf_pool_init_instance(
ut_min(BUF_READ_AHEAD_PAGES,
ut_2_power_up(buf_pool->curr_size /
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->n_chunks_new = buf_pool->n_chunks;
@ -2127,7 +2129,7 @@ buf_page_realloc(
if (buf_page_can_relocate(&block->page)) {
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);
/* relocate LRU list */
@ -2191,7 +2193,7 @@ buf_page_realloc(
buf_block_modify_clock_inc(block);
memset(block->frame + FIL_PAGE_OFFSET, 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);
block->page.id.reset();
@ -2314,7 +2316,7 @@ buf_frame_will_withdrawn(
while (chunk < echunk) {
if (ptr >= chunk->blocks->frame
&& ptr < (chunk->blocks + chunk->size - 1)->frame
+ UNIV_PAGE_SIZE) {
+ srv_page_size) {
return(true);
}
++chunk;
@ -2652,7 +2654,7 @@ buf_pool_resize()
ut_ad(srv_buf_pool_chunk_unit > 0);
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 "
ULINTPF " (unit=" ULINTPF ").",
@ -2671,7 +2673,7 @@ buf_pool_resize()
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;
buf_pool_mutex_exit(buf_pool);
@ -3004,7 +3006,7 @@ calc_buf_pool_size:
ut_2_power_up(buf_pool->curr_size /
BUF_READ_AHEAD_PORTION));
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;
buf_pool->old_size = buf_pool->curr_size;
}
@ -3056,7 +3058,7 @@ calc_buf_pool_size:
buf_resize_status("Resizing also other hash tables.");
/* 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);
/* normalize btr_search_sys */
@ -4046,14 +4048,14 @@ buf_block_from_ahi(const byte* ptr)
ulint offs = ulint(ptr - chunk->blocks->frame);
offs >>= UNIV_PAGE_SIZE_SHIFT;
offs >>= srv_page_size_shift;
ut_a(offs < chunk->size);
buf_block_t* block = &chunk->blocks[offs];
/* 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));
/* Read the state of the block without holding a mutex.
A state transition from BUF_BLOCK_FILE_PAGE to
@ -5252,7 +5254,7 @@ buf_page_init(
/* Silence valid Valgrind warnings about uninitialized
data being written to data files. There are some unused
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 */
@ -7339,14 +7341,14 @@ buf_pool_reserve_tmp_slot(
/* Allocate temporary memory for encryption/decryption */
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
compression/decompression */
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
output buffer used for compression is bigger than input
@ -7357,7 +7359,7 @@ buf_pool_reserve_tmp_slot(
#if HAVE_LZO
size += LZO1X_1_15_MEM_COMPRESS;
#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);
}
@ -7379,7 +7381,7 @@ buf_page_encrypt_before_write(
byte* src_frame)
{
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);

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
variants. Note that we must be careful to calculate the same value on 32-bit
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
byteorder when converting byte strings to integers
@return checksum */
@ -76,7 +76,7 @@ buf_calc_page_crc32(
const uint32_t c2 = crc32_func(
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);
}
@ -103,7 +103,7 @@ buf_calc_page_new_checksum(const byte* page)
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
- FIL_PAGE_OFFSET)
+ 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);
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)));
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*>(
ut_align(buf_dblwr->write_buf_unaligned,
UNIV_PAGE_SIZE));
srv_page_size));
buf_dblwr->buf_block_arr = static_cast<buf_page_t**>(
ut_zalloc_nokey(buf_size * sizeof(void*)));
@ -214,7 +214,7 @@ too_small:
<< "Cannot create doublewrite buffer: "
"the first file in innodb_data_file_path"
" must be at least "
<< (3 * (FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) >> 20)
<< (3 * (FSP_EXTENT_SIZE * srv_page_size) >> 20)
<< "M.";
mtr.commit();
return(false);
@ -363,10 +363,10 @@ buf_dblwr_init_or_load_pages(
/* We do the file i/o past the buffer pool */
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*>(
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
buffer */
@ -376,8 +376,8 @@ buf_dblwr_init_or_load_pages(
err = os_file_read(
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) {
@ -425,8 +425,8 @@ buf_dblwr_init_or_load_pages(
/* Read the pages from the doublewrite buffer to memory */
err = os_file_read(
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) {
@ -442,9 +442,9 @@ buf_dblwr_init_or_load_pages(
err = os_file_read(
read_request,
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) {
@ -484,8 +484,8 @@ buf_dblwr_init_or_load_pages(
err = os_file_write(
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) {
ib::error()
@ -503,7 +503,7 @@ buf_dblwr_init_or_load_pages(
recv_dblwr.add(page);
}
page += univ_page_size.physical();
page += srv_page_size;
}
if (reset_space_ids) {
@ -529,10 +529,10 @@ buf_dblwr_process()
}
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*>(
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();
i != recv_dblwr.pages.end();
@ -791,14 +791,14 @@ buf_dblwr_check_page_lsn(
}
if (memcmp(page + (FIL_PAGE_LSN + 4),
page + (UNIV_PAGE_SIZE
page + (srv_page_size
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4),
4)) {
const ulint lsn1 = mach_read_from_4(
page + FIL_PAGE_LSN + 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);
ib::error() << "The page to be written seems corrupt!"
@ -1001,7 +1001,7 @@ try_again:
for (ulint len2 = 0, i = 0;
i < buf_dblwr->first_free;
len2 += UNIV_PAGE_SIZE, i++) {
len2 += srv_page_size, i++) {
const buf_block_t* block;
@ -1025,7 +1025,7 @@ try_again:
/* Write out the first block of the doublewrite buffer */
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,
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. */
len = (buf_dblwr->first_free - TRX_SYS_DOUBLEWRITE_BLOCK_SIZE)
* UNIV_PAGE_SIZE;
* srv_page_size;
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,
page_id_t(TRX_SYS_SPACE, buf_dblwr->block2), univ_page_size,
@ -1123,7 +1123,7 @@ try_again:
}
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
encryption and/or page compression */
@ -1136,7 +1136,7 @@ try_again:
memcpy(p, frame, bpage->size.physical());
memset(p + bpage->size.physical(), 0x0,
univ_page_size.physical() - bpage->size.physical());
srv_page_size - bpage->size.physical());
} else {
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE);
@ -1266,20 +1266,20 @@ retry:
void * frame = buf_page_get_frame(bpage);
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());
memset(buf_dblwr->write_buf + univ_page_size.physical() * i
memset(buf_dblwr->write_buf + srv_page_size * i
+ bpage->size.physical(), 0x0,
univ_page_size.physical() - bpage->size.physical());
srv_page_size - bpage->size.physical());
fil_io(IORequestWrite,
true,
page_id_t(TRX_SYS_SPACE, offset),
univ_page_size,
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);
} else {
/* It is a regular page. Write it directly to the
@ -1289,7 +1289,7 @@ retry:
page_id_t(TRX_SYS_SPACE, offset),
univ_page_size,
0,
univ_page_size.physical(),
srv_page_size,
(void*) frame,
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 */
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);
if (block && srv_page_size == 16384) {
@ -998,7 +998,7 @@ buf_flush_init_for_writing(
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);
}

20
storage/innobase/buf/buf0lru.cc

@ -951,7 +951,7 @@ buf_LRU_get_free_only(
assert_block_ahi_empty(block);
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);
@ -998,7 +998,7 @@ buf_LRU_check_size_of_non_data_objects(
" Check that your transactions do not set too many"
" row locks, or review if"
" 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.";
} else if (!recv_recovery_is_on()
&& 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."
" innodb_buffer_pool_size="
<< (buf_pool->curr_size >>
(20 - UNIV_PAGE_SIZE_SHIFT)) << "M."
(20 - srv_page_size_shift)) << "M."
" Starting the InnoDB Monitor to print"
" diagnostics.";
@ -1758,10 +1758,10 @@ func_exit:
order to avoid bogus Valgrind warnings.*/
UNIV_MEM_VALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
btr_search_drop_page_hash_index((buf_block_t*) bpage);
UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
if (b != NULL) {
@ -1827,10 +1827,10 @@ buf_LRU_block_free_non_file_page(
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
/* 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
/* Wipe page_no and space_id */
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);
}
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:
UNIV_MEM_ASSERT_W(bpage, sizeof(buf_block_t));
UNIV_MEM_ASSERT_W(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
buf_block_modify_clock_inc((buf_block_t*) bpage);
if (bpage->zip.data) {
const page_t* page = ((buf_block_t*) bpage)->frame;
@ -2069,7 +2069,7 @@ buf_LRU_block_remove_hashed(
memset(((buf_block_t*) bpage)->frame
+ FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, 0xff, 4);
UNIV_MEM_INVALID(((buf_block_t*) bpage)->frame,
UNIV_PAGE_SIZE);
srv_page_size);
buf_page_set_state(bpage, BUF_BLOCK_REMOVE_HASH);
/* 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 */
{
#ifdef UNIV_IBUF_DEBUG
ut_a(n_stored < UNIV_PAGE_SIZE);
ut_a(n_stored < srv_page_size);
#endif
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.
The max size of the entry is about max key length * 2.
(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(),
considering MAX_KEY_LENGTH = 3072 at MySQL imposes
the 3500 historical InnoDB value for 16K page size case.)
For the universal index, node_ptr contains most of the entry.
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);
@ -2224,10 +2224,10 @@ dict_index_too_big_for_tree(
const page_size_t page_size(dict_tf_get_page_size(table->flags));
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
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. */
ut_ad(comp);
/* 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
beyond max pad size. */
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.
This is to ensure that we are able to read
info->pad atomically. */
@ -7076,17 +7076,17 @@ dict_index_zip_pad_optimal_page_size(
if (!zip_failure_threshold_pct) {
/* Disabled by user. */
return(UNIV_PAGE_SIZE);
return(srv_page_size);
}
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. */
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));
}

12
storage/innobase/fil/fil0crypt.cc

@ -665,7 +665,7 @@ fil_space_encrypt(
#ifdef UNIV_DEBUG
if (tmp) {
/* 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;
byte* src = src_frame;
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;
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,
srv_page_size, NULL);
src = uncomp_mem;
@ -686,7 +686,7 @@ fil_space_encrypt(
/* Need to decompress the page if it was also compressed */
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,
srv_page_size, NULL);
}
@ -2649,7 +2649,7 @@ fil_space_verify_crypt_checksum(
checksum2 = checksum1;
} else {
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(
page, checksum1, checksum2, false
/* 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 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(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,
FSP_FLAGS_HAS_PAGE_COMPRESSION(space->flags));
@ -2043,18 +2043,18 @@ fil_write_flushed_lsn(
byte* buf;
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);
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);
if (err == DB_SUCCESS) {
mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, lsn);
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);
}
@ -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);
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(
node->name, node->handle, size,
@ -3252,7 +3252,7 @@ fil_ibd_create(
if (!os_file_set_size(
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_exit:
os_file_close(file);
@ -3273,11 +3273,11 @@ err_exit:
with zeros from the call of os_file_set_size(), until a buffer pool
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 */
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();
fsp_header_init_fields(page, space_id, flags);
@ -3295,7 +3295,7 @@ err_exit:
} else {
page_zip_des_t page_zip;
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
page_zip.m_start =
#endif /* UNIV_DEBUG */
@ -4027,7 +4027,7 @@ fil_ibd_load(
/* Every .ibd file is created >= 4 pages in size.
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)) {
/* The following call prints an error message */
@ -4379,9 +4379,9 @@ fil_io(
ut_ad(req_type.validate());
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(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
# error "(1 << UNIV_PAGE_SIZE_SHIFT_MAX) != UNIV_PAGE_SIZE_MAX"
#endif
@ -4570,11 +4570,11 @@ fil_io(
if (!page_size.is_compressed()) {
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
>= ((byte_offset + len + (UNIV_PAGE_SIZE - 1))
/ UNIV_PAGE_SIZE));
>= ((byte_offset + len + (srv_page_size - 1))
/ srv_page_size));
} else {
ulint size_shift;
@ -5308,7 +5308,7 @@ truncate_t::truncate(
: space->size;
const bool success = os_file_truncate(
path, node->handle, trunc_size * UNIV_PAGE_SIZE);
path, node->handle, trunc_size * srv_page_size);
if (!success) {
ib::error() << "Cannot truncate file " << path

40
storage/innobase/fil/fil0pagecompress.cc

@ -117,7 +117,7 @@ fil_compress_page(
if (!out_buf) {
allocated = true;
ulint size = UNIV_PAGE_SIZE;
ulint size = srv_page_size;
/* Both snappy and lzo compression methods require that
output buffer used for compression is bigger than input
@ -162,7 +162,7 @@ fil_compress_page(
<< (space ? space->id : 0) << " '"
<< (space ? space->name : "(import)") << "' len " << len);
write_size = UNIV_PAGE_SIZE - header_len;
write_size = srv_page_size - header_len;
switch(comp_method) {
#ifdef HAVE_LZ4
@ -185,11 +185,11 @@ fil_compress_page(
#ifdef HAVE_LZO
case PAGE_LZO_ALGORITHM:
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;
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;
}
@ -209,7 +209,7 @@ fil_compress_page(
&out_pos,
(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;
goto err_exit;
}
@ -232,7 +232,7 @@ fil_compress_page(
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;
}
break;
@ -243,7 +243,7 @@ fil_compress_page(
case PAGE_SNAPPY_ALGORITHM:
{
snappy_status cstatus;
write_size = snappy_max_compressed_length(UNIV_PAGE_SIZE);
write_size = snappy_max_compressed_length(srv_page_size);
cstatus = snappy_compress(
(const char *)buf,
@ -251,7 +251,7 @@ fil_compress_page(
(char *)(out_buf+header_len),
(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;
goto err_exit;
}
@ -310,9 +310,9 @@ fil_compress_page(
byte *comp_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);
@ -439,8 +439,8 @@ fil_decompress_page(
// If no buffer was given, we need to allocate temporal buffer
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 {
in_buf = page_buf;
}
@ -472,7 +472,7 @@ fil_decompress_page(
/* Get the actual size of compressed page */
actual_size = mach_read_from_2(buf+FIL_PAGE_DATA);
/* 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"
<< " actual size: " << actual_size
<< " compression method: "
@ -527,7 +527,7 @@ fil_decompress_page(
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;
goto err_exit;
if (return_error) {
@ -557,7 +557,7 @@ fil_decompress_page(
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;
goto err_exit;
if (return_error) {
@ -570,7 +570,7 @@ fil_decompress_page(
#endif /* HAVE_LZMA */
#ifdef HAVE_BZIP2
case PAGE_BZIP2_ALGORITHM: {
unsigned int dst_pos = UNIV_PAGE_SIZE;
unsigned int dst_pos = srv_page_size;
err = BZ2_bzBuffToBuffDecompress(
(char *)in_buf,
@ -580,7 +580,7 @@ fil_decompress_page(
1,
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;
goto err_exit;
if (return_error) {
@ -594,7 +594,7 @@ fil_decompress_page(
case PAGE_SNAPPY_ALGORITHM:
{
snappy_status cstatus;
ulint olen = UNIV_PAGE_SIZE;
ulint olen = srv_page_size;
cstatus = snappy_uncompress(
(const char *)(buf+header_len),
@ -602,7 +602,7 @@ fil_decompress_page(
(char *)in_buf,
(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;
len = olen;
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 */
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;
dberr_t err = DB_ERROR;
@ -529,7 +529,7 @@ err_exit:
/* Check if the whole page is blank. */
if (!m_space_id && !m_flags) {
const byte* b = m_first_page;
ulint nonzero_bytes = UNIV_PAGE_SIZE;
ulint nonzero_bytes = srv_page_size;
while (*b == '\0' && --nonzero_bytes != 0) {
@ -550,13 +550,13 @@ err_exit:
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()
<< "Data file '" << m_filepath << "' uses page size "
<< page_size.logical() << ", but the innodb_page_size"
" start-up parameter is "
<< univ_page_size.logical();
<< srv_page_size;
free_first_page();
return(DB_ERROR);
}
@ -683,8 +683,8 @@ Datafile::find_space_id()
bool noncompressed_ok = false;
/* 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(
false, page, univ_page_size, NULL);
}
@ -698,11 +698,11 @@ Datafile::find_space_id()
assume the page is compressed if univ_page_size.
logical() is equal to or less than 16k and the
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(
page_size, univ_page_size.logical(),
page_size, srv_page_size,
true);
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);
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_ARCH_LOG_NO_OR_SPACE_ID,
@ -1989,7 +1989,7 @@ fseg_create(
ut_ad(mtr);
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);
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.*/
const ulint rounded_size_pages = static_cast<ulint>(
size >> UNIV_PAGE_SIZE_SHIFT);
size >> srv_page_size_shift);
/* If 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 */
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 ...";
bool success = os_file_set_size(
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) {
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.";
} else {
ib::error() << "Could not set the file size of '"
@ -766,7 +766,7 @@ SysTablespace::check_file_spec(
}
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 "
<< min_expected_size / (1024 * 1024) << " MB";
@ -949,10 +949,10 @@ SysTablespace::normalize()
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);
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));
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);
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
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)) {
ib::info() << "innodb_page_size="
<< UNIV_PAGE_SIZE << " requires "
<< srv_page_size << " requires "
<< "innodb_buffer_pool_size > 24M current "
<< innobase_buffer_pool_size;
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
are higher than imposed by MySQL. */
switch (UNIV_PAGE_SIZE) {
switch (srv_page_size) {
case 4096:
return(768);
case 8192:
@ -6269,7 +6269,7 @@ no_such_table:
}
/* 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 */
thr_lock_data_init(&m_share->lock, &lock, NULL);
@ -11411,7 +11411,7 @@ create_table_info_t::create_options_are_invalid()
case 8:
case 16:
/* 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
KBS is also smaller. */
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. */
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,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: Cannot create a COMPRESSED table"
@ -11924,7 +11924,7 @@ index_bad:
if (row_type == ROW_TYPE_COMPRESSED && zip_allowed) {
/* ROW_FORMAT=COMPRESSED without KEY_BLOCK_SIZE
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;
}
}
@ -11975,7 +11975,7 @@ index_bad:
}
/* 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,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: Cannot create a COMPRESSED table"
@ -13436,7 +13436,7 @@ ha_innobase::estimate_rows_upper_bound()
ut_a(stat_n_leaf_pages > 0);
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
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;
}
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,
ER_WRONG_ARGUMENTS,
"innodb_log_write_ahead_size cannot"
@ -18770,7 +18770,7 @@ innodb_log_write_ahead_size_update(
ER_WRONG_ARGUMENTS,
"Setting innodb_log_write_ahead_size"
" to %lu",
UNIV_PAGE_SIZE);
srv_page_size);
} else if (val != in_val) {
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_ARGUMENTS,
@ -20684,13 +20684,13 @@ innodb_params_adjust()
= MYSQL_SYSVAR_NAME(undo_logs).def_val
= srv_available_undo_logs;
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).def_val
= ulonglong(SRV_UNDO_TABLESPACE_SIZE_IN_PAGES)
* srv_page_size;
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
>= REC_VERSION_56_MAX_INDEX_COL_LEN) {
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(
@ -21035,7 +21035,7 @@ innobase_get_computed_value(
if (row_field->ext) {
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(

20
storage/innobase/ibuf/ibuf0ibuf.cc

@ -442,7 +442,7 @@ ibuf_count_set(
ulint val)
{
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;
}
@ -510,7 +510,7 @@ ibuf_init_at_db_start(void)
buffer pool size. Once ibuf struct is initialized this
value is updated with the user supplied size by calling
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;
mutex_create(LATCH_ID_IBUF, &ibuf_mutex);
@ -584,7 +584,7 @@ ibuf_max_size_update(
ulint new_val) /*!< in: new value in terms of
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;
mutex_enter(&ibuf_mutex);
ibuf->max_size = new_size;
@ -701,7 +701,7 @@ ibuf_bitmap_page_get_bits_low(
byte_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);
@ -754,7 +754,7 @@ ibuf_bitmap_page_set_bits(
byte_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);
@ -2381,7 +2381,7 @@ ibuf_get_merge_page_nos_func(
&& prev_space_id == first_space_id)
|| (volume_for_page
> ((IBUF_MERGE_THRESHOLD - 1)
* 4 * UNIV_PAGE_SIZE
* 4 * srv_page_size
/ IBUF_PAGE_SIZE_PER_FREE_SPACE)
/ IBUF_MERGE_THRESHOLD)) {
@ -2965,7 +2965,7 @@ get_volume_comp:
Gets an upper limit for the combined size of entries buffered in the insert
buffer for a given page.
@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 */
static
ulint
@ -3066,7 +3066,7 @@ ibuf_get_volume_buffered(
do not have the x-latch on it, and cannot acquire one
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)
@ -3136,7 +3136,7 @@ count_later:
/* We give up */
return(UNIV_PAGE_SIZE);
return(srv_page_size);
}
if (page_no != ibuf_rec_get_page_no(mtr, rec)
@ -4653,7 +4653,7 @@ loop:
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);
#endif
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
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.

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
limit, merging it to a neighbor is tried */
#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
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 */
ulint size, /*!< in: compressed page size
(between UNIV_ZIP_SIZE_MIN and
UNIV_PAGE_SIZE) */
srv_page_size) */
bool* lru) /*!< in: pointer to a variable
that will be assigned true if
storage was allocated from the
@ -67,14 +67,14 @@ buf_buddy_free(
void* buf, /*!< in: block to be freed, must not
be pointed to by the buffer pool */
ulint size) /*!< in: block size,
up to UNIV_PAGE_SIZE */
up to srv_page_size */
MY_ATTRIBUTE((nonnull));
/** Reallocate a block.
@param[in] buf_pool buffer pool instance
@param[in] buf block to be reallocated, must be pointed
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. */
bool
buf_buddy_realloc(

10
storage/innobase/include/buf0buddy.ic

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

8
storage/innobase/include/buf0buf.h

@ -1577,7 +1577,7 @@ public:
bool encrypted; /*!< page is still encrypted */
ulint real_size; /*!< Real size of the page
Normal pages == UNIV_PAGE_SIZE
Normal pages == srv_page_size
page compressed pages, payload
size alligned to sector boundary.
*/
@ -1712,9 +1712,9 @@ struct buf_block_t{
buf_pool->page_hash can point
to buf_page_t or buf_block_t */
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
UNIV_PAGE_SIZE */
srv_page_size */
BPageLock lock; /*!< read-write lock of the buffer
frame */
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. */
/* @{ */
#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_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)
/*======================*/
{
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);
frame = (buf_frame_t*) ut_align_down(ptr, UNIV_PAGE_SIZE);
frame = (buf_frame_t*) ut_align_down(ptr, srv_page_size);
return(frame);
}
@ -778,11 +778,11 @@ buf_ptr_get_fsp_addr(
fil_addr_t* addr) /*!< out: page offset and byte offset */
{
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);
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_memcpy(buf, frame, UNIV_PAGE_SIZE);
ut_memcpy(buf, frame, srv_page_size);
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
variants. Note that we must be careful to calculate the same value on 32-bit
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
byteorder when converting byte strings to integers
@return checksum */

4
storage/innobase/include/buf0dblwr.h

@ -131,7 +131,7 @@ struct buf_dblwr_t{
doublewrite block (64 pages) */
ulint block2; /*!< page number of the second block */
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
for batch flush. */
os_event_t b_event;/*!< event where threads wait for a
@ -150,7 +150,7 @@ struct buf_dblwr_t{
buffer. */
byte* write_buf;/*!< write buffer used in writing to the
doublewrite buffer, aligned to an
address divisible by UNIV_PAGE_SIZE
address divisible by srv_page_size
(which is required by Windows aio) */
byte* write_buf_unaligned;/*!< pointer to write_buf,
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)
/** 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 */
#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;
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)
/* @} */

8
storage/innobase/include/dict0dict.ic

@ -595,8 +595,8 @@ dict_tf_is_valid_not_redundant(ulint flags)
for the uncompressed page format */
return(false);
} 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
ROW_FORMAT=COMPRESSED is not supported with this
innodb_page_size (only up to 16KiB) */
@ -852,7 +852,7 @@ dict_tf_get_page_size(
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)
/*==============================*/
{
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 */
#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)
/* @defgroup Compatibility macros for MariaDB 10.1.0 through 10.1.20;
@ -318,7 +318,7 @@ UNIV_INLINE
ulint
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 /* !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);
ut_ad(UNIV_ZIP_SIZE_MIN > XDES_ARR_OFFSET
+ (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE)

2
storage/innobase/include/fsp0sysspace.h

@ -140,7 +140,7 @@ public:
ulint get_autoextend_increment() const
{
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
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 */
#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
description takes less than 1 byte; a descriptor page is repeated every
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
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;
byte* ptr = NULL;
ut_ad(addr.boffset < UNIV_PAGE_SIZE);
ut_ad(addr.boffset < srv_page_size);
ut_ad((rw_latch == RW_S_LATCH)
|| (rw_latch == RW_X_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_SX_FIX));
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_BYTE, addr.boffset,
@ -83,7 +83,7 @@ flst_read_addr(
addr.boffset = mtr_read_ulint(faddr + FIL_ADDR_BYTE, MLOG_2BYTES,
mtr);
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);
}

2
storage/innobase/include/ibuf0ibuf.ic

@ -28,7 +28,7 @@ Created 7/19/1997 Heikki Tuuri
#include "fsp0types.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
buffer inserts to this page. If there is this much of free space, the
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
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);
@ -422,7 +422,7 @@ extern my_bool innodb_log_checksums;
/* 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_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 */
#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
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
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_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
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.
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;
if (heap->free_block) {
size += UNIV_PAGE_SIZE;
size += srv_page_size;
}
return(size);

2
storage/innobase/include/mtr0log.ic

@ -225,7 +225,7 @@ mlog_write_initial_log_record_fast(
ut_ad(log_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);
offset = mach_read_from_4(page + FIL_PAGE_OFFSET);

12
storage/innobase/include/page0page.h

@ -210,7 +210,7 @@ inline
page_t*
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.
@ -221,7 +221,7 @@ inline
ulint
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.
@ -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_OLD_SUPREMUM < PAGE_NEW_SUPREMUM_END);
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_NEW_INFIMUM
@ -351,7 +351,7 @@ bool
page_rec_is_supremum_low(ulint offset)
{
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);
}
@ -363,7 +363,7 @@ bool
page_rec_is_infimum_low(ulint offset)
{
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);
}
@ -663,7 +663,7 @@ page_dir_get_nth_slot(
ulint n); /*!< in: position */
#else /* UNIV_DEBUG */
# 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))
#endif /* UNIV_DEBUG */
/**************************************************************//**

14
storage/innobase/include/page0page.ic

@ -172,8 +172,8 @@ page_header_set_field(
{
ut_ad(page);
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);
if (page_zip) {
@ -521,7 +521,7 @@ page_dir_get_nth_slot(
ut_ad(page_dir_get_n_slots(page) > n);
return((page_dir_slot_t*)
page + UNIV_PAGE_SIZE - PAGE_DIR
page + srv_page_size - PAGE_DIR
- (n + 1) * PAGE_DIR_SLOT_SIZE);
}
#endif /* UNIV_DEBUG */
@ -640,7 +640,7 @@ page_rec_get_next_low(
offs = rec_get_next_offs(rec, comp);
if (offs >= UNIV_PAGE_SIZE) {
if (offs >= srv_page_size) {
fprintf(stderr,
"InnoDB: Next record offset is nonsensical %lu"
" in record at offset %lu\n"
@ -852,7 +852,7 @@ page_get_data_size(
? PAGE_NEW_SUPREMUM_END
: PAGE_OLD_SUPREMUM_END)
- page_header_get_field(page, PAGE_GARBAGE);
ut_ad(ret < UNIV_PAGE_SIZE);
ut_ad(ret < srv_page_size);
return(ret);
}
@ -900,13 +900,13 @@ page_get_free_space_of_empty(
ulint comp) /*!< in: nonzero=compact page layout */
{
if (comp) {
return((ulint)(UNIV_PAGE_SIZE
return((ulint)(srv_page_size
- PAGE_NEW_SUPREMUM_END
- PAGE_DIR
- 2 * PAGE_DIR_SLOT_SIZE));
}
return((ulint)(UNIV_PAGE_SIZE
return((ulint)(srv_page_size
- PAGE_OLD_SUPREMUM_END
- PAGE_DIR
- 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;
ut_ad(size >= UNIV_ZIP_SIZE_MIN);
ut_ad(size <= UNIV_PAGE_SIZE);
ut_ad(size <= srv_page_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
record with the formula:
relative_offset + offset_of_this_record
mod UNIV_PAGE_SIZE
mod srv_page_size
3 3 bits status:
000=REC_STATUS_ORDINARY
001=REC_STATUS_NODE_PTR
@ -254,13 +254,13 @@ rec_get_next_ptr_const(
as signed 16-bit integer in 2's complement arithmetics.
If all platforms defined int16_t in the standard headers,
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
? field_value - 65536
: field_value)
+ ut_align_offset(rec, UNIV_PAGE_SIZE)
< UNIV_PAGE_SIZE);
+ ut_align_offset(rec, srv_page_size)
< srv_page_size);
#endif
/* There must be at least REC_N_NEW_EXTRA_BYTES + 1
between each record. */
@ -268,12 +268,12 @@ rec_get_next_ptr_const(
&& field_value < 32768)
|| 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 {
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);
}
}
@ -322,13 +322,13 @@ rec_get_next_offs(
as signed 16-bit integer in 2's complement arithmetics.
If all platforms defined int16_t in the standard headers,
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
? field_value - 65536
: field_value)
+ ut_align_offset(rec, UNIV_PAGE_SIZE)
< UNIV_PAGE_SIZE);
+ ut_align_offset(rec, srv_page_size)
< srv_page_size);
#endif
if (field_value == 0) {
@ -341,9 +341,9 @@ rec_get_next_offs(
&& field_value < 32768)
|| 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 {
ut_ad(field_value < UNIV_PAGE_SIZE);
ut_ad(field_value < srv_page_size);
return(field_value);
}
@ -360,7 +360,7 @@ rec_set_next_offs_old(
ulint next) /*!< in: offset of the next record */
{
ut_ad(rec);
ut_ad(UNIV_PAGE_SIZE > next);
ut_ad(srv_page_size > next);
#if REC_NEXT_MASK != 0xFFFFUL
# error "REC_NEXT_MASK != 0xFFFFUL"
#endif
@ -384,7 +384,7 @@ rec_set_next_offs_new(
ulint field_value;
ut_ad(rec);
ut_ad(UNIV_PAGE_SIZE > next);
ut_ad(srv_page_size > next);
if (!next) {
field_value = 0;
@ -395,7 +395,7 @@ rec_set_next_offs_new(
field_value = (ulint)
((lint) next
- (lint) ut_align_offset(rec, UNIV_PAGE_SIZE));
- (lint) ut_align_offset(rec, srv_page_size));
field_value &= REC_NEXT_MASK;
}
@ -1198,7 +1198,7 @@ rec_get_nth_field_size(
os = rec_get_field_start_offs(rec, n);
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);
}
@ -1300,7 +1300,7 @@ rec_offs_data_size(
ut_ad(rec_offs_validate(NULL, NULL, offsets));
size = rec_offs_base(offsets)[rec_offs_n_fields(offsets)]
& REC_OFFS_MASK;
ut_ad(size < UNIV_PAGE_SIZE);
ut_ad(size < srv_page_size);
return(size);
}
@ -1318,7 +1318,7 @@ rec_offs_extra_size(
ulint size;
ut_ad(rec_offs_validate(NULL, NULL, offsets));
size = *rec_offs_base(offsets) & REC_OFFS_MASK;
ut_ad(size < UNIV_PAGE_SIZE);
ut_ad(size < srv_page_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.
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.
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;
/** @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_pending_writes; /*!< srv_os_log_pending_writes */
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_read; /*!< buf_pool->stat.n_pages_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;
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*>(
mem_heap_dup(heap, undo_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
UNDO tablespaces */
/* 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 */
#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"
#endif
/** 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
TRX_SYS_MYSQL_LOG_MAGIC_N
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 */
#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
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
(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 :::)
596 TRX_SYS_WSREP_XID_INFO TRX_SYS_WSREP_XID_MAGIC_N_FLD
600 TRX_SYS_WSREP_XID_FORMAT
@ -259,7 +259,7 @@ space_id, page_no pairs :::)
739 TRX_SYS_WSREP_XID_DATA_END
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
1600 TRX_SYS_WSREP_XID_FORMAT
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)
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
2100 TRX_SYS_MYSQL_LOG_OFFSET_HIGH
2104 TRX_SYS_MYSQL_LOG_OFFSET_LOW
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
3100 TRX_SYS_MYSQL_LOG_OFFSET_HIGH
3104 TRX_SYS_MYSQL_LOG_OFFSET_LOW
3108 TRX_SYS_MYSQL_LOG_NAME
(UNIV_PAGE_SIZE - 200 DOUBLEWRITE)
(srv_page_size - 200 DOUBLEWRITE)
3896 TRX_SYS_DOUBLEWRITE TRX_SYS_DOUBLEWRITE_FSEG
3906 TRX_SYS_DOUBLEWRITE_MAGIC
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
3930 TRX_SYS_DOUBLEWRITE_SPACE_ID_STORED_N
(UNIV_PAGE_SIZE - 8, TAILER)
(srv_page_size - 8, TAILER)
4088..4096 FIL_TAILER
*/
@ -308,7 +308,7 @@ FIXED WSREP XID info offsets for 4k page size 10.0.32-galera
/** Doublewrite buffer */
/* @{ */
/** 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
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
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
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 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);

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
#define IF_LZO(A,B) A
#else
@ -314,9 +311,6 @@ management to ensure correct alignment for doubles etc. */
#define IF_PUNCH_HOLE(A,B) B
#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)
Note: This must never change! */
#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.
(The convention 'ssize' is used for 'log2 minus 9' or the number of
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 \
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. */
#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 */
#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 */
#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
should be bigger than LOG_POOL_PREFLUSH_RATIO_SYNC */
@ -184,7 +184,7 @@ log_buffer_extend(
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 */
log_mutex_exit_all();
return;
@ -234,7 +234,7 @@ log_buffer_extend(
ut_free_dodump(log_sys->buf, log_sys->buf_size * 2);
/* 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 = static_cast<byte*>(
@ -722,7 +722,7 @@ log_sys_init()
log_sys->lsn = LOG_START_LSN;
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;
@ -895,13 +895,12 @@ log_group_file_header_flush(
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,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size,
(ulint) (dest_offset % univ_page_size.physical()),
ulint(dest_offset % srv_page_size),
OS_FILE_LOG_BLOCK_SIZE, buf, group);
srv_stats.os_log_pending_writes.dec();
@ -1016,15 +1015,14 @@ loop:
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,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size,
(ulint) (next_offset % UNIV_PAGE_SIZE), write_len, buf,
ulint(next_offset % srv_page_size), write_len, buf,
group);
srv_stats.os_log_pending_writes.dec();
@ -1261,7 +1259,7 @@ loop:
/* The first block in the unit was initialized
after the last writing.
Needs to be written padded data once. */
pad_size = std::min(
pad_size = std::min<ulint>(
ulint(write_ahead_size) - end_offset_in_unit,
log_sys->buf_size - area_end);
::memset(write_buf + area_end, 0, pad_size);
@ -1524,8 +1522,8 @@ log_group_checkpoint(lsn_t end_lsn)
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) {
rw_lock_x_lock_gen(&log_sys->checkpoint_lock,
@ -1566,8 +1564,8 @@ log_group_header_read(
fil_io(IORequestLogRead, true,
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);
}

24
storage/innobase/log/log0recv.cc

@ -62,7 +62,7 @@ Created 9/20/1997 Heikki Tuuri
#include "row0merge.h"
/** 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))
/** Read-ahead area in applying log records to file pages */
@ -673,15 +673,14 @@ loop:
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,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
univ_page_size,
(ulint) (source_offset % univ_page_size.physical()),
ulint(source_offset % srv_page_size),
len, buf, NULL);
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
= log_group_calc_lsn_offset(lsn, group);
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;
static const char* NO_UPGRADE_RECOVERY_MSG =
@ -898,9 +896,9 @@ recv_log_format_0_recover(lsn_t lsn)
fil_io(IORequestLogRead, true,
page_id_t(SRV_LOG_SPACE_FIRST_ID, page_no),
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)
!= log_block_get_checksum(buf)
@ -1598,7 +1596,7 @@ recv_add_to_hash_table(
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
be allocated */
@ -1811,7 +1809,7 @@ recv_recover_page(bool just_read_in, buf_block_t* block)
end_lsn = recv->start_lsn + recv->len;
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
+ page, end_lsn);
@ -2908,7 +2906,7 @@ recv_group_scan_log_recs(
lsn_t end_lsn;
store_t store_to_hash = recv_sys->mlog_checkpoint_lsn == 0
? 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()
- (recv_n_pool_free_frames * srv_buf_pool_instances));

8
storage/innobase/mem/mem0mem.cc

@ -219,7 +219,7 @@ mem_heap_validate(
break;
case MEM_HEAP_BUFFER:
case MEM_HEAP_BUFFER | MEM_HEAP_BTR_SEARCH:
ut_ad(block->len <= UNIV_PAGE_SIZE);
ut_ad(block->len <= srv_page_size);
break;
default:
ut_error;
@ -264,13 +264,13 @@ mem_heap_create_block_func(
/* In dynamic allocation, calculate the size: block header + data. */
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);
block = static_cast<mem_block_t*>(ut_malloc_nokey(len));
} else {
len = UNIV_PAGE_SIZE;
len = srv_page_size;
if ((type & MEM_HEAP_BTR_SEARCH) && heap) {
/* We cannot allocate the block from the
@ -412,7 +412,7 @@ mem_heap_block_free(
len = block->len;
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_free(block);
} else {

8
storage/innobase/mtr/mtr0log.cc

@ -144,7 +144,7 @@ mlog_parse_nbytes(
offset = mach_read_from_2(ptr);
ptr += 2;
if (offset >= UNIV_PAGE_SIZE) {
if (offset >= srv_page_size) {
recv_sys->found_corrupt_log = TRUE;
return(NULL);
@ -312,7 +312,7 @@ mlog_write_string(
mtr_t* mtr) /*!< in: mini-transaction handle */
{
ut_ad(ptr && mtr);
ut_a(len < UNIV_PAGE_SIZE);
ut_a(len < srv_page_size);
memcpy(ptr, str, len);
@ -332,7 +332,7 @@ mlog_log_string(
byte* log_ptr;
ut_ad(ptr && mtr);
ut_ad(len <= UNIV_PAGE_SIZE);
ut_ad(len <= srv_page_size);
log_ptr = mlog_open(mtr, 30);
@ -383,7 +383,7 @@ mlog_parse_string(
len = mach_read_from_2(ptr);
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;
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));
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;
/* Suppress valgrind warning. */
memset(buf, 0x00, UNIV_PAGE_SIZE * 2);
memset(buf, 0x00, srv_page_size * 2);
memset(&iocb, 0x0, sizeof(iocb));
struct iocb* p_iocb = &iocb;
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 {
ut_a(UNIV_PAGE_SIZE >= 512);
ut_a(srv_page_size >= 512);
io_prep_pread(p_iocb, fd, ptr, 512, 0);
}
@ -5329,16 +5329,16 @@ fallback:
/* Write up to 1 megabyte at a time. */
ulint buf_size = ut_min(
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 */
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 */
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
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);
#endif /* _WIN32 */
@ -6172,7 +6172,7 @@ AIO::reserve_slot(
doing simulated AIO */
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 (;;) {
@ -6853,10 +6853,10 @@ public:
}
m_ptr = static_cast<byte*>(
ut_malloc_nokey(len + UNIV_PAGE_SIZE));
ut_malloc_nokey(len + srv_page_size));
m_buf = static_cast<byte*>(
ut_align(m_ptr, UNIV_PAGE_SIZE));
ut_align(m_ptr, srv_page_size));
} else {
len = first_slot()->len;

28
storage/innobase/page/page0cur.cc

@ -849,7 +849,7 @@ page_cur_insert_rec_write_log(
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(page_align(insert_rec) == page_align(cursor_rec));
ut_ad(!page_rec_is_comp(insert_rec)
@ -992,8 +992,8 @@ need_extra_info:
/* Write the mismatch index */
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 {
/* Write the record end segment length
and the extra info storage flag */
@ -1010,7 +1010,7 @@ need_extra_info:
mlog_close(mtr, log_ptr + rec_size);
} else {
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);
}
}
@ -1062,7 +1062,7 @@ page_cur_parse_insert_rec(
cursor_rec = page + offset;
if (offset >= UNIV_PAGE_SIZE) {
if (offset >= srv_page_size) {
recv_sys->found_corrupt_log = TRUE;
@ -1077,7 +1077,7 @@ page_cur_parse_insert_rec(
return(NULL);
}
if (end_seg_len >= UNIV_PAGE_SIZE << 1) {
if (end_seg_len >= srv_page_size << 1) {
recv_sys->found_corrupt_log = TRUE;
return(NULL);
@ -1101,7 +1101,7 @@ page_cur_parse_insert_rec(
return(NULL);
}
ut_a(origin_offset < UNIV_PAGE_SIZE);
ut_a(origin_offset < srv_page_size);
mismatch_index = mach_parse_compressed(&ptr, end_ptr);
@ -1110,7 +1110,7 @@ page_cur_parse_insert_rec(
return(NULL);
}
ut_a(mismatch_index < UNIV_PAGE_SIZE);
ut_a(mismatch_index < srv_page_size);
}
if (end_ptr < ptr + (end_seg_len >> 1)) {
@ -1152,7 +1152,7 @@ page_cur_parse_insert_rec(
/* 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 << ", "
<< "info_and_status_bits " << info_and_status_bits
@ -2066,9 +2066,9 @@ page_copy_rec_list_end_to_created_page(
#ifdef UNIV_DEBUG
/* To pass the debug tests we have to set these dummy values
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,
new_page + UNIV_PAGE_SIZE - 1);
new_page + srv_page_size - 1);
#endif
log_ptr = page_copy_rec_list_to_created_page_write_log(new_page,
index, mtr);
@ -2133,7 +2133,7 @@ page_copy_rec_list_end_to_created_page(
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;
@ -2171,7 +2171,7 @@ page_copy_rec_list_end_to_created_page(
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) {
mach_write_to_4(log_ptr, log_data_len);
@ -2255,7 +2255,7 @@ page_cur_parse_delete_rec(
offset = mach_read_from_2(ptr);
ptr += 2;
ut_a(offset <= UNIV_PAGE_SIZE);
ut_a(offset <= srv_page_size);
if (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) {
r = rec_get_next_ptr_const(r, TRUE);
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 {
while (rec_get_n_owned_old(r) == 0) {
r = rec_get_next_ptr_const(r, FALSE);
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);
memset(page
+ 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[UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
page[srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
= PAGE_NEW_INFIMUM;
} else {
page[PAGE_HEADER + PAGE_N_HEAP + 1] = PAGE_HEAP_NO_USER_LOW;
@ -399,10 +399,10 @@ page_create_low(
sizeof infimum_supremum_redundant);
memset(page
+ 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[UNIV_PAGE_SIZE - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
page[srv_page_size - PAGE_DIR - PAGE_DIR_SLOT_SIZE + 1]
= PAGE_OLD_INFIMUM;
}
@ -594,7 +594,7 @@ page_copy_rec_list_end_no_locks(
btr_assert_not_corrupted(new_block, index);
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));
const bool is_leaf = page_is_leaf(block->frame);
@ -1052,7 +1052,7 @@ page_delete_rec_list_end(
ulint* offsets = 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));
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
@ -1159,8 +1159,8 @@ delete_all:
s = rec_offs_size(offsets);
ut_ad(ulint(rec2 - page) + s
- 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;
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
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));
}
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++) {
@ -1724,7 +1724,7 @@ page_rec_get_n_recs_before(
n--;
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);
}
@ -2017,7 +2017,7 @@ page_simple_validate_old(
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
<< " of page dir slots";
@ -2093,7 +2093,7 @@ page_simple_validate_old(
if (UNIV_UNLIKELY
(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 "
<< rec_get_next_offs(rec, FALSE) << " for rec "
@ -2104,7 +2104,7 @@ page_simple_validate_old(
count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page record list appears"
" to be circular " << count;
goto func_exit;
@ -2141,7 +2141,7 @@ page_simple_validate_old(
while (rec != NULL) {
if (UNIV_UNLIKELY(rec < page + FIL_PAGE_DATA
|| rec >= page + UNIV_PAGE_SIZE)) {
|| rec >= page + srv_page_size)) {
ib::error() << "Free list record has"
" a nonsensical offset " << (rec - page);
@ -2158,7 +2158,7 @@ page_simple_validate_old(
count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page free list appears"
" to be circular " << count;
goto func_exit;
@ -2207,7 +2207,7 @@ page_simple_validate_new(
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
<< " of page dir slots";
@ -2284,7 +2284,7 @@ page_simple_validate_new(
if (UNIV_UNLIKELY
(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 "
<< rec_get_next_offs(rec, TRUE)
@ -2295,7 +2295,7 @@ page_simple_validate_new(
count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page record list appears to be"
" circular " << count;
goto func_exit;
@ -2332,7 +2332,7 @@ page_simple_validate_new(
while (rec != NULL) {
if (UNIV_UNLIKELY(rec < page + FIL_PAGE_DATA
|| rec >= page + UNIV_PAGE_SIZE)) {
|| rec >= page + srv_page_size)) {
ib::error() << "Free list record has"
" a nonsensical offset " << page_offset(rec);
@ -2350,7 +2350,7 @@ page_simple_validate_new(
count++;
if (UNIV_UNLIKELY(count > UNIV_PAGE_SIZE)) {
if (UNIV_UNLIKELY(count > srv_page_size)) {
ib::error() << "Page free list appears to be"
" circular " << count;
goto func_exit;
@ -2440,12 +2440,12 @@ page_validate(
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
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
overlap. */
@ -2548,7 +2548,7 @@ page_validate(
offs = page_offset(rec_get_start(rec, 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";
goto func_exit;
}
@ -2656,7 +2656,7 @@ n_owned_zero:
count++;
offs = page_offset(rec_get_start(rec, 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";
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);
ut_a(heap_no >= PAGE_HEAP_NO_USER_LOW);
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);
#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
@ -1296,7 +1296,7 @@ page_zip_compress(
&& dict_table_is_comp(index->table)
&& !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. */
ut_a(!memcmp(page + (PAGE_NEW_INFIMUM - REC_N_NEW_EXTRA_BYTES),
@ -1347,8 +1347,8 @@ page_zip_compress(
if (logfile) {
/* 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");
}
/* Record the compressed size as zero.
@ -1407,7 +1407,7 @@ page_zip_compress(
+ REC_OFFS_HEADER_SIZE
+ n_dense * ((sizeof *recs)
- PAGE_ZIP_DIR_SLOT_SIZE)
+ UNIV_PAGE_SIZE * 4
+ srv_page_size * 4
+ (512 << MAX_MEM_LEVEL));
recs = static_cast<const rec_t**>(
@ -1424,7 +1424,7 @@ page_zip_compress(
page_zip_set_alloc(&c_stream, heap);
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);
ut_a(err == Z_OK);
@ -1545,7 +1545,7 @@ page_zip_compress(
c_stream.avail_in = static_cast<uInt>(
page_header_get_field(page, PAGE_HEAP_TOP)
- (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);
err = deflate(&c_stream, Z_FINISH);
@ -1623,7 +1623,7 @@ err_exit:
/* Record the compressed size of the block. */
byte sz[4];
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) {
perror("fwrite");
}
@ -1820,7 +1820,7 @@ page_zip_dir_decode(
/* Traverse the list of stored records in the sorting order,
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);
/* Zero out the page trailer. */
@ -2326,7 +2326,7 @@ page_zip_decompress_node_ptrs(
d_stream->avail_out = static_cast<uInt>(
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);
switch (inflate(d_stream, Z_SYNC_FLUSH)) {
case Z_STREAM_END:
@ -2393,7 +2393,7 @@ page_zip_decompress_node_ptrs(
d_stream->avail_out = static_cast<uInt>(
page_header_get_field(page_zip->data, PAGE_HEAP_TOP)
- 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_fail(("page_zip_decompress_node_ptrs:"
@ -2548,7 +2548,7 @@ page_zip_decompress_sec(
d_stream->avail_out = static_cast<uInt>(
page_header_get_field(page_zip->data, PAGE_HEAP_TOP)
- 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_fail(("page_zip_decompress_sec:"
@ -2768,7 +2768,7 @@ page_zip_decompress_clust(
d_stream->avail_out =static_cast<uInt>(
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);
err = inflate(d_stream, Z_SYNC_FLUSH);
switch (err) {
@ -2878,7 +2878,7 @@ page_zip_decompress_clust(
d_stream->avail_out = static_cast<uInt>(
page_header_get_field(page_zip->data, PAGE_HEAP_TOP)
- 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_fail(("page_zip_decompress_clust:"
@ -3052,7 +3052,7 @@ page_zip_decompress_low(
ulint* offsets;
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));
/* The dense directory excludes the infimum and supremum records. */
@ -3065,7 +3065,7 @@ page_zip_decompress_low(
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**>(
mem_heap_alloc(heap, n_dense * sizeof *recs));
@ -3097,9 +3097,9 @@ page_zip_decompress_low(
#ifdef UNIV_ZIP_DEBUG
/* 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 */
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. */
if (UNIV_UNLIKELY(!page_zip_dir_decode(page_zip, page, recs,
@ -3132,9 +3132,9 @@ zlib_error:
d_stream.avail_in = static_cast<uInt>(
page_zip_get_size(page_zip) - (PAGE_DATA + 1));
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)) {
ut_error;
}
@ -3229,7 +3229,7 @@ err_exit:
}
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);
mem_heap_free(heap);
@ -3345,7 +3345,7 @@ page_zip_validate_low(
page_zip_fail(("page_zip_validate: page header\n"));
page_zip_hexdump(page_zip, sizeof *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);
}
@ -3356,11 +3356,11 @@ page_zip_validate_low(
}
/* 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));
temp_page_zip = *page_zip;
@ -3393,7 +3393,7 @@ page_zip_validate_low(
valid = FALSE;
}
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
set incorrectly until the mini-transaction is
@ -3417,7 +3417,7 @@ page_zip_validate_low(
if (!memcmp(page + PAGE_HEADER,
temp_page + PAGE_HEADER,
UNIV_PAGE_SIZE - PAGE_HEADER
srv_page_size - PAGE_HEADER
- FIL_PAGE_DATA_END)) {
/* Only the minimum record flag
@ -3511,8 +3511,8 @@ func_exit:
if (!valid) {
page_zip_hexdump(page_zip, sizeof *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);
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_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_get_n_slots(page));
@ -3894,8 +3894,8 @@ page_zip_parse_write_blob_ptr(
z_offset = mach_read_from_2(ptr + 2);
if (offset < PAGE_ZIP_START
|| offset >= UNIV_PAGE_SIZE
|| z_offset >= UNIV_PAGE_SIZE) {
|| offset >= srv_page_size
|| z_offset >= srv_page_size) {
corrupt:
recv_sys->found_corrupt_log = TRUE;
@ -4036,8 +4036,8 @@ page_zip_parse_write_node_ptr(
z_offset = mach_read_from_2(ptr + 2);
if (offset < PAGE_ZIP_START
|| offset >= UNIV_PAGE_SIZE
|| z_offset >= UNIV_PAGE_SIZE) {
|| offset >= srv_page_size
|| z_offset >= srv_page_size) {
corrupt:
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);
if (offset < PAGE_ZIP_START
|| offset >= UNIV_PAGE_SIZE
|| z_offset >= UNIV_PAGE_SIZE) {
|| offset >= srv_page_size
|| z_offset >= srv_page_size) {
corrupt:
recv_sys->found_corrupt_log = TRUE;
@ -4778,7 +4778,7 @@ page_zip_reorganize(
ut_ad(!dict_index_is_ibuf(index));
ut_ad(!dict_table_is_temporary(index->table));
/* 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));
/* Disable logging */
@ -4866,9 +4866,9 @@ page_zip_copy_recs(
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_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));
/* 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,
PAGE_HEADER_PRIV_END);
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,
PAGE_HEADER_PRIV_END);
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;
ut_ad(*len < UNIV_PAGE_SIZE);
ut_ad(*len < srv_page_size);
return(os);
}
@ -1985,7 +1985,7 @@ rec_validate_old(
for (i = 0; i < n_fields; i++) {
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;
return(FALSE);
}
@ -2036,7 +2036,7 @@ rec_validate(
switch (len) {
default:
if (len >= UNIV_PAGE_SIZE) {
if (len >= srv_page_size) {
ib::error() << "Record field " << i
<< " len " << len;
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
updated then its state must be set to BUF_PAGE_NOT_USED. For
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 block - block read from file, note it is not from the buffer pool
@retval DB_SUCCESS or error code. */
@ -573,7 +573,7 @@ AbstractCallback::init(
ib::error() << "Page size " << m_page_size.physical()
<< " of ibd file is not the same as the server page"
" size " << univ_page_size.physical();
" size " << srv_page_size;
return(DB_CORRUPTION);
@ -2919,14 +2919,14 @@ row_import_read_v1(
const ulint logical_page_size = mach_read_from_4(ptr);
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,
"Tablespace to be imported has a different"
" page size than this server. Server page size"
" is " ULINTPF ", whereas tablespace page size"
" is %lu, whereas tablespace page size"
" is " ULINTPF,
univ_page_size.logical(),
srv_page_size,
logical_page_size);
return(DB_ERROR);
@ -3598,8 +3598,8 @@ fil_tablespace_iterate(
We allocate an extra page in case it is a compressed table. One
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*>
(ut_zalloc_nokey(sizeof *block));
@ -3615,7 +3615,7 @@ fil_tablespace_iterate(
request.disable_partial_io_warnings();
err = os_file_read_no_error_handling(request, file, page, 0,
UNIV_PAGE_SIZE, 0);
srv_page_size, 0);
if (err == DB_SUCCESS) {
err = callback.init(file_size, block);
@ -3655,23 +3655,23 @@ fil_tablespace_iterate(
/* Add an extra page for compressed page scratch area. */
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*>(
ut_align(io_buffer, UNIV_PAGE_SIZE));
ut_align(io_buffer, srv_page_size));
void* crypt_io_buffer = NULL;
if (iter.crypt_data) {
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*>(
ut_align(crypt_io_buffer, UNIV_PAGE_SIZE));
ut_align(crypt_io_buffer, srv_page_size));
}
if (block->page.zip.ssize) {
ut_ad(iter.n_io_buffers == 1);
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);

10
storage/innobase/row/row0log.cc

@ -2706,7 +2706,7 @@ row_log_progress_inc_per_block()
(usually 1MiB). */
const ulint pages_per_block = std::max(
static_cast<unsigned long>(
srv_sort_buf_size / univ_page_size.physical()),
srv_sort_buf_size / srv_page_size),
1UL);
/* 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[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;
next_block:
@ -3674,8 +3674,8 @@ row_log_apply_ops(
offsets[0] = i;
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;
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
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. */
if (conv_heap != NULL && data_size > UNIV_PAGE_SIZE) {
if (conv_heap != NULL && data_size > srv_page_size) {
*err = DB_TOO_BIG_RECORD;
}

3
storage/innobase/row/row0mysql.cc

@ -4802,7 +4802,8 @@ row_scan_index_for_mysql(
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));
heap = mem_heap_create(100);

2
storage/innobase/row/row0purge.cc

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

2
storage/innobase/row/row0quiesce.cc

@ -394,7 +394,7 @@ row_quiesce_write_header(
byte* ptr = row;
/* 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);
/* 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 (prebuilt->blob_heap == NULL) {
prebuilt->blob_heap = mem_heap_create(
UNIV_PAGE_SIZE);
srv_page_size);
}
heap = prebuilt->blob_heap;
} 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
@ -3042,7 +3042,7 @@ row_sel_store_mysql_field_func(
if (prebuilt->blob_heap == NULL) {
prebuilt->blob_heap = mem_heap_create(
UNIV_PAGE_SIZE);
srv_page_size);
DBUG_PRINT("anna", ("blob_heap allocated: %p",
prebuilt->blob_heap));
}
@ -4375,7 +4375,7 @@ row_search_mvcc(
&& dict_index_is_clust(index)
&& !prebuilt->templ_contains_blob
&& !prebuilt->used_in_HANDLER
&& (prebuilt->mysql_row_len < UNIV_PAGE_SIZE / 8)) {
&& (prebuilt->mysql_row_len < srv_page_size / 8)) {
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:
if (srv_force_recovery == 0 || moves_up == FALSE) {
@ -5823,7 +5823,8 @@ row_count_rtree_recs(
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));
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) {
os_file_close(handle);
return(DB_OUT_OF_MEMORY);
@ -361,7 +361,7 @@ public:
/* 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));
ut_align(buf, srv_page_size));
lsn_t lsn = log_get_lsn();
@ -383,7 +383,7 @@ public:
ut_ad(err == DB_FAIL);
ut_free(buf);
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",
ut_free(buf);
buf = 0;);
@ -392,7 +392,7 @@ public:
return(DB_OUT_OF_MEMORY);
}
log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
}
} while (err != DB_SUCCESS);
@ -664,8 +664,8 @@ TruncateLogParser::parse(
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) {
os_file_close(handle);
return(DB_OUT_OF_MEMORY);
@ -674,7 +674,7 @@ TruncateLogParser::parse(
IORequest request(IORequest::READ);
/* 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 {
err = os_file_read(request, handle, log_buf, 0, sz);
@ -714,7 +714,7 @@ TruncateLogParser::parse(
sz *= 2;
buf = ut_zalloc_nokey(sz + UNIV_PAGE_SIZE);
buf = ut_zalloc_nokey(sz + srv_page_size);
if (buf == 0) {
os_file_close(handle);
@ -725,7 +725,7 @@ TruncateLogParser::parse(
}
log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
}
} while (err != DB_SUCCESS);
@ -2199,10 +2199,10 @@ fil_recreate_tablespace(
byte* buf;
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 */
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();
@ -2213,7 +2213,7 @@ fil_recreate_tablespace(
page_zip_des_t page_zip;
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
page_zip.m_start =

2
storage/innobase/srv/srv0mon.cc

@ -1838,7 +1838,7 @@ srv_mon_process_existing_counter(
/* innodb_page_size */
case MONITOR_OVLD_SRV_PAGE_SIZE:
value = UNIV_PAGE_SIZE;
value = srv_page_size;
break;
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_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;
#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;

6
storage/innobase/srv/srv0start.cc

@ -643,13 +643,13 @@ srv_undo_tablespace_create(
" be created";
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: "
<< "wait...";
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) {
ib::info() << "Error in creating " << name
@ -726,7 +726,7 @@ srv_undo_tablespace_open(
ut_a(fil_validate());
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
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);
}
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) {
os_file_close(handle);
delete[] log_file_name;
@ -592,7 +592,7 @@ namespace undo {
}
byte* log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
IORequest request(IORequest::WRITE);
@ -643,8 +643,8 @@ namespace undo {
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) {
os_file_close(handle);
os_file_delete(innodb_log_file_key, log_file_name);
@ -653,7 +653,7 @@ namespace undo {
}
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);
@ -711,8 +711,8 @@ namespace undo {
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) {
os_file_close(handle);
os_file_delete(innodb_log_file_key,
@ -722,7 +722,7 @@ namespace undo {
}
byte* log_buf = static_cast<byte*>(
ut_align(buf, UNIV_PAGE_SIZE));
ut_align(buf, srv_page_size));
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(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
+ undo_block->frame)
== new_free);
@ -176,7 +176,7 @@ trx_undo_page_set_next_prev_and_add(
offset value within undo_page.*/
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)) {
return(0);
@ -488,7 +488,7 @@ trx_undo_page_report_insert(
+ undo_block->frame);
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) {
/* Not enough space for writing the general parameters */
@ -893,7 +893,7 @@ trx_undo_page_report_modify(
+ undo_block->frame);
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) {
/* 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
+ TRX_UNDO_PAGE_FREE);
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);
}
@ -1861,7 +1861,7 @@ trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table,
+ block->frame;
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 <= UNIV_PAGE_SIZE);
ut_ad(first_free <= srv_page_size);
byte* start = block->frame + first_free;
size_t len = strlen(table->name.m_name);
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
InnoDB versions did not initialize unused parts of pages. */
byte* b = rseg_header + TRX_RSEG_MAX_TRX_ID + 8;
ulint len = UNIV_PAGE_SIZE
ulint len = srv_page_size
- (FIL_PAGE_DATA_END
+ TRX_RSEG + TRX_RSEG_MAX_TRX_ID + 8);
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);
memset(ptr, 0xff, 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. */
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);
/* 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;
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);
@ -615,7 +615,7 @@ trx_undo_header_create(
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);

Loading…
Cancel
Save