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_a(space->purpose != FIL_LOG);
13 ut_a(!trx_sys_sys_space(space->id));
15 - if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
16 + if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
18 "InnoDB: Error: the size of single-table"
19 " tablespace file %s\n"
22 if (size_bytes < free_limit_bytes) {
23 free_limit_bytes = size_bytes;
24 - if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) {
25 + if (size_bytes >= (lint)FSP_EXTENT_SIZE * (lint)UNIV_PAGE_SIZE) {
26 fprintf(stderr, "InnoDB: free limit of %s is larger than its real size.\n", filepath);
27 file_is_corrupt = TRUE;
31 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
32 #ifndef UNIV_HOTBACKUP
33 - if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
34 + if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
36 "InnoDB: Error: the size of single-table tablespace"
39 /* Align the memory for file i/o if we might have O_DIRECT set */
40 page = ut_align(buf2, UNIV_PAGE_SIZE);
42 - if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
43 + if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
44 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
46 /* We have to read the tablespace id from the file */
48 ut_ad(ut_is_2pow(zip_size));
51 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
52 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
54 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
55 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
57 ut_ad(fil_validate_skip());
58 #ifndef UNIV_HOTBACKUP
59 # ifndef UNIV_LOG_DEBUG
60 diff -ruN a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
61 --- a/storage/innobase/fsp/fsp0fsp.c 2010-12-04 15:52:23.411513754 +0900
62 +++ b/storage/innobase/fsp/fsp0fsp.c 2010-12-04 15:55:58.244514273 +0900
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 @@ -1464,12 +1466,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 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
112 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:55:21.367482924 +0900
113 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:55:58.248549631 +0900
115 static ulong innobase_write_io_threads;
116 static long innobase_buffer_pool_instances = 1;
118 +static ulong innobase_page_size;
119 +static ulong innobase_log_block_size;
121 static my_bool innobase_thread_concurrency_timer_based;
122 static long long innobase_buffer_pool_size, innobase_log_file_size;
124 @@ -2270,6 +2273,65 @@
126 #endif /* DBUG_OFF */
129 + srv_page_size_shift = 0;
131 + if (innobase_page_size != (1 << 14)) {
135 + "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
136 + for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
137 + if (innobase_page_size == ((ulong)1 << n_shift)) {
138 + srv_page_size_shift = n_shift;
139 + srv_page_size = (1 << srv_page_size_shift);
141 + "InnoDB: The universal page size of the database is set to %lu.\n",
147 + srv_page_size_shift = 14;
148 + srv_page_size = (1 << srv_page_size_shift);
151 + if (!srv_page_size_shift) {
153 + "InnoDB: Error: %lu is not a valid value for innodb_page_size.\n"
154 + "InnoDB: Error: Valid values are 4096, 8192, and 16384 (default=16384).\n",
155 + innobase_page_size);
159 + srv_log_block_size = 0;
160 + if (innobase_log_block_size != (1 << 9)) { /*!=512*/
164 + "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
165 + for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
166 + if (innobase_log_block_size == ((ulong)1 << n_shift)) {
167 + srv_log_block_size = (1 << n_shift);
169 + "InnoDB: The log block size is set to %lu.\n",
170 + srv_log_block_size);
175 + srv_log_block_size = 512;
178 + if (!srv_log_block_size) {
180 + "InnoDB: Error: %lu is not a valid value for innodb_log_block_size.\n"
181 + "InnoDB: Error: A valid value for innodb_log_block_size is\n"
182 + "InnoDB: Error: a power of 2 from 512 to 16384.\n",
183 + innobase_log_block_size);
188 innodb_overwrite_relay_log_info = FALSE;
190 @@ -7222,9 +7284,9 @@
193 << DICT_TF_FORMAT_SHIFT;
194 -#if DICT_TF_ZSSIZE_MAX < 1
195 -# error "DICT_TF_ZSSIZE_MAX < 1"
197 +//#if DICT_TF_ZSSIZE_MAX < 1
198 +//# error "DICT_TF_ZSSIZE_MAX < 1"
203 @@ -11335,6 +11397,16 @@
204 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
207 +static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
208 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
209 + "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
210 + NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
212 +static MYSQL_SYSVAR_ULONG(log_block_size, innobase_log_block_size,
213 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
214 + "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!",
215 + NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
217 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
219 "The common part for InnoDB table spaces.",
220 @@ -11837,6 +11909,8 @@
221 NULL, NULL, 0, 0, 1, 0);
223 static struct st_mysql_sys_var* innobase_system_variables[]= {
224 + MYSQL_SYSVAR(page_size),
225 + MYSQL_SYSVAR(log_block_size),
226 MYSQL_SYSVAR(additional_mem_pool_size),
227 MYSQL_SYSVAR(autoextend_increment),
228 MYSQL_SYSVAR(buffer_pool_size),
229 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
230 --- a/storage/innobase/include/buf0buf.h 2010-12-04 15:55:21.375482937 +0900
231 +++ b/storage/innobase/include/buf0buf.h 2010-12-04 15:55:58.258469088 +0900
232 @@ -1682,7 +1682,7 @@
233 time_t last_printout_time;
234 /*!< when buf_print_io was last time
236 - buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + 1];
237 + buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
238 /*!< Statistics of buddy system,
239 indexed by block size */
240 buf_pool_stat_t stat; /*!< current statistics */
241 @@ -1778,7 +1778,7 @@
243 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
244 /*!< unmodified compressed pages */
245 - UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
246 + UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
247 /*!< buddy free lists */
249 buf_page_t watch[BUF_POOL_WATCH_SIZE];
250 @@ -1786,9 +1786,9 @@
251 pool watches. Protected by
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 diff -ruN a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
264 --- a/storage/innobase/include/buf0types.h 2010-11-03 07:01:13.000000000 +0900
265 +++ b/storage/innobase/include/buf0types.h 2010-12-04 15:55:58.259482590 +0900
267 buddy system; must be at least
268 sizeof(buf_page_t) */
269 #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
270 +#define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
271 /*!< number of buddy sizes */
273 /** twice the maximum block size of the buddy system;
274 the underlying memory is aligned by this amount:
275 this must be equal to UNIV_PAGE_SIZE */
276 -#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
277 +#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
281 diff -ruN a/storage/innobase/include/fsp0types.h b/storage/innobase/include/fsp0types.h
282 --- a/storage/innobase/include/fsp0types.h 2010-12-04 02:58:26.000000000 +0900
283 +++ b/storage/innobase/include/fsp0types.h 2011-02-03 15:14:21.000000000 +0900
287 /** File space extent size (one megabyte) in pages */
288 -#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
289 +#define FSP_EXTENT_SIZE ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT))
291 /** On a page of any file segment, data may be put starting from this
293 diff -ruN a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
294 --- a/storage/innobase/include/log0log.h 2010-11-03 07:01:13.000000000 +0900
295 +++ b/storage/innobase/include/log0log.h 2010-12-09 18:16:47.737728305 +0900
297 when mysqld is first time started
298 on the restored database, it can
299 print helpful info for the user */
300 +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
301 + /* extend to record log_block_size
302 + of XtraDB. 0 means default 512 */
303 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
304 /* this 4-byte field is TRUE when
305 the writing of an archived log file
306 diff -ruN a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic
307 --- a/storage/innobase/include/mtr0log.ic 2010-12-04 15:37:50.590551517 +0900
308 +++ b/storage/innobase/include/mtr0log.ic 2010-12-04 15:55:58.260482404 +0900
311 if ((space == TRX_SYS_SPACE
312 || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
313 - && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
314 + && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
315 if (trx_doublewrite_buf_is_being_created) {
316 /* Do nothing: we only come to this branch in an
317 InnoDB database creation. We do not redo log
318 diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
319 --- a/storage/innobase/include/os0file.h 2010-12-09 18:16:02.323727427 +0900
320 +++ b/storage/innobase/include/os0file.h 2010-12-09 18:16:47.738694194 +0900
322 if this fails for a log block, then it is equivalent to a media failure in the
325 -#define OS_FILE_LOG_BLOCK_SIZE 512
326 +#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
328 /** Options for file_create @{ */
329 #define OS_FILE_OPEN 51
331 extern ulint os_n_file_writes;
332 extern ulint os_n_fsyncs;
334 +extern ulint srv_log_block_size;
337 /* Keys to register InnoDB I/O with performance schema */
338 extern mysql_pfs_key_t innodb_file_data_key;
339 diff -ruN a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h
340 --- a/storage/innobase/include/page0types.h 2010-11-03 07:01:13.000000000 +0900
341 +++ b/storage/innobase/include/page0types.h 2010-12-04 15:55:58.261483930 +0900
344 /** Number of supported compressed page sizes */
345 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
346 -#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
347 -# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
348 +#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
349 +#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
350 +# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
353 /** Compressed page descriptor */
355 typedef struct page_zip_stat_struct page_zip_stat_t;
357 /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
358 -extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
359 +extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
361 /**********************************************************************//**
362 Write the "deleted" flag of a record on a compressed page. The flag must
363 diff -ruN a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
364 --- a/storage/innobase/include/trx0sys.h 2010-12-04 15:37:50.593480594 +0900
365 +++ b/storage/innobase/include/trx0sys.h 2010-12-04 15:55:58.262549554 +0900
367 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
368 #define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
370 -#if UNIV_PAGE_SIZE < 4096
371 -# error "UNIV_PAGE_SIZE < 4096"
373 +//#if UNIV_PAGE_SIZE < 4096
374 +//# error "UNIV_PAGE_SIZE < 4096"
376 /** The offset of the MySQL replication info in the trx system header;
377 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
378 #define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
379 diff -ruN a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
380 --- a/storage/innobase/include/univ.i 2010-11-03 07:01:13.000000000 +0900
381 +++ b/storage/innobase/include/univ.i 2010-12-04 15:55:58.263549721 +0900
385 /* The 2-logarithm of UNIV_PAGE_SIZE: */
386 -#define UNIV_PAGE_SIZE_SHIFT 14
387 +/* #define UNIV_PAGE_SIZE_SHIFT 14 */
388 +#define UNIV_PAGE_SIZE_SHIFT_MAX 14
389 +#define UNIV_PAGE_SIZE_SHIFT srv_page_size_shift
390 /* The universal page size of the database */
391 -#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT)
392 +/* #define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) */
393 +#define UNIV_PAGE_SIZE srv_page_size
394 +#define UNIV_PAGE_SIZE_MAX (1 << UNIV_PAGE_SIZE_SHIFT_MAX)
396 /* Maximum number of parallel threads in a parallelized operation */
397 #define UNIV_MAX_PARALLELISM 32
399 stored part of the field in the tablespace. The length field then
400 contains the sum of the following flag and the locally stored len. */
402 -#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
403 +#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
405 /* Some macros to improve branch prediction and reduce cache misses */
406 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
408 UNIV_MEM_ALLOC(addr, size); \
411 +extern ulint srv_page_size_shift;
412 +extern ulint srv_page_size;
414 diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
415 --- a/storage/innobase/log/log0log.c 2010-12-03 15:18:48.899986203 +0900
416 +++ b/storage/innobase/log/log0log.c 2010-12-04 15:55:58.266551567 +0900
419 offset = (gr_lsn_size_offset + difference) % group_size;
421 + if (sizeof(ulint) == 4) {
422 ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
426 "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
427 @@ -1201,6 +1203,9 @@
428 /* Wipe over possible label of ibbackup --restore */
429 memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4);
431 + mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
432 + srv_log_block_size);
434 dest_offset = nth_file * group->file_size;
437 @@ -1794,9 +1799,7 @@
440 ut_ad(mutex_own(&(log_sys->mutex)));
441 -#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE
442 -# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE"
444 + ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
446 buf = group->checkpoint_buf;
448 @@ -1810,6 +1813,7 @@
449 mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
451 #ifdef UNIV_LOG_ARCHIVE
452 +#error "UNIV_LOG_ARCHIVE could not be enabled"
453 if (log_sys->archiving_state == LOG_ARCH_OFF) {
454 archived_lsn = IB_ULONGLONG_MAX;
456 @@ -1823,7 +1827,9 @@
458 mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
459 #else /* UNIV_LOG_ARCHIVE */
460 - mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
461 + mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN,
462 + (ib_uint64_t)log_group_calc_lsn_offset(
463 + log_sys->next_checkpoint_lsn, group));
464 #endif /* UNIV_LOG_ARCHIVE */
466 for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
467 diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
468 --- a/storage/innobase/log/log0recv.c 2010-12-03 17:32:15.638986405 +0900
469 +++ b/storage/innobase/log/log0recv.c 2010-12-04 15:55:58.269550689 +0900
472 group->lsn = mach_read_from_8(
473 buf + LOG_CHECKPOINT_LSN);
475 +#ifdef UNIV_LOG_ARCHIVE
476 +#error "UNIV_LOG_ARCHIVE could not be enabled"
479 + ib_uint64_t tmp_lsn_offset = mach_read_from_8(
480 + buf + LOG_CHECKPOINT_ARCHIVED_LSN);
481 + if (sizeof(ulint) != 4
482 + && tmp_lsn_offset != IB_ULONGLONG_MAX) {
483 + group->lsn_offset = (ulint) tmp_lsn_offset;
485 group->lsn_offset = mach_read_from_4(
486 buf + LOG_CHECKPOINT_OFFSET);
490 checkpoint_no = mach_read_from_8(
491 buf + LOG_CHECKPOINT_NO);
493 @@ -2955,6 +2969,7 @@
494 log_group_t* max_cp_group;
495 log_group_t* up_to_date_group;
497 + ulint log_hdr_log_block_size;
498 ib_uint64_t checkpoint_lsn;
499 ib_uint64_t checkpoint_no;
500 ib_uint64_t old_scanned_lsn;
501 @@ -3056,6 +3071,21 @@
502 log_hdr_buf, max_cp_group);
505 + log_hdr_log_block_size
506 + = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
507 + if (log_hdr_log_block_size == 0) {
508 + /* 0 means default value */
509 + log_hdr_log_block_size = 512;
511 + if (log_hdr_log_block_size != srv_log_block_size) {
513 + "InnoDB: Error: The block size of ib_logfile (%lu) "
514 + "is not equal to innodb_log_block_size.\n"
515 + "InnoDB: Error: Suggestion - Recreate log files.\n",
516 + log_hdr_log_block_size);
520 #ifdef UNIV_LOG_ARCHIVE
521 group = UT_LIST_GET_FIRST(log_sys->log_groups);
523 diff -ruN a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
524 --- a/storage/innobase/page/page0zip.c 2010-12-04 15:52:23.484482786 +0900
525 +++ b/storage/innobase/page/page0zip.c 2010-12-04 15:55:58.274551431 +0900
528 #ifndef UNIV_HOTBACKUP
529 /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
530 -UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
531 +UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
532 #endif /* !UNIV_HOTBACKUP */
534 /* Please refer to ../include/page0zip.ic for a description of the
535 diff -ruN a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
536 --- a/storage/innobase/row/row0merge.c 2010-12-04 15:52:23.490513562 +0900
537 +++ b/storage/innobase/row/row0merge.c 2010-12-04 15:55:58.277550562 +0900
539 row_merge_block_t. Thus, it must be able to hold one merge record,
540 whose maximum size is the same as the minimum size of
541 row_merge_block_t. */
542 -typedef byte mrec_buf_t[UNIV_PAGE_SIZE];
543 +typedef byte mrec_buf_t[UNIV_PAGE_SIZE_MAX];
545 /** @brief Merge record in row_merge_block_t.
547 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
548 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:21.384486344 +0900
549 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:58.282550845 +0900
551 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
552 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
554 +/* The universal page size of the database */
555 +UNIV_INTERN ulint srv_page_size_shift = 0;
556 +UNIV_INTERN ulint srv_page_size = 0;
558 +/* The log block size */
559 +UNIV_INTERN ulint srv_log_block_size = 0;
561 /* User settable value of the number of pages that must be present
562 in the buffer cache and accessed sequentially for InnoDB to trigger a
563 readahead request. */
564 diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
565 --- a/storage/innobase/srv/srv0start.c 2010-12-04 15:52:23.502513556 +0900
566 +++ b/storage/innobase/srv/srv0start.c 2010-12-04 15:55:58.285550583 +0900
567 @@ -1553,11 +1553,13 @@
569 #endif /* UNIV_LOG_ARCHIVE */
571 - if (srv_n_log_files * srv_log_file_size >= 262144) {
572 + if (sizeof(ulint) == 4
573 + && srv_n_log_files * srv_log_file_size
574 + >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
575 ut_print_timestamp(stderr);
577 " InnoDB: Error: combined size of log files"
578 - " must be < 4 GB\n");
579 + " must be < 4 GB on 32-bit systems\n");
583 @@ -1566,7 +1568,7 @@
585 for (i = 0; i < srv_n_data_files; i++) {
587 - if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
588 + if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
589 ut_print_timestamp(stderr);
591 " InnoDB: Error: file size must be < 4 GB"