1 # name : innodb_files_extend.patch
2 # introduced : 11 or before
3 # maintainer : Yasufumi
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 --- a/storage/innodb_plugin/buf/buf0buddy.c
9 +++ b/storage/innodb_plugin/buf/buf0buddy.c
11 #endif /* UNIV_DEBUG */
12 /** Statistics of the buddy system, indexed by block size.
13 Protected by buf_pool_mutex. */
14 -UNIV_INTERN buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES + 1];
15 +UNIV_INTERN buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
17 /** Validate a given zip_free list. */
18 #define BUF_BUDDY_LIST_VALIDATE(i) \
19 --- a/storage/innodb_plugin/fil/fil0fil.c
20 +++ b/storage/innodb_plugin/fil/fil0fil.c
22 ut_a(space->purpose != FIL_LOG);
23 ut_a(!trx_sys_sys_space(space->id));
25 - if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
26 + if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
28 "InnoDB: Error: the size of single-table"
29 " tablespace file %s\n"
32 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
33 #ifndef UNIV_HOTBACKUP
34 - if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
35 + if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
37 "InnoDB: Error: the size of single-table tablespace"
40 /* Align the memory for file i/o if we might have O_DIRECT set */
41 page = ut_align(buf2, UNIV_PAGE_SIZE);
43 - if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
44 + if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
45 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
47 /* We have to read the tablespace id from the file */
49 ut_ad(ut_is_2pow(zip_size));
52 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
53 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
55 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
56 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
58 ut_ad(fil_validate());
59 #ifndef UNIV_HOTBACKUP
60 # ifndef UNIV_LOG_DEBUG
61 --- a/storage/innodb_plugin/fsp/fsp0fsp.c
62 +++ b/storage/innodb_plugin/fsp/fsp0fsp.c
64 0 for uncompressed pages */
65 ulint offset) /*!< in: page offset */
67 -#ifndef DOXYGEN /* Doxygen gets confused of these */
68 -# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
69 - + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
72 -# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
73 - + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
76 -#endif /* !DOXYGEN */
77 +//#ifndef DOXYGEN /* Doxygen gets confused of these */
78 +//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
79 +// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
82 +//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
83 +// + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
86 +//#endif /* !DOXYGEN */
87 + ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
88 + ut_a(PAGE_ZIP_MIN_SIZE > XDES_ARR_OFFSET + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
89 ut_ad(ut_is_2pow(zip_size));
92 @@ -1465,12 +1467,12 @@
94 xdes_init(descr, mtr);
96 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
97 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
99 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
100 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
102 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
103 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
105 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
106 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
109 if (UNIV_UNLIKELY(init_xdes)) {
111 --- a/storage/innodb_plugin/handler/ha_innodb.cc
112 +++ b/storage/innodb_plugin/handler/ha_innodb.cc
114 static ulong innobase_read_io_threads;
115 static ulong innobase_write_io_threads;
117 +static ulong innobase_page_size;
118 +static ulong innobase_log_block_size;
120 static my_bool innobase_thread_concurrency_timer_based;
121 static long long innobase_buffer_pool_size, innobase_log_file_size;
123 @@ -2107,6 +2110,62 @@
125 #endif /* UNIV_DEBUG */
128 + srv_page_size_shift = 0;
130 + if (innobase_page_size != (1 << 14)) {
134 + "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
135 + for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
136 + if (innobase_page_size == ((ulong)1 << n_shift)) {
137 + srv_page_size_shift = n_shift;
138 + srv_page_size = (1 << srv_page_size_shift);
140 + "InnoDB: The universal page size of the database is set to %lu.\n",
146 + srv_page_size_shift = 14;
147 + srv_page_size = (1 << srv_page_size_shift);
150 + if (!srv_page_size_shift) {
152 + "InnoDB: Error: %lu is not valid value for innodb_page_size.\n",
153 + innobase_page_size);
157 + srv_log_block_size = 0;
158 + if (innobase_log_block_size != (1 << 9)) { /*!=512*/
162 + "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
163 + for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
164 + if (innobase_log_block_size == ((ulong)1 << n_shift)) {
165 + srv_log_block_size = (1 << n_shift);
167 + "InnoDB: The log block size is set to %lu.\n",
168 + srv_log_block_size);
173 + srv_log_block_size = 512;
176 + if (!srv_log_block_size) {
178 + "InnoDB: Error: %lu is not valid value for innodb_log_block_size.\n",
179 + innobase_log_block_size);
184 innodb_overwrite_relay_log_info = FALSE;
186 @@ -6994,9 +7053,9 @@
189 << DICT_TF_FORMAT_SHIFT;
190 -#if DICT_TF_ZSSIZE_MAX < 1
191 -# error "DICT_TF_ZSSIZE_MAX < 1"
193 +//#if DICT_TF_ZSSIZE_MAX < 1
194 +//# error "DICT_TF_ZSSIZE_MAX < 1"
199 @@ -11196,6 +11255,16 @@
200 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
203 +static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
204 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
205 + "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
206 + NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
208 +static MYSQL_SYSVAR_ULONG(log_block_size, innobase_log_block_size,
209 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
210 + "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!",
211 + NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
213 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
215 "The common part for InnoDB table spaces.",
216 @@ -11683,6 +11752,8 @@
217 NULL, NULL, 0, 0, 2, 0);
219 static struct st_mysql_sys_var* innobase_system_variables[]= {
220 + MYSQL_SYSVAR(page_size),
221 + MYSQL_SYSVAR(log_block_size),
222 MYSQL_SYSVAR(additional_mem_pool_size),
223 MYSQL_SYSVAR(autoextend_increment),
224 MYSQL_SYSVAR(buffer_pool_size),
225 --- a/storage/innodb_plugin/handler/innodb_patch_info.h
226 +++ b/storage/innodb_plugin/handler/innodb_patch_info.h
228 {"innodb_separate_doublewrite","Add option 'innodb_doublewrite_file' to separate doublewrite dedicated tablespace","","http://www.percona.com/docs/wiki/percona-xtradb"},
229 {"innodb_pass_corrupt_table","Treat tables as corrupt instead of crash, when meet corrupt blocks","","http://www.percona.com/docs/wiki/percona-xtradb"},
230 {"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
231 +{"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
232 {NULL, NULL, NULL, NULL}
234 --- a/storage/innodb_plugin/include/buf0buddy.h
235 +++ b/storage/innodb_plugin/include/buf0buddy.h
238 /** Statistics of the buddy system, indexed by block size.
239 Protected by buf_pool_mutex. */
240 -extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES + 1];
241 +extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
244 # include "buf0buddy.ic"
245 --- a/storage/innodb_plugin/include/buf0buf.h
246 +++ b/storage/innodb_plugin/include/buf0buf.h
247 @@ -1503,11 +1503,11 @@
248 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
249 /*!< unmodified compressed pages */
250 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
251 - UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
252 + UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
253 /*!< buddy free lists */
254 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
255 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
257 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
258 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
260 #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
261 # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
263 --- a/storage/innodb_plugin/include/buf0types.h
264 +++ b/storage/innodb_plugin/include/buf0types.h
266 #define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT)
268 #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
269 +#define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
270 /*!< number of buddy sizes */
272 /** twice the maximum block size of the buddy system;
273 the underlying memory is aligned by this amount:
274 this must be equal to UNIV_PAGE_SIZE */
275 -#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
276 +#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
280 --- a/storage/innodb_plugin/include/fsp0types.h
281 +++ b/storage/innodb_plugin/include/fsp0types.h
285 /** File space extent size (one megabyte) in pages */
286 -#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
287 +#define FSP_EXTENT_SIZE ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT))
289 /** On a page of any file segment, data may be put starting from this
291 --- a/storage/innodb_plugin/include/log0log.h
292 +++ b/storage/innodb_plugin/include/log0log.h
294 when mysqld is first time started
295 on the restored database, it can
296 print helpful info for the user */
297 +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
298 + /* extend to record log_block_size
299 + of XtraDB. 0 means default 512 */
300 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
301 /* this 4-byte field is TRUE when
302 the writing of an archived log file
303 --- a/storage/innodb_plugin/include/mtr0log.ic
304 +++ b/storage/innodb_plugin/include/mtr0log.ic
307 if ((space == TRX_SYS_SPACE
308 || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
309 - && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
310 + && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
311 if (trx_doublewrite_buf_is_being_created) {
312 /* Do nothing: we only come to this branch in an
313 InnoDB database creation. We do not redo log
314 --- a/storage/innodb_plugin/include/os0file.h
315 +++ b/storage/innodb_plugin/include/os0file.h
317 if this fails for a log block, then it is equivalent to a media failure in the
320 -#define OS_FILE_LOG_BLOCK_SIZE 512
321 +#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
323 /** Options for file_create @{ */
324 #define OS_FILE_OPEN 51
326 extern ulint os_n_file_writes;
327 extern ulint os_n_fsyncs;
329 +extern ulint srv_log_block_size;
331 /* File types for directory entry data type */
333 enum os_file_type_enum{
334 --- a/storage/innodb_plugin/include/page0types.h
335 +++ b/storage/innodb_plugin/include/page0types.h
338 /** Number of supported compressed page sizes */
339 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
340 -#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
341 -# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
342 +#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
343 +#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
344 +# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
347 /** Compressed page descriptor */
349 typedef struct page_zip_stat_struct page_zip_stat_t;
351 /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
352 -extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
353 +extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
355 /**********************************************************************//**
356 Write the "deleted" flag of a record on a compressed page. The flag must
357 --- a/storage/innodb_plugin/include/trx0sys.h
358 +++ b/storage/innodb_plugin/include/trx0sys.h
360 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
361 #define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
363 -#if UNIV_PAGE_SIZE < 4096
364 -# error "UNIV_PAGE_SIZE < 4096"
366 +//#if UNIV_PAGE_SIZE < 4096
367 +//# error "UNIV_PAGE_SIZE < 4096"
369 /** The offset of the MySQL replication info in the trx system header;
370 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
371 #define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
372 --- a/storage/innodb_plugin/include/univ.i
373 +++ b/storage/innodb_plugin/include/univ.i
377 /* The 2-logarithm of UNIV_PAGE_SIZE: */
378 -#define UNIV_PAGE_SIZE_SHIFT 14
379 +/* #define UNIV_PAGE_SIZE_SHIFT 14 */
380 +#define UNIV_PAGE_SIZE_SHIFT_MAX 14
381 +#define UNIV_PAGE_SIZE_SHIFT srv_page_size_shift
382 /* The universal page size of the database */
383 -#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT)
384 +/* #define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) */
385 +#define UNIV_PAGE_SIZE srv_page_size
386 +#define UNIV_PAGE_SIZE_MAX (1 << UNIV_PAGE_SIZE_SHIFT_MAX)
388 /* Maximum number of parallel threads in a parallelized operation */
389 #define UNIV_MAX_PARALLELISM 32
391 stored part of the field in the tablespace. The length field then
392 contains the sum of the following flag and the locally stored len. */
394 -#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
395 +#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
397 /* Some macros to improve branch prediction and reduce cache misses */
398 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
400 UNIV_MEM_ALLOC(addr, size); \
403 +extern ulint srv_page_size_shift;
404 +extern ulint srv_page_size;
406 --- a/storage/innodb_plugin/log/log0log.c
407 +++ b/storage/innodb_plugin/log/log0log.c
410 offset = (gr_lsn_size_offset + difference) % group_size;
412 + if (sizeof(ulint) == 4) {
413 ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
417 "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
418 @@ -1182,6 +1184,9 @@
419 /* Wipe over possible label of ibbackup --restore */
420 memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
422 + mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
423 + srv_log_block_size);
425 dest_offset = nth_file * group->file_size;
428 @@ -1775,9 +1780,7 @@
431 ut_ad(mutex_own(&(log_sys->mutex)));
432 -#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
433 -# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
435 + ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
437 buf = group->checkpoint_buf;
439 @@ -1791,6 +1794,7 @@
440 mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
442 #ifdef UNIV_LOG_ARCHIVE
443 +#error "UNIV_LOG_ARCHIVE could not be enabled"
444 if (log_sys->archiving_state == LOG_ARCH_OFF) {
445 archived_lsn = IB_ULONGLONG_MAX;
447 @@ -1804,7 +1808,9 @@
449 mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
450 #else /* UNIV_LOG_ARCHIVE */
451 - mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
452 + mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN,
453 + (ib_uint64_t)log_group_calc_lsn_offset(
454 + log_sys->next_checkpoint_lsn, group));
455 #endif /* UNIV_LOG_ARCHIVE */
457 for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
458 --- a/storage/innodb_plugin/log/log0recv.c
459 +++ b/storage/innodb_plugin/log/log0recv.c
462 group->lsn = mach_read_ull(
463 buf + LOG_CHECKPOINT_LSN);
465 +#ifdef UNIV_LOG_ARCHIVE
466 +#error "UNIV_LOG_ARCHIVE could not be enabled"
469 + ib_uint64_t tmp_lsn_offset = mach_read_ull(
470 + buf + LOG_CHECKPOINT_ARCHIVED_LSN);
471 + if (sizeof(ulint) != 4
472 + && tmp_lsn_offset != IB_ULONGLONG_MAX) {
473 + group->lsn_offset = (ulint) tmp_lsn_offset;
475 group->lsn_offset = mach_read_from_4(
476 buf + LOG_CHECKPOINT_OFFSET);
480 checkpoint_no = mach_read_ull(
481 buf + LOG_CHECKPOINT_NO);
483 @@ -2942,6 +2956,7 @@
484 log_group_t* max_cp_group;
485 log_group_t* up_to_date_group;
487 + ulint log_hdr_log_block_size;
488 ib_uint64_t checkpoint_lsn;
489 ib_uint64_t checkpoint_no;
490 ib_uint64_t old_scanned_lsn;
491 @@ -3043,6 +3058,20 @@
492 log_hdr_buf, max_cp_group);
495 + log_hdr_log_block_size
496 + = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
497 + if (log_hdr_log_block_size == 0) {
498 + /* 0 means default value */
499 + log_hdr_log_block_size = 512;
501 + if (log_hdr_log_block_size != srv_log_block_size) {
503 + "InnoDB: Error: The block size of ib_logfile (%lu) "
504 + "is not equal to innodb_log_block_size.\n",
505 + log_hdr_log_block_size);
509 #ifdef UNIV_LOG_ARCHIVE
510 group = UT_LIST_GET_FIRST(log_sys->log_groups);
512 --- a/storage/innodb_plugin/page/page0zip.c
513 +++ b/storage/innodb_plugin/page/page0zip.c
516 #ifndef UNIV_HOTBACKUP
517 /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
518 -UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
519 +UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
520 #endif /* !UNIV_HOTBACKUP */
522 /* Please refer to ../include/page0zip.ic for a description of the
523 --- a/storage/innodb_plugin/row/row0merge.c
524 +++ b/storage/innodb_plugin/row/row0merge.c
526 row_merge_block_t. Thus, it must be able to hold one merge record,
527 whose maximum size is the same as the minimum size of
528 row_merge_block_t. */
529 -typedef byte mrec_buf_t[UNIV_PAGE_SIZE];
530 +typedef byte mrec_buf_t[UNIV_PAGE_SIZE_MAX];
532 /** @brief Merge record in row_merge_block_t.
534 --- a/storage/innodb_plugin/srv/srv0srv.c
535 +++ b/storage/innodb_plugin/srv/srv0srv.c
538 /* Switch to enable random read ahead. */
539 UNIV_INTERN my_bool srv_random_read_ahead = FALSE;
541 +/* The universal page size of the database */
542 +UNIV_INTERN ulint srv_page_size_shift = 0;
543 +UNIV_INTERN ulint srv_page_size = 0;
545 +/* The log block size */
546 +UNIV_INTERN ulint srv_log_block_size = 0;
548 /* User settable value of the number of pages that must be present
549 in the buffer cache and accessed sequentially for InnoDB to trigger a
550 readahead request. */
551 --- a/storage/innodb_plugin/srv/srv0start.c
552 +++ b/storage/innodb_plugin/srv/srv0start.c
553 @@ -1513,10 +1513,12 @@
555 #endif /* UNIV_LOG_ARCHIVE */
557 - if (srv_n_log_files * srv_log_file_size >= 262144) {
558 + if (sizeof(ulint) == 4
559 + && srv_n_log_files * srv_log_file_size
560 + >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
562 "InnoDB: Error: combined size of log files"
563 - " must be < 4 GB\n");
564 + " must be < 4 GB on 32-bit systems\n");
568 @@ -1525,7 +1527,7 @@
570 for (i = 0; i < srv_n_data_files; i++) {
572 - if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
573 + if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
575 "InnoDB: Error: file size must be < 4 GB"
576 " with this MySQL binary\n"