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 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
23 #ifndef UNIV_HOTBACKUP
24 - if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
25 + if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
27 "InnoDB: Error: the size of single-table tablespace"
30 /* Align the memory for file i/o if we might have O_DIRECT set */
31 page = ut_align(buf2, UNIV_PAGE_SIZE);
33 - if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
34 + if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
35 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
37 /* We have to read the tablespace id from the file */
39 ut_ad(ut_is_2pow(zip_size));
42 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
43 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
45 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
46 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
48 ut_ad(fil_validate_skip());
49 #ifndef UNIV_HOTBACKUP
50 # ifndef UNIV_LOG_DEBUG
51 diff -ruN a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
52 --- a/storage/innobase/fsp/fsp0fsp.c 2010-12-04 15:52:23.411513754 +0900
53 +++ b/storage/innobase/fsp/fsp0fsp.c 2010-12-04 15:55:58.244514273 +0900
55 0 for uncompressed pages */
56 ulint offset) /*!< in: page offset */
58 -#ifndef DOXYGEN /* Doxygen gets confused of these */
59 -# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
60 - + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
63 -# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
64 - + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
67 -#endif /* !DOXYGEN */
68 +//#ifndef DOXYGEN /* Doxygen gets confused of these */
69 +//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
70 +// + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
73 +//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
74 +// + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
77 +//#endif /* !DOXYGEN */
78 + ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
79 + ut_a(PAGE_ZIP_MIN_SIZE > XDES_ARR_OFFSET + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
80 ut_ad(ut_is_2pow(zip_size));
83 @@ -1464,12 +1466,12 @@
85 xdes_init(descr, mtr);
87 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
88 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
90 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
91 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
93 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
94 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
96 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
97 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
100 if (UNIV_UNLIKELY(init_xdes)) {
102 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
103 --- a/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:55:21.367482924 +0900
104 +++ b/storage/innobase/handler/ha_innodb.cc 2010-12-04 15:55:58.248549631 +0900
106 static ulong innobase_write_io_threads;
107 static long innobase_buffer_pool_instances = 1;
109 +static ulong innobase_page_size;
110 +static ulong innobase_log_block_size;
112 static my_bool innobase_thread_concurrency_timer_based;
113 static long long innobase_buffer_pool_size, innobase_log_file_size;
115 @@ -2316,6 +2319,65 @@
117 #endif /* DBUG_OFF */
120 + srv_page_size_shift = 0;
122 + if (innobase_page_size != (1 << 14)) {
126 + "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
127 + for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
128 + if (innobase_page_size == ((ulong)1 << n_shift)) {
129 + srv_page_size_shift = n_shift;
130 + srv_page_size = (1 << srv_page_size_shift);
132 + "InnoDB: The universal page size of the database is set to %lu.\n",
138 + srv_page_size_shift = 14;
139 + srv_page_size = (1 << srv_page_size_shift);
142 + if (!srv_page_size_shift) {
144 + "InnoDB: Error: %lu is not a valid value for innodb_page_size.\n"
145 + "InnoDB: Error: Valid values are 4096, 8192, and 16384 (default=16384).\n",
146 + innobase_page_size);
150 + srv_log_block_size = 0;
151 + if (innobase_log_block_size != (1 << 9)) { /*!=512*/
155 + "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
156 + for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
157 + if (innobase_log_block_size == ((ulong)1 << n_shift)) {
158 + srv_log_block_size = (1 << n_shift);
160 + "InnoDB: The log block size is set to %lu.\n",
161 + srv_log_block_size);
166 + srv_log_block_size = 512;
169 + if (!srv_log_block_size) {
171 + "InnoDB: Error: %lu is not a valid value for innodb_log_block_size.\n"
172 + "InnoDB: Error: A valid value for innodb_log_block_size is\n"
173 + "InnoDB: Error: a power of 2 from 512 to 16384.\n",
174 + innobase_log_block_size);
179 innodb_overwrite_relay_log_info = FALSE;
181 @@ -7241,9 +7303,9 @@
184 << DICT_TF_FORMAT_SHIFT;
185 -#if DICT_TF_ZSSIZE_MAX < 1
186 -# error "DICT_TF_ZSSIZE_MAX < 1"
188 +//#if DICT_TF_ZSSIZE_MAX < 1
189 +//# error "DICT_TF_ZSSIZE_MAX < 1"
194 @@ -11432,6 +11494,16 @@
195 "#### Attention: The checksum is not compatible for normal or disabled version! ####",
198 +static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
199 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
200 + "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
201 + NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
203 +static MYSQL_SYSVAR_ULONG(log_block_size, innobase_log_block_size,
204 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
205 + "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!",
206 + NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
208 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
210 "The common part for InnoDB table spaces.",
211 @@ -11936,6 +12008,8 @@
212 NULL, NULL, 0, &corrupt_table_action_typelib);
214 static struct st_mysql_sys_var* innobase_system_variables[]= {
215 + MYSQL_SYSVAR(page_size),
216 + MYSQL_SYSVAR(log_block_size),
217 MYSQL_SYSVAR(additional_mem_pool_size),
218 MYSQL_SYSVAR(autoextend_increment),
219 MYSQL_SYSVAR(buffer_pool_size),
220 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
221 --- a/storage/innobase/include/buf0buf.h 2010-12-04 15:55:21.375482937 +0900
222 +++ b/storage/innobase/include/buf0buf.h 2010-12-04 15:55:58.258469088 +0900
223 @@ -1683,7 +1683,7 @@
224 time_t last_printout_time;
225 /*!< when buf_print_io was last time
227 - buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + 1];
228 + buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
229 /*!< Statistics of buddy system,
230 indexed by block size */
231 buf_pool_stat_t stat; /*!< current statistics */
232 @@ -1779,7 +1779,7 @@
234 UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
235 /*!< unmodified compressed pages */
236 - UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
237 + UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
238 /*!< buddy free lists */
240 buf_page_t watch[BUF_POOL_WATCH_SIZE];
241 @@ -1787,9 +1787,9 @@
242 pool watches. Protected by
245 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
246 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
248 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
249 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
251 #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
252 # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
254 diff -ruN a/storage/innobase/include/buf0types.h b/storage/innobase/include/buf0types.h
255 --- a/storage/innobase/include/buf0types.h 2010-11-03 07:01:13.000000000 +0900
256 +++ b/storage/innobase/include/buf0types.h 2010-12-04 15:55:58.259482590 +0900
258 buddy system; must be at least
259 sizeof(buf_page_t) */
260 #define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
261 +#define BUF_BUDDY_SIZES_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
262 /*!< number of buddy sizes */
264 /** twice the maximum block size of the buddy system;
265 the underlying memory is aligned by this amount:
266 this must be equal to UNIV_PAGE_SIZE */
267 -#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
268 +#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
272 diff -ruN a/storage/innobase/include/fsp0types.h b/storage/innobase/include/fsp0types.h
273 --- a/storage/innobase/include/fsp0types.h 2010-12-04 02:58:26.000000000 +0900
274 +++ b/storage/innobase/include/fsp0types.h 2011-02-03 15:14:21.000000000 +0900
278 /** File space extent size (one megabyte) in pages */
279 -#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
280 +#define FSP_EXTENT_SIZE ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT))
282 /** On a page of any file segment, data may be put starting from this
284 diff -ruN a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h
285 --- a/storage/innobase/include/log0log.h 2010-11-03 07:01:13.000000000 +0900
286 +++ b/storage/innobase/include/log0log.h 2010-12-09 18:16:47.737728305 +0900
288 when mysqld is first time started
289 on the restored database, it can
290 print helpful info for the user */
291 +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
292 + /* extend to record log_block_size
293 + of XtraDB. 0 means default 512 */
294 #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
295 /* this 4-byte field is TRUE when
296 the writing of an archived log file
297 diff -ruN a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic
298 --- a/storage/innobase/include/mtr0log.ic 2010-12-04 15:37:50.590551517 +0900
299 +++ b/storage/innobase/include/mtr0log.ic 2010-12-04 15:55:58.260482404 +0900
302 if ((space == TRX_SYS_SPACE
303 || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
304 - && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
305 + && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
306 if (trx_doublewrite_buf_is_being_created) {
307 /* Do nothing: we only come to this branch in an
308 InnoDB database creation. We do not redo log
309 diff -ruN a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
310 --- a/storage/innobase/include/os0file.h 2010-12-09 18:16:02.323727427 +0900
311 +++ b/storage/innobase/include/os0file.h 2010-12-09 18:16:47.738694194 +0900
313 if this fails for a log block, then it is equivalent to a media failure in the
316 -#define OS_FILE_LOG_BLOCK_SIZE 512
317 +#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size
319 /** Options for file_create @{ */
320 #define OS_FILE_OPEN 51
322 extern ulint os_n_file_writes;
323 extern ulint os_n_fsyncs;
325 +extern ulint srv_log_block_size;
328 /* Keys to register InnoDB I/O with performance schema */
329 extern mysql_pfs_key_t innodb_file_data_key;
330 diff -ruN a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h
331 --- a/storage/innobase/include/page0types.h 2010-11-03 07:01:13.000000000 +0900
332 +++ b/storage/innobase/include/page0types.h 2010-12-04 15:55:58.261483930 +0900
335 /** Number of supported compressed page sizes */
336 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
337 -#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
338 -# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
339 +#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
340 +#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
341 +# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
344 /** Compressed page descriptor */
346 typedef struct page_zip_stat_struct page_zip_stat_t;
348 /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
349 -extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
350 +extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
352 /**********************************************************************//**
353 Write the "deleted" flag of a record on a compressed page. The flag must
354 diff -ruN a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
355 --- a/storage/innobase/include/trx0sys.h 2010-12-04 15:37:50.593480594 +0900
356 +++ b/storage/innobase/include/trx0sys.h 2010-12-04 15:55:58.262549554 +0900
358 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
359 #define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
361 -#if UNIV_PAGE_SIZE < 4096
362 -# error "UNIV_PAGE_SIZE < 4096"
364 +//#if UNIV_PAGE_SIZE < 4096
365 +//# error "UNIV_PAGE_SIZE < 4096"
367 /** The offset of the MySQL replication info in the trx system header;
368 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
369 #define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
370 diff -ruN a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
371 --- a/storage/innobase/include/univ.i 2010-11-03 07:01:13.000000000 +0900
372 +++ b/storage/innobase/include/univ.i 2010-12-04 15:55:58.263549721 +0900
376 /* The 2-logarithm of UNIV_PAGE_SIZE: */
377 -#define UNIV_PAGE_SIZE_SHIFT 14
378 +/* #define UNIV_PAGE_SIZE_SHIFT 14 */
379 +#define UNIV_PAGE_SIZE_SHIFT_MAX 14
380 +#define UNIV_PAGE_SIZE_SHIFT srv_page_size_shift
381 /* The universal page size of the database */
382 -#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT)
383 +/* #define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) */
384 +#define UNIV_PAGE_SIZE srv_page_size
385 +#define UNIV_PAGE_SIZE_MAX (1 << UNIV_PAGE_SIZE_SHIFT_MAX)
387 /* Maximum number of parallel threads in a parallelized operation */
388 #define UNIV_MAX_PARALLELISM 32
390 stored part of the field in the tablespace. The length field then
391 contains the sum of the following flag and the locally stored len. */
393 -#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
394 +#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
396 /* Some macros to improve branch prediction and reduce cache misses */
397 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
399 UNIV_MEM_ALLOC(addr, size); \
402 +extern ulint srv_page_size_shift;
403 +extern ulint srv_page_size;
405 diff -ruN a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
406 --- a/storage/innobase/log/log0log.c 2010-12-03 15:18:48.899986203 +0900
407 +++ b/storage/innobase/log/log0log.c 2010-12-04 15:55:58.266551567 +0900
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 @@ -1201,6 +1203,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 @@ -1794,9 +1799,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 @@ -1810,6 +1813,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 @@ -1823,7 +1827,9 @@
449 mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
450 #else /* UNIV_LOG_ARCHIVE */
451 - mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
452 + mach_write_to_8(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 diff -ruN a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
459 --- a/storage/innobase/log/log0recv.c 2010-12-03 17:32:15.638986405 +0900
460 +++ b/storage/innobase/log/log0recv.c 2010-12-04 15:55:58.269550689 +0900
463 group->lsn = mach_read_from_8(
464 buf + LOG_CHECKPOINT_LSN);
466 +#ifdef UNIV_LOG_ARCHIVE
467 +#error "UNIV_LOG_ARCHIVE could not be enabled"
470 + ib_uint64_t tmp_lsn_offset = mach_read_from_8(
471 + buf + LOG_CHECKPOINT_ARCHIVED_LSN);
472 + if (sizeof(ulint) != 4
473 + && tmp_lsn_offset != IB_ULONGLONG_MAX) {
474 + group->lsn_offset = (ulint) tmp_lsn_offset;
476 group->lsn_offset = mach_read_from_4(
477 buf + LOG_CHECKPOINT_OFFSET);
481 checkpoint_no = mach_read_from_8(
482 buf + LOG_CHECKPOINT_NO);
484 @@ -2955,6 +2969,7 @@
485 log_group_t* max_cp_group;
486 log_group_t* up_to_date_group;
488 + ulint log_hdr_log_block_size;
489 ib_uint64_t checkpoint_lsn;
490 ib_uint64_t checkpoint_no;
491 ib_uint64_t old_scanned_lsn;
492 @@ -3056,6 +3071,21 @@
493 log_hdr_buf, max_cp_group);
496 + log_hdr_log_block_size
497 + = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
498 + if (log_hdr_log_block_size == 0) {
499 + /* 0 means default value */
500 + log_hdr_log_block_size = 512;
502 + if (log_hdr_log_block_size != srv_log_block_size) {
504 + "InnoDB: Error: The block size of ib_logfile (%lu) "
505 + "is not equal to innodb_log_block_size.\n"
506 + "InnoDB: Error: Suggestion - Recreate log files.\n",
507 + log_hdr_log_block_size);
511 #ifdef UNIV_LOG_ARCHIVE
512 group = UT_LIST_GET_FIRST(log_sys->log_groups);
514 diff -ruN a/storage/innobase/page/page0zip.c b/storage/innobase/page/page0zip.c
515 --- a/storage/innobase/page/page0zip.c 2010-12-04 15:52:23.484482786 +0900
516 +++ b/storage/innobase/page/page0zip.c 2010-12-04 15:55:58.274551431 +0900
519 #ifndef UNIV_HOTBACKUP
520 /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
521 -UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
522 +UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
523 #endif /* !UNIV_HOTBACKUP */
525 /* Please refer to ../include/page0zip.ic for a description of the
526 diff -ruN a/storage/innobase/row/row0merge.c b/storage/innobase/row/row0merge.c
527 --- a/storage/innobase/row/row0merge.c 2010-12-04 15:52:23.490513562 +0900
528 +++ b/storage/innobase/row/row0merge.c 2010-12-04 15:55:58.277550562 +0900
530 row_merge_block_t. Thus, it must be able to hold one merge record,
531 whose maximum size is the same as the minimum size of
532 row_merge_block_t. */
533 -typedef byte mrec_buf_t[UNIV_PAGE_SIZE];
534 +typedef byte mrec_buf_t[UNIV_PAGE_SIZE_MAX];
536 /** @brief Merge record in row_merge_block_t.
538 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
539 --- a/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:21.384486344 +0900
540 +++ b/storage/innobase/srv/srv0srv.c 2010-12-04 15:55:58.282550845 +0900
542 UNIV_INTERN ulint srv_n_read_io_threads = ULINT_MAX;
543 UNIV_INTERN ulint srv_n_write_io_threads = ULINT_MAX;
545 +/* The universal page size of the database */
546 +UNIV_INTERN ulint srv_page_size_shift = 0;
547 +UNIV_INTERN ulint srv_page_size = 0;
549 +/* The log block size */
550 +UNIV_INTERN ulint srv_log_block_size = 0;
552 /* User settable value of the number of pages that must be present
553 in the buffer cache and accessed sequentially for InnoDB to trigger a
554 readahead request. */
555 diff -ruN a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
556 --- a/storage/innobase/srv/srv0start.c 2010-12-04 15:52:23.502513556 +0900
557 +++ b/storage/innobase/srv/srv0start.c 2010-12-04 15:55:58.285550583 +0900
558 @@ -1561,11 +1561,13 @@
560 #endif /* UNIV_LOG_ARCHIVE */
562 - if (srv_n_log_files * srv_log_file_size >= 262144) {
563 + if (sizeof(ulint) == 4
564 + && srv_n_log_files * srv_log_file_size
565 + >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
566 ut_print_timestamp(stderr);
568 " InnoDB: Error: combined size of log files"
569 - " must be < 4 GB\n");
570 + " must be < 4 GB on 32-bit systems\n");
574 @@ -1574,7 +1576,7 @@
576 for (i = 0; i < srv_n_data_files; i++) {
578 - if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
579 + if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
580 ut_print_timestamp(stderr);
582 " InnoDB: Error: file size must be < 4 GB"