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/innobase/fil/fil0fil.c
9 +++ b/storage/innobase/fil/fil0fil.c
11 ut_a(space->purpose != FIL_LOG);
12 ut_a(!trx_sys_sys_space(space->id));
14 - if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
15 + if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
17 "InnoDB: Error: the size of single-table"
18 " tablespace file %s\n"
21 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
22 #ifndef UNIV_HOTBACKUP
23 - if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
24 + if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
26 "InnoDB: Error: the size of single-table tablespace"
29 /* Align the memory for file i/o if we might have O_DIRECT set */
30 page = ut_align(buf2, UNIV_PAGE_SIZE);
32 - if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
33 + if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
34 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
36 /* We have to read the tablespace id from the file */
38 ut_ad(ut_is_2pow(zip_size));
41 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
42 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
44 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
45 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
47 ut_ad(fil_validate_skip());
48 #ifndef UNIV_HOTBACKUP
49 # ifndef UNIV_LOG_DEBUG
50 --- a/storage/innobase/fsp/fsp0fsp.c
51 +++ b/storage/innobase/fsp/fsp0fsp.c
53 0 for uncompressed pages */
54 ulint offset) /*!< in: page offset */
56 -#ifndef DOXYGEN /* Doxygen gets confused of these */
57 -# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
58 - + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
61 -# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
62 - + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
65 -#endif /* !DOXYGEN */
66 +//#ifndef DOXYGEN /* Doxygen gets confused of these */
67 +//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
68 +// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
71 +//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
72 +// + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
75 +//#endif /* !DOXYGEN */
76 + ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
77 + ut_a(PAGE_ZIP_MIN_SIZE > XDES_ARR_OFFSET + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
78 ut_ad(ut_is_2pow(zip_size));
81 @@ -1464,12 +1466,12 @@
83 xdes_init(descr, mtr);
85 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
86 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
88 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
89 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
91 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
92 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
94 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
95 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
98 if (UNIV_UNLIKELY(init_xdes)) {
100 --- a/storage/innobase/handler/ha_innodb.cc
101 +++ b/storage/innobase/handler/ha_innodb.cc
103 static ulong innobase_write_io_threads;
104 static long innobase_buffer_pool_instances = 1;
106 +static ulong innobase_page_size;
107 +static ulong innobase_log_block_size;
109 static my_bool innobase_thread_concurrency_timer_based;
110 static long long innobase_buffer_pool_size, innobase_log_file_size;
112 @@ -2321,6 +2324,65 @@
114 #endif /* DBUG_OFF */
117 + srv_page_size_shift = 0;
119 + if (innobase_page_size != (1 << 14)) {
123 + "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
124 + for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
125 + if (innobase_page_size == ((ulong)1 << n_shift)) {
126 + srv_page_size_shift = n_shift;
127 + srv_page_size = (1 << srv_page_size_shift);
129 + "InnoDB: The universal page size of the database is set to %lu.\n",
135 + srv_page_size_shift = 14;
136 + srv_page_size = (1 << srv_page_size_shift);
139 + if (!srv_page_size_shift) {
141 + "InnoDB: Error: %lu is not a valid value for innodb_page_size.\n"
142 + "InnoDB: Error: Valid values are 4096, 8192, and 16384 (default=16384).\n",
143 + innobase_page_size);
147 + srv_log_block_size = 0;
148 + if (innobase_log_block_size != (1 << 9)) { /*!=512*/
152 + "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
153 + for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
154 + if (innobase_log_block_size == ((ulong)1 << n_shift)) {
155 + srv_log_block_size = (1 << n_shift);
157 + "InnoDB: The log block size is set to %lu.\n",
158 + srv_log_block_size);
163 + srv_log_block_size = 512;
166 + if (!srv_log_block_size) {
168 + "InnoDB: Error: %lu is not a valid value for innodb_log_block_size.\n"
169 + "InnoDB: Error: A valid value for innodb_log_block_size is\n"
170 + "InnoDB: Error: a power of 2 from 512 to 16384.\n",
171 + innobase_log_block_size);
176 innodb_overwrite_relay_log_info = FALSE;
178 @@ -7252,9 +7314,9 @@
181 << DICT_TF_FORMAT_SHIFT;
182 -#if DICT_TF_ZSSIZE_MAX < 1
183 -# error "DICT_TF_ZSSIZE_MAX < 1"
185 +//#if DICT_TF_ZSSIZE_MAX < 1
186 +//# error "DICT_TF_ZSSIZE_MAX < 1"
191 @@ -11443,6 +11505,16 @@
192 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
195 +static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
196 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
197 + "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
198 + NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
200 +static MYSQL_SYSVAR_ULONG(log_block_size, innobase_log_block_size,
201 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
202 + "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!",
203 + NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
205 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
207 "The common part for InnoDB table spaces.",
208 @@ -11952,6 +12024,8 @@
209 NULL, NULL, 0, &corrupt_table_action_typelib);
211 static struct st_mysql_sys_var* innobase_system_variables[]= {
212 + MYSQL_SYSVAR(page_size),
213 + MYSQL_SYSVAR(log_block_size),
214 MYSQL_SYSVAR(additional_mem_pool_size),
215 MYSQL_SYSVAR(autoextend_increment),
216 MYSQL_SYSVAR(buffer_pool_size),
217 --- a/storage/innobase/include/buf0buf.h
218 +++ b/storage/innobase/include/buf0buf.h
219 @@ -1722,7 +1722,7 @@
220 time_t last_printout_time;
221 /*!< when buf_print_io was last time
223 - buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + 1];
224 + buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
225 /*!< Statistics of buddy system,
226 indexed by block size */
227 buf_pool_stat_t stat; /*!< current statistics */
228 @@ -1820,7 +1820,7 @@
229 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
230 /*!< unmodified compressed pages */
231 #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
232 - UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
233 + UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
234 /*!< buddy free lists */
236 buf_page_t watch[BUF_POOL_WATCH_SIZE];
237 @@ -1828,9 +1828,9 @@
238 pool watches. Protected by
241 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
242 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
244 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
245 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
247 #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
248 # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
250 --- a/storage/innobase/include/buf0types.h
251 +++ b/storage/innobase/include/buf0types.h
253 #define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT)
255 #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
256 +#define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
257 /*!< number of buddy sizes */
259 /** twice the maximum block size of the buddy system;
260 the underlying memory is aligned by this amount:
261 this must be equal to UNIV_PAGE_SIZE */
262 -#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
263 +#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
267 --- a/storage/innobase/include/fsp0types.h
268 +++ b/storage/innobase/include/fsp0types.h
272 /** File space extent size (one megabyte) in pages */
273 -#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
274 +#define FSP_EXTENT_SIZE ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT))
276 /** On a page of any file segment, data may be put starting from this
278 --- a/storage/innobase/include/log0log.h
279 +++ b/storage/innobase/include/log0log.h
281 when mysqld is first time started
282 on the restored database, it can
283 print helpful info for the user */
284 +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
285 + /* extend to record log_block_size
286 + of XtraDB. 0 means default 512 */
287 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
288 /* this 4-byte field is TRUE when
289 the writing of an archived log file
290 --- a/storage/innobase/include/mtr0log.ic
291 +++ b/storage/innobase/include/mtr0log.ic
294 if ((space == TRX_SYS_SPACE
295 || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
296 - && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
297 + && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
298 if (trx_doublewrite_buf_is_being_created) {
299 /* Do nothing: we only come to this branch in an
300 InnoDB database creation. We do not redo log
301 --- a/storage/innobase/include/os0file.h
302 +++ b/storage/innobase/include/os0file.h
304 if this fails for a log block, then it is equivalent to a media failure in the
307 -#define OS_FILE_LOG_BLOCK_SIZE 512
308 +#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
310 /** Options for file_create @{ */
311 #define OS_FILE_OPEN 51
313 extern ulint os_n_file_writes;
314 extern ulint os_n_fsyncs;
316 +extern ulint srv_log_block_size;
319 /* Keys to register InnoDB I/O with performance schema */
320 extern mysql_pfs_key_t innodb_file_data_key;
321 --- a/storage/innobase/include/page0types.h
322 +++ b/storage/innobase/include/page0types.h
325 /** Number of supported compressed page sizes */
326 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
327 -#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
328 -# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
329 +#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
330 +#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
331 +# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
334 /** Compressed page descriptor */
336 typedef struct page_zip_stat_struct page_zip_stat_t;
338 /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
339 -extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
340 +extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
342 /**********************************************************************//**
343 Write the "deleted" flag of a record on a compressed page. The flag must
344 --- a/storage/innobase/include/trx0sys.h
345 +++ b/storage/innobase/include/trx0sys.h
347 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
348 #define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
350 -#if UNIV_PAGE_SIZE < 4096
351 -# error "UNIV_PAGE_SIZE < 4096"
353 +//#if UNIV_PAGE_SIZE < 4096
354 +//# error "UNIV_PAGE_SIZE < 4096"
356 /** The offset of the MySQL replication info in the trx system header;
357 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
358 #define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
359 --- a/storage/innobase/include/univ.i
360 +++ b/storage/innobase/include/univ.i
364 /* The 2-logarithm of UNIV_PAGE_SIZE: */
365 -#define UNIV_PAGE_SIZE_SHIFT 14
366 +/* #define UNIV_PAGE_SIZE_SHIFT 14 */
367 +#define UNIV_PAGE_SIZE_SHIFT_MAX 14
368 +#define UNIV_PAGE_SIZE_SHIFT srv_page_size_shift
369 /* The universal page size of the database */
370 -#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT)
371 +/* #define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) */
372 +#define UNIV_PAGE_SIZE srv_page_size
373 +#define UNIV_PAGE_SIZE_MAX (1 << UNIV_PAGE_SIZE_SHIFT_MAX)
375 /* Maximum number of parallel threads in a parallelized operation */
376 #define UNIV_MAX_PARALLELISM 32
378 stored part of the field in the tablespace. The length field then
379 contains the sum of the following flag and the locally stored len. */
381 -#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
382 +#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
384 /* Some macros to improve branch prediction and reduce cache misses */
385 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
387 UNIV_MEM_ALLOC(addr, size); \
390 +extern ulint srv_page_size_shift;
391 +extern ulint srv_page_size;
393 --- a/storage/innobase/log/log0log.c
394 +++ b/storage/innobase/log/log0log.c
397 offset = (gr_lsn_size_offset + difference) % group_size;
399 + if (sizeof(ulint) == 4) {
400 ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
404 "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
405 @@ -1201,6 +1203,9 @@
406 /* Wipe over possible label of ibbackup --restore */
407 memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
409 + mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
410 + srv_log_block_size);
412 dest_offset = nth_file * group->file_size;
415 @@ -1794,9 +1799,7 @@
418 ut_ad(mutex_own(&(log_sys->mutex)));
419 -#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
420 -# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
422 + ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
424 buf = group->checkpoint_buf;
426 @@ -1810,6 +1813,7 @@
427 mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
429 #ifdef UNIV_LOG_ARCHIVE
430 +#error "UNIV_LOG_ARCHIVE could not be enabled"
431 if (log_sys->archiving_state == LOG_ARCH_OFF) {
432 archived_lsn = IB_ULONGLONG_MAX;
434 @@ -1823,7 +1827,9 @@
436 mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
437 #else /* UNIV_LOG_ARCHIVE */
438 - mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
439 + mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN,
440 + (ib_uint64_t)log_group_calc_lsn_offset(
441 + log_sys->next_checkpoint_lsn, group));
442 #endif /* UNIV_LOG_ARCHIVE */
444 for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
445 --- a/storage/innobase/log/log0recv.c
446 +++ b/storage/innobase/log/log0recv.c
449 group->lsn = mach_read_from_8(
450 buf + LOG_CHECKPOINT_LSN);
452 +#ifdef UNIV_LOG_ARCHIVE
453 +#error "UNIV_LOG_ARCHIVE could not be enabled"
456 + ib_uint64_t tmp_lsn_offset = mach_read_from_8(
457 + buf + LOG_CHECKPOINT_ARCHIVED_LSN);
458 + if (sizeof(ulint) != 4
459 + && tmp_lsn_offset != IB_ULONGLONG_MAX) {
460 + group->lsn_offset = (ulint) tmp_lsn_offset;
462 group->lsn_offset = mach_read_from_4(
463 buf + LOG_CHECKPOINT_OFFSET);
467 checkpoint_no = mach_read_from_8(
468 buf + LOG_CHECKPOINT_NO);
470 @@ -2955,6 +2969,7 @@
471 log_group_t* max_cp_group;
472 log_group_t* up_to_date_group;
474 + ulint log_hdr_log_block_size;
475 ib_uint64_t checkpoint_lsn;
476 ib_uint64_t checkpoint_no;
477 ib_uint64_t old_scanned_lsn;
478 @@ -3056,6 +3071,21 @@
479 log_hdr_buf, max_cp_group);
482 + log_hdr_log_block_size
483 + = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
484 + if (log_hdr_log_block_size == 0) {
485 + /* 0 means default value */
486 + log_hdr_log_block_size = 512;
488 + if (log_hdr_log_block_size != srv_log_block_size) {
490 + "InnoDB: Error: The block size of ib_logfile (%lu) "
491 + "is not equal to innodb_log_block_size.\n"
492 + "InnoDB: Error: Suggestion - Recreate log files.\n",
493 + log_hdr_log_block_size);
497 #ifdef UNIV_LOG_ARCHIVE
498 group = UT_LIST_GET_FIRST(log_sys->log_groups);
500 --- a/storage/innobase/page/page0zip.c
501 +++ b/storage/innobase/page/page0zip.c
504 #ifndef UNIV_HOTBACKUP
505 /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
506 -UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
507 +UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
508 #endif /* !UNIV_HOTBACKUP */
510 /* Please refer to ../include/page0zip.ic for a description of the
511 --- a/storage/innobase/row/row0merge.c
512 +++ b/storage/innobase/row/row0merge.c
514 row_merge_block_t. Thus, it must be able to hold one merge record,
515 whose maximum size is the same as the minimum size of
516 row_merge_block_t. */
517 -typedef byte mrec_buf_t[UNIV_PAGE_SIZE];
518 +typedef byte mrec_buf_t[UNIV_PAGE_SIZE_MAX];
520 /** @brief Merge record in row_merge_block_t.
522 --- a/storage/innobase/srv/srv0srv.c
523 +++ b/storage/innobase/srv/srv0srv.c
525 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
526 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
528 +/* The universal page size of the database */
529 +UNIV_INTERN ulint srv_page_size_shift = 0;
530 +UNIV_INTERN ulint srv_page_size = 0;
532 +/* The log block size */
533 +UNIV_INTERN ulint srv_log_block_size = 0;
535 /* User settable value of the number of pages that must be present
536 in the buffer cache and accessed sequentially for InnoDB to trigger a
537 readahead request. */
538 --- a/storage/innobase/srv/srv0start.c
539 +++ b/storage/innobase/srv/srv0start.c
540 @@ -1561,11 +1561,13 @@
542 #endif /* UNIV_LOG_ARCHIVE */
544 - if (srv_n_log_files * srv_log_file_size >= 262144) {
545 + if (sizeof(ulint) == 4
546 + && srv_n_log_files * srv_log_file_size
547 + >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
548 ut_print_timestamp(stderr);
550 " InnoDB: Error: combined size of log files"
551 - " must be < 4 GB\n");
552 + " must be < 4 GB on 32-bit systems\n");
556 @@ -1574,7 +1576,7 @@
558 for (i = 0; i < srv_n_data_files; i++) {
560 - if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
561 + if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
562 ut_print_timestamp(stderr);
564 " InnoDB: Error: file size must be < 4 GB"