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 diff -ruN a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
9 --- a/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:21.358513751 +0900
10 +++ b/storage/innobase/fil/fil0fil.c 2010-12-04 15:55:58.243481131 +0900
12 ut_ad(ut_is_2pow(zip_size));
15 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
16 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
18 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
19 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
21 ut_ad(fil_validate());
22 #ifndef UNIV_HOTBACKUP
23 # ifndef UNIV_LOG_DEBUG
24 diff -ruN a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
25 --- a/storage/innobase/fsp/fsp0fsp.c 2010-12-04 15:52:23.411513754 +0900
26 +++ b/storage/innobase/fsp/fsp0fsp.c 2010-12-04 15:55:58.244514273 +0900
28 ulint offset) /*!< in: page offset */
30 #ifndef DOXYGEN /* Doxygen gets confused of these */
31 -# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
32 - + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
35 +//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
36 +// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
39 # if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
40 + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
44 + ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
45 ut_ad(ut_is_2pow(zip_size));
48 @@ -1464,12 +1465,12 @@
50 xdes_init(descr, mtr);
52 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
53 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
55 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
56 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
58 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
59 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
61 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
62 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
65 if (UNIV_UNLIKELY(init_xdes)) {
67 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
68 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:55:21.367482924 +0900
69 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:55:58.248549631 +0900
71 static ulong innobase_write_io_threads;
72 static long innobase_buffer_pool_instances = 1;
74 +static ulong innobase_page_size;
75 +static ulong innobase_log_block_size;
77 static my_bool innobase_thread_concurrency_timer_based;
78 static long long innobase_buffer_pool_size, innobase_log_file_size;
80 @@ -2269,6 +2272,62 @@
82 #endif /* UNIV_DEBUG */
85 + srv_page_size_shift = 0;
87 + if (innobase_page_size != (1 << 14)) {
91 + "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
92 + for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
93 + if (innobase_page_size == ((ulong)1 << n_shift)) {
94 + srv_page_size_shift = n_shift;
95 + srv_page_size = (1 << srv_page_size_shift);
97 + "InnoDB: The universal page size of the database is set to %lu.\n",
103 + srv_page_size_shift = 14;
104 + srv_page_size = (1 << srv_page_size_shift);
107 + if (!srv_page_size_shift) {
109 + "InnoDB: Error: %lu is not valid value for innodb_page_size.\n",
110 + innobase_page_size);
114 + srv_log_block_size = 0;
115 + if (innobase_log_block_size != (1 << 9)) { /*!=512*/
119 + "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
120 + for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
121 + if (innobase_log_block_size == ((ulong)1 << n_shift)) {
122 + srv_log_block_size = (1 << n_shift);
124 + "InnoDB: The log block size is set to %lu.\n",
125 + srv_log_block_size);
130 + srv_log_block_size = 512;
133 + if (!srv_log_block_size) {
135 + "InnoDB: Error: %lu is not valid value for innodb_log_block_size.\n",
136 + innobase_log_block_size);
141 innodb_overwrite_relay_log_info = FALSE;
143 @@ -7212,9 +7271,9 @@
146 << DICT_TF_FORMAT_SHIFT;
147 -#if DICT_TF_ZSSIZE_MAX < 1
148 -# error "DICT_TF_ZSSIZE_MAX < 1"
150 +//#if DICT_TF_ZSSIZE_MAX < 1
151 +//# error "DICT_TF_ZSSIZE_MAX < 1"
156 @@ -11332,6 +11391,16 @@
157 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
160 +static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
161 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
162 + "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
163 + NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
165 +static MYSQL_SYSVAR_ULONG(log_block_size, innobase_log_block_size,
166 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
167 + "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!",
168 + NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
170 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
172 "The common part for InnoDB table spaces.",
173 @@ -11839,6 +11908,8 @@
174 NULL, NULL, 0, 0, 1, 0);
176 static struct st_mysql_sys_var* innobase_system_variables[]= {
177 + MYSQL_SYSVAR(page_size),
178 + MYSQL_SYSVAR(log_block_size),
179 MYSQL_SYSVAR(additional_mem_pool_size),
180 MYSQL_SYSVAR(autoextend_increment),
181 MYSQL_SYSVAR(buffer_pool_size),
182 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
183 --- a/storage/innobase/include/buf0buf.h 2010-12-04 15:55:21.375482937 +0900
184 +++ b/storage/innobase/include/buf0buf.h 2010-12-04 15:55:58.258469088 +0900
185 @@ -1602,7 +1602,7 @@
186 time_t last_printout_time;
187 /*!< when buf_print_io was last time
189 - buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + 1];
190 + buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
191 /*!< Statistics of buddy system,
192 indexed by block size */
193 buf_pool_stat_t stat; /*!< current statistics */
194 @@ -1698,7 +1698,7 @@
196 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
197 /*!< unmodified compressed pages */
198 - UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
199 + UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
200 /*!< buddy free lists */
202 buf_page_t watch[BUF_POOL_WATCH_SIZE];
203 @@ -1706,9 +1706,9 @@
204 pool watches. Protected by
207 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
208 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
210 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
211 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
213 #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
214 # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
216 diff -ruN a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
217 --- a/storage/innobase/include/buf0types.h 2010-11-03 07:01:13.000000000 +0900
218 +++ b/storage/innobase/include/buf0types.h 2010-12-04 15:55:58.259482590 +0900
220 buddy system; must be at least
221 sizeof(buf_page_t) */
222 #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
223 +#define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
224 /*!< number of buddy sizes */
226 /** twice the maximum block size of the buddy system;
227 diff -ruN a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
228 --- a/storage/innobase/include/log0log.h 2010-11-03 07:01:13.000000000 +0900
229 +++ b/storage/innobase/include/log0log.h 2010-12-09 18:16:47.737728305 +0900
231 when mysqld is first time started
232 on the restored database, it can
233 print helpful info for the user */
234 +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
235 + /* extend to record log_block_size
236 + of XtraDB. 0 means default 512 */
237 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
238 /* this 4-byte field is TRUE when
239 the writing of an archived log file
240 diff -ruN a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic
241 --- a/storage/innobase/include/mtr0log.ic 2010-12-04 15:37:50.590551517 +0900
242 +++ b/storage/innobase/include/mtr0log.ic 2010-12-04 15:55:58.260482404 +0900
245 if ((space == TRX_SYS_SPACE
246 || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
247 - && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
248 + && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
249 if (trx_doublewrite_buf_is_being_created) {
250 /* Do nothing: we only come to this branch in an
251 InnoDB database creation. We do not redo log
252 diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
253 --- a/storage/innobase/include/os0file.h 2010-12-09 18:16:02.323727427 +0900
254 +++ b/storage/innobase/include/os0file.h 2010-12-09 18:16:47.738694194 +0900
256 if this fails for a log block, then it is equivalent to a media failure in the
259 -#define OS_FILE_LOG_BLOCK_SIZE 512
260 +#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
262 /** Options for file_create @{ */
263 #define OS_FILE_OPEN 51
265 extern ulint os_n_file_writes;
266 extern ulint os_n_fsyncs;
268 +extern ulint srv_log_block_size;
271 /* Keys to register InnoDB I/O with performance schema */
272 extern mysql_pfs_key_t innodb_file_data_key;
273 diff -ruN a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h
274 --- a/storage/innobase/include/page0types.h 2010-11-03 07:01:13.000000000 +0900
275 +++ b/storage/innobase/include/page0types.h 2010-12-04 15:55:58.261483930 +0900
278 /** Number of supported compressed page sizes */
279 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
280 -#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
281 -# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
282 +#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
283 +#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
284 +# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
287 /** Compressed page descriptor */
289 typedef struct page_zip_stat_struct page_zip_stat_t;
291 /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
292 -extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
293 +extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
295 /**********************************************************************//**
296 Write the "deleted" flag of a record on a compressed page. The flag must
297 diff -ruN a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
298 --- a/storage/innobase/include/trx0sys.h 2010-12-04 15:37:50.593480594 +0900
299 +++ b/storage/innobase/include/trx0sys.h 2010-12-04 15:55:58.262549554 +0900
301 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
302 #define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
304 -#if UNIV_PAGE_SIZE < 4096
305 -# error "UNIV_PAGE_SIZE < 4096"
307 +//#if UNIV_PAGE_SIZE < 4096
308 +//# error "UNIV_PAGE_SIZE < 4096"
310 /** The offset of the MySQL replication info in the trx system header;
311 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
312 #define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
313 diff -ruN a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
314 --- a/storage/innobase/include/univ.i 2010-11-03 07:01:13.000000000 +0900
315 +++ b/storage/innobase/include/univ.i 2010-12-04 15:55:58.263549721 +0900
319 /* The 2-logarithm of UNIV_PAGE_SIZE: */
320 -#define UNIV_PAGE_SIZE_SHIFT 14
321 +/* #define UNIV_PAGE_SIZE_SHIFT 14 */
322 +#define UNIV_PAGE_SIZE_SHIFT_MAX 14
323 +#define UNIV_PAGE_SIZE_SHIFT srv_page_size_shift
324 /* The universal page size of the database */
325 -#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT)
326 +/* #define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) */
327 +#define UNIV_PAGE_SIZE srv_page_size
328 +#define UNIV_PAGE_SIZE_MAX (1 << UNIV_PAGE_SIZE_SHIFT_MAX)
330 /* Maximum number of parallel threads in a parallelized operation */
331 #define UNIV_MAX_PARALLELISM 32
333 stored part of the field in the tablespace. The length field then
334 contains the sum of the following flag and the locally stored len. */
336 -#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
337 +#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
339 /* Some macros to improve branch prediction and reduce cache misses */
340 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
342 UNIV_MEM_ALLOC(addr, size); \
345 +extern ulint srv_page_size_shift;
346 +extern ulint srv_page_size;
348 diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
349 --- a/storage/innobase/log/log0log.c 2010-12-03 15:18:48.899986203 +0900
350 +++ b/storage/innobase/log/log0log.c 2010-12-04 15:55:58.266551567 +0900
353 offset = (gr_lsn_size_offset + difference) % group_size;
355 + if (sizeof(ulint) == 4) {
356 ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
360 "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
361 @@ -1200,6 +1202,9 @@
362 /* Wipe over possible label of ibbackup --restore */
363 memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
365 + mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
366 + srv_log_block_size);
368 dest_offset = nth_file * group->file_size;
371 @@ -1793,9 +1798,7 @@
374 ut_ad(mutex_own(&(log_sys->mutex)));
375 -#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
376 -# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
378 + ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
380 buf = group->checkpoint_buf;
382 @@ -1809,6 +1812,7 @@
383 mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
385 #ifdef UNIV_LOG_ARCHIVE
386 +#error "UNIV_LOG_ARCHIVE could not be enabled"
387 if (log_sys->archiving_state == LOG_ARCH_OFF) {
388 archived_lsn = IB_ULONGLONG_MAX;
390 @@ -1822,7 +1826,9 @@
392 mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
393 #else /* UNIV_LOG_ARCHIVE */
394 - mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
395 + mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN,
396 + (ib_uint64_t)log_group_calc_lsn_offset(
397 + log_sys->next_checkpoint_lsn, group));
398 #endif /* UNIV_LOG_ARCHIVE */
400 for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
401 diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
402 --- a/storage/innobase/log/log0recv.c 2010-12-03 17:32:15.638986405 +0900
403 +++ b/storage/innobase/log/log0recv.c 2010-12-04 15:55:58.269550689 +0900
406 group->lsn = mach_read_from_8(
407 buf + LOG_CHECKPOINT_LSN);
409 +#ifdef UNIV_LOG_ARCHIVE
410 +#error "UNIV_LOG_ARCHIVE could not be enabled"
413 + ib_uint64_t tmp_lsn_offset = mach_read_from_8(
414 + buf + LOG_CHECKPOINT_ARCHIVED_LSN);
415 + if (sizeof(ulint) != 4
416 + && tmp_lsn_offset != IB_ULONGLONG_MAX) {
417 + group->lsn_offset = (ulint) tmp_lsn_offset;
419 group->lsn_offset = mach_read_from_4(
420 buf + LOG_CHECKPOINT_OFFSET);
424 checkpoint_no = mach_read_from_8(
425 buf + LOG_CHECKPOINT_NO);
427 @@ -2955,6 +2969,7 @@
428 log_group_t* max_cp_group;
429 log_group_t* up_to_date_group;
431 + ulint log_hdr_log_block_size;
432 ib_uint64_t checkpoint_lsn;
433 ib_uint64_t checkpoint_no;
434 ib_uint64_t old_scanned_lsn;
435 @@ -3056,6 +3071,20 @@
436 log_hdr_buf, max_cp_group);
439 + log_hdr_log_block_size
440 + = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
441 + if (log_hdr_log_block_size == 0) {
442 + /* 0 means default value */
443 + log_hdr_log_block_size = 512;
445 + if (log_hdr_log_block_size != srv_log_block_size) {
447 + "InnoDB: Error: The block size of ib_logfile (%lu) "
448 + "is not equal to innodb_log_block_size.\n",
449 + log_hdr_log_block_size);
453 #ifdef UNIV_LOG_ARCHIVE
454 group = UT_LIST_GET_FIRST(log_sys->log_groups);
456 diff -ruN a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
457 --- a/storage/innobase/page/page0zip.c 2010-12-04 15:52:23.484482786 +0900
458 +++ b/storage/innobase/page/page0zip.c 2010-12-04 15:55:58.274551431 +0900
461 #ifndef UNIV_HOTBACKUP
462 /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
463 -UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
464 +UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
465 #endif /* !UNIV_HOTBACKUP */
467 /* Please refer to ../include/page0zip.ic for a description of the
468 diff -ruN a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
469 --- a/storage/innobase/row/row0merge.c 2010-12-04 15:52:23.490513562 +0900
470 +++ b/storage/innobase/row/row0merge.c 2010-12-04 15:55:58.277550562 +0900
472 row_merge_block_t. Thus, it must be able to hold one merge record,
473 whose maximum size is the same as the minimum size of
474 row_merge_block_t. */
475 -typedef byte mrec_buf_t[UNIV_PAGE_SIZE];
476 +typedef byte mrec_buf_t[UNIV_PAGE_SIZE_MAX];
478 /** @brief Merge record in row_merge_block_t.
480 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
481 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:21.384486344 +0900
482 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:58.282550845 +0900
484 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
485 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
487 +/* The universal page size of the database */
488 +UNIV_INTERN ulint srv_page_size_shift = 0;
489 +UNIV_INTERN ulint srv_page_size = 0;
491 +/* The log block size */
492 +UNIV_INTERN ulint srv_log_block_size = 0;
494 /* User settable value of the number of pages that must be present
495 in the buffer cache and accessed sequentially for InnoDB to trigger a
496 readahead request. */
497 diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
498 --- a/storage/innobase/srv/srv0start.c 2010-12-04 15:52:23.502513556 +0900
499 +++ b/storage/innobase/srv/srv0start.c 2010-12-04 15:55:58.285550583 +0900
500 @@ -1521,10 +1521,12 @@
502 #endif /* UNIV_LOG_ARCHIVE */
504 - if (srv_n_log_files * srv_log_file_size >= 262144) {
505 + if (sizeof(ulint) == 4
506 + && srv_n_log_files * srv_log_file_size
507 + >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
509 "InnoDB: Error: combined size of log files"
510 - " must be < 4 GB\n");
511 + " must be < 4 GB on 32-bit systems\n");
515 @@ -1533,7 +1535,7 @@
517 for (i = 0; i < srv_n_data_files; i++) {
519 - if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
520 + if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
522 "InnoDB: Error: file size must be < 4 GB"
523 " with this MySQL binary\n"