]> git.pld-linux.org Git - packages/mysql.git/blob - innodb_files_extend.patch
remove id expansion
[packages/mysql.git] / innodb_files_extend.patch
1 # name       : innodb_files_extend.patch
2 # introduced : 11 or before
3 # maintainer : Yasufumi
4 #
5 #!!! notice !!!
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
10 @@ -731,7 +731,7 @@
11                 ut_a(space->purpose != FIL_LOG);
12                 ut_a(!trx_sys_sys_space(space->id));
13  
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) {
16                         fprintf(stderr,
17                                 "InnoDB: Error: the size of single-table"
18                                 " tablespace file %s\n"
19 @@ -4169,7 +4169,7 @@
20  
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) {
25                 fprintf(stderr,
26                         "InnoDB: Error: the size of single-table tablespace"
27                         " file %s\n"
28 @@ -4189,7 +4189,7 @@
29         /* Align the memory for file i/o if we might have O_DIRECT set */
30         page = ut_align(buf2, UNIV_PAGE_SIZE);
31  
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);
35  
36                 /* We have to read the tablespace id from the file */
37 @@ -5167,9 +5167,9 @@
38         ut_ad(ut_is_2pow(zip_size));
39         ut_ad(buf);
40         ut_ad(len > 0);
41 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
42 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
43 -#endif
44 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
45 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
46 +//#endif
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
52 @@ -595,16 +595,18 @@
53                                 0 for uncompressed pages */
54         ulint   offset)         /*!< in: page offset */
55  {
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
59 -#  error
60 -# endif
61 -# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
62 -               + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
63 -#  error
64 -# endif
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
69 +//#  error
70 +//# endif
71 +//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
72 +//             + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
73 +//#  error
74 +//# endif
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));
79  
80         if (!zip_size) {
81 @@ -1403,12 +1405,12 @@
82                                                            mtr);
83                 xdes_init(descr, mtr);
84  
85 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
86 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
87 -#endif
88 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
89 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
90 -#endif
91 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
92 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
93 +//#endif
94 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
95 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
96 +//#endif
97  
98                 if (UNIV_UNLIKELY(init_xdes)) {
99  
100 --- a/storage/innobase/handler/ha_innodb.cc
101 +++ b/storage/innobase/handler/ha_innodb.cc
102 @@ -148,6 +148,9 @@
103  static ulong innobase_write_io_threads;
104  static long innobase_buffer_pool_instances = 1;
105  
106 +static ulong innobase_page_size;
107 +static ulong innobase_log_block_size;
108 +
109  static my_bool innobase_thread_concurrency_timer_based;
110  static long long innobase_buffer_pool_size, innobase_log_file_size;
111  
112 @@ -2352,6 +2355,65 @@
113         }
114  #endif /* DBUG_OFF */
115  
116 +       srv_page_size = 0;
117 +       srv_page_size_shift = 0;
118 +
119 +       if (innobase_page_size != (1 << 14)) {
120 +               uint n_shift;
121 +
122 +               fprintf(stderr,
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);
128 +                               fprintf(stderr,
129 +                                       "InnoDB: The universal page size of the database is set to %lu.\n",
130 +                                       srv_page_size);
131 +                               break;
132 +                       }
133 +               }
134 +       } else {
135 +               srv_page_size_shift = 14;
136 +               srv_page_size = (1 << srv_page_size_shift);
137 +       }
138 +
139 +       if (!srv_page_size_shift) {
140 +               fprintf(stderr,
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);
144 +               goto error;
145 +       }
146 +
147 +       srv_log_block_size = 0;
148 +       if (innobase_log_block_size != (1 << 9)) { /*!=512*/
149 +               uint    n_shift;
150 +
151 +               fprintf(stderr,
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);
156 +                               fprintf(stderr,
157 +                                       "InnoDB: The log block size is set to %lu.\n",
158 +                                       srv_log_block_size);
159 +                               break;
160 +                       }
161 +               }
162 +       } else {
163 +               srv_log_block_size = 512;
164 +       }
165 +
166 +       if (!srv_log_block_size) {
167 +               fprintf(stderr,
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);
172 +               goto error;
173 +       }
174 +
175  #ifndef MYSQL_SERVER
176         innodb_overwrite_relay_log_info = FALSE;
177  #endif
178 @@ -7289,9 +7351,9 @@
179                                 | DICT_TF_COMPACT
180                                 | DICT_TF_FORMAT_ZIP
181                                 << DICT_TF_FORMAT_SHIFT;
182 -#if DICT_TF_ZSSIZE_MAX < 1
183 -# error "DICT_TF_ZSSIZE_MAX < 1"
184 -#endif
185 +//#if DICT_TF_ZSSIZE_MAX < 1
186 +//# error "DICT_TF_ZSSIZE_MAX < 1"
187 +//#endif
188                 }
189         }
190  
191 @@ -11552,6 +11614,16 @@
192    "#### Attention: The checksum is not compatible for normal or disabled version! ####",
193    NULL, NULL, FALSE);
194  
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);
199 +
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);
204 +
205  static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
206    PLUGIN_VAR_READONLY,
207    "The common part for InnoDB table spaces.",
208 @@ -12118,6 +12190,8 @@
209    NULL, NULL, 0, &corrupt_table_action_typelib);
210  
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 @@ -1725,7 +1725,7 @@
220         time_t          last_printout_time;
221                                         /*!< when buf_print_io was last time
222                                         called */
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 @@ -1823,7 +1823,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 */
235  
236         buf_page_t                      watch[BUF_POOL_WATCH_SIZE];
237 @@ -1831,9 +1831,9 @@
238                                         pool watches. Protected by
239                                         buf_pool->mutex. */
240  
241 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
242 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
243 -#endif
244 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
245 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
246 +//#endif
247  #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
248  # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
249  #endif
250 --- a/storage/innobase/include/buf0types.h
251 +++ b/storage/innobase/include/buf0types.h
252 @@ -70,12 +70,13 @@
253  #define BUF_BUDDY_LOW          (1 << BUF_BUDDY_LOW_SHIFT)
254  
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 */
258  
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)
264  /* @} */
265  
266  #endif
267 --- a/storage/innobase/include/fsp0types.h
268 +++ b/storage/innobase/include/fsp0types.h
269 @@ -42,7 +42,7 @@
270  /* @} */
271  
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))
275  
276  /** On a page of any file segment, data may be put starting from this
277  offset */
278 --- a/storage/innobase/include/log0log.h
279 +++ b/storage/innobase/include/log0log.h
280 @@ -672,6 +672,9 @@
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
292 @@ -203,7 +203,7 @@
293         system tablespace */
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
303 @@ -101,7 +101,7 @@
304  if this fails for a log block, then it is equivalent to a media failure in the
305  log. */
306  
307 -#define OS_FILE_LOG_BLOCK_SIZE         512
308 +#define OS_FILE_LOG_BLOCK_SIZE         srv_log_block_size
309  
310  /** Options for file_create @{ */
311  #define        OS_FILE_OPEN                    51
312 @@ -190,6 +190,8 @@
313  extern ulint   os_n_file_writes;
314  extern ulint   os_n_fsyncs;
315  
316 +extern ulint   srv_log_block_size;
317 +
318  #ifdef UNIV_PFS_IO
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
323 @@ -56,8 +56,9 @@
324  
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)"
332  #endif
333  
334  /** Compressed page descriptor */
335 @@ -98,7 +99,7 @@
336  typedef struct page_zip_stat_struct page_zip_stat_t;
337  
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];
341  
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
346 @@ -526,9 +526,9 @@
347  /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
348  #define TRX_SYS_MYSQL_LOG_MAGIC_N      873422344
349  
350 -#if UNIV_PAGE_SIZE < 4096
351 -# error "UNIV_PAGE_SIZE < 4096"
352 -#endif
353 +//#if UNIV_PAGE_SIZE < 4096
354 +//# error "UNIV_PAGE_SIZE < 4096"
355 +//#endif
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
361 @@ -313,9 +313,13 @@
362  */
363  
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)
374  
375  /* Maximum number of parallel threads in a parallelized operation */
376  #define UNIV_MAX_PARALLELISM   32
377 @@ -434,7 +438,7 @@
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. */
380  
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)
383  
384  /* Some macros to improve branch prediction and reduce cache misses */
385  #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
386 @@ -537,4 +541,6 @@
387         UNIV_MEM_ALLOC(addr, size);                     \
388  } while (0)
389  
390 +extern ulint   srv_page_size_shift;
391 +extern ulint   srv_page_size;
392  #endif
393 --- a/storage/innobase/log/log0log.c
394 +++ b/storage/innobase/log/log0log.c
395 @@ -604,7 +604,9 @@
396  
397         offset = (gr_lsn_size_offset + difference) % group_size;
398  
399 +       if (sizeof(ulint) == 4) {
400         ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
401 +       }
402  
403         /* fprintf(stderr,
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);
408  
409 +       mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
410 +                       srv_log_block_size);
411 +
412         dest_offset = nth_file * group->file_size;
413  
414  #ifdef UNIV_DEBUG
415 @@ -1797,9 +1802,7 @@
416         ulint           i;
417  
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"
421 -#endif
422 +       ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
423  
424         buf = group->checkpoint_buf;
425  
426 @@ -1813,6 +1816,7 @@
427         mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
428  
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;
433         } else {
434 @@ -1826,7 +1830,9 @@
435  
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 */
443  
444         for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
445 --- a/storage/innobase/log/log0recv.c
446 +++ b/storage/innobase/log/log0recv.c
447 @@ -712,8 +712,22 @@
448  
449                         group->lsn = mach_read_from_8(
450                                 buf + LOG_CHECKPOINT_LSN);
451 +
452 +#ifdef UNIV_LOG_ARCHIVE
453 +#error "UNIV_LOG_ARCHIVE could not be enabled"
454 +#endif
455 +                       {
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;
461 +                               } else {
462                         group->lsn_offset = mach_read_from_4(
463                                 buf + LOG_CHECKPOINT_OFFSET);
464 +                               }
465 +                       }
466 +
467                         checkpoint_no = mach_read_from_8(
468                                 buf + LOG_CHECKPOINT_NO);
469  
470 @@ -2955,6 +2969,7 @@
471         log_group_t*    max_cp_group;
472         log_group_t*    up_to_date_group;
473         ulint           max_cp_field;
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);
480         }
481  
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;
487 +       }
488 +       if (log_hdr_log_block_size != srv_log_block_size) {
489 +               fprintf(stderr,
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);
494 +               return(DB_ERROR);
495 +       }
496 +
497  #ifdef UNIV_LOG_ARCHIVE
498         group = UT_LIST_GET_FIRST(log_sys->log_groups);
499  
500 --- a/storage/innobase/page/page0zip.c
501 +++ b/storage/innobase/page/page0zip.c
502 @@ -49,7 +49,7 @@
503  
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 */
509  
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
513 @@ -97,7 +97,7 @@
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];
519  
520  /** @brief Merge record in row_merge_block_t.
521  
522 --- a/storage/innobase/srv/srv0srv.c
523 +++ b/storage/innobase/srv/srv0srv.c
524 @@ -236,6 +236,14 @@
525  
526  /* Switch to enable random read ahead. */
527  UNIV_INTERN my_bool    srv_random_read_ahead   = FALSE;
528 +
529 +/* The universal page size of the database */
530 +UNIV_INTERN ulint      srv_page_size_shift     = 0;
531 +UNIV_INTERN ulint      srv_page_size           = 0;
532 +
533 +/* The log block size */
534 +UNIV_INTERN ulint      srv_log_block_size      = 0;
535 +
536  /* User settable value of the number of pages that must be present
537  in the buffer cache and accessed sequentially for InnoDB to trigger a
538  readahead request. */
539 --- a/storage/innobase/srv/srv0start.c
540 +++ b/storage/innobase/srv/srv0start.c
541 @@ -1582,11 +1582,13 @@
542         }
543  #endif /* UNIV_LOG_ARCHIVE */
544  
545 -       if (srv_n_log_files * srv_log_file_size >= 262144) {
546 +       if (sizeof(ulint) == 4
547 +           && srv_n_log_files * srv_log_file_size
548 +              >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
549                 ut_print_timestamp(stderr);
550                 fprintf(stderr,
551                         " InnoDB: Error: combined size of log files"
552 -                       " must be < 4 GB\n");
553 +                       " must be < 4 GB on 32-bit systems\n");
554  
555                 return(DB_ERROR);
556         }
557 @@ -1595,7 +1597,7 @@
558  
559         for (i = 0; i < srv_n_data_files; i++) {
560  #ifndef __WIN__
561 -               if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
562 +               if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
563                         ut_print_timestamp(stderr);
564                         fprintf(stderr,
565                                 " InnoDB: Error: file size must be < 4 GB"
This page took 0.203255 seconds and 3 git commands to generate.