]> git.pld-linux.org Git - packages/mysql.git/blob - mysql-innodb_files_extend.patch
69c22b0c576d7fdba79df3f24074e2b56e2334ee
[packages/mysql.git] / mysql-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/innodb_plugin/buf/buf0buddy.c
9 +++ b/storage/innodb_plugin/buf/buf0buddy.c
10 @@ -43,7 +43,7 @@
11  #endif /* UNIV_DEBUG */
12  /** Statistics of the buddy system, indexed by block size.
13  Protected by buf_pool_mutex. */
14 -UNIV_INTERN buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES + 1];
15 +UNIV_INTERN buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
16  
17  /** Validate a given zip_free list. */
18  #define BUF_BUDDY_LIST_VALIDATE(i)                             \
19 --- a/storage/innodb_plugin/fil/fil0fil.c
20 +++ b/storage/innodb_plugin/fil/fil0fil.c
21 @@ -692,7 +692,7 @@
22                 ut_a(space->purpose != FIL_LOG);
23                 ut_a(!trx_sys_sys_space(space->id));
24  
25 -               if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
26 +               if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
27                         fprintf(stderr,
28                                 "InnoDB: Error: the size of single-table"
29                                 " tablespace file %s\n"
30 @@ -4101,7 +4101,7 @@
31  
32         size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
33  #ifndef UNIV_HOTBACKUP
34 -       if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
35 +       if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
36                 fprintf(stderr,
37                         "InnoDB: Error: the size of single-table tablespace"
38                         " file %s\n"
39 @@ -4121,7 +4121,7 @@
40         /* Align the memory for file i/o if we might have O_DIRECT set */
41         page = ut_align(buf2, UNIV_PAGE_SIZE);
42  
43 -       if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
44 +       if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
45                 success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE);
46  
47                 /* We have to read the tablespace id from the file */
48 @@ -5099,9 +5099,9 @@
49         ut_ad(ut_is_2pow(zip_size));
50         ut_ad(buf);
51         ut_ad(len > 0);
52 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
53 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
54 -#endif
55 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
56 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
57 +//#endif
58         ut_ad(fil_validate());
59  #ifndef UNIV_HOTBACKUP
60  # ifndef UNIV_LOG_DEBUG
61 --- a/storage/innodb_plugin/fsp/fsp0fsp.c
62 +++ b/storage/innodb_plugin/fsp/fsp0fsp.c
63 @@ -657,16 +657,18 @@
64                                 0 for uncompressed pages */
65         ulint   offset)         /*!< in: page offset */
66  {
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
70 -#  error
71 -# endif
72 -# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
73 -               + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
74 -#  error
75 -# endif
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
80 +//#  error
81 +//# endif
82 +//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
83 +//             + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
84 +//#  error
85 +//# endif
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));
90  
91         if (!zip_size) {
92 @@ -1465,12 +1467,12 @@
93                                                            mtr);
94                 xdes_init(descr, mtr);
95  
96 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
97 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
98 -#endif
99 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
100 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
101 -#endif
102 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
103 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
104 +//#endif
105 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
106 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
107 +//#endif
108  
109                 if (UNIV_UNLIKELY(init_xdes)) {
110  
111 --- a/storage/innodb_plugin/handler/ha_innodb.cc
112 +++ b/storage/innodb_plugin/handler/ha_innodb.cc
113 @@ -151,6 +151,9 @@
114  static ulong innobase_read_io_threads;
115  static ulong innobase_write_io_threads;
116  
117 +static ulong innobase_page_size;
118 +static ulong innobase_log_block_size;
119 +
120  static my_bool innobase_thread_concurrency_timer_based;
121  static long long innobase_buffer_pool_size, innobase_log_file_size;
122  
123 @@ -2107,6 +2110,62 @@
124         }
125  #endif /* UNIV_DEBUG */
126  
127 +       srv_page_size = 0;
128 +       srv_page_size_shift = 0;
129 +
130 +       if (innobase_page_size != (1 << 14)) {
131 +               uint n_shift;
132 +
133 +               fprintf(stderr,
134 +                       "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
135 +               for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
136 +                       if (innobase_page_size == ((ulong)1 << n_shift)) {
137 +                               srv_page_size_shift = n_shift;
138 +                               srv_page_size = (1 << srv_page_size_shift);
139 +                               fprintf(stderr,
140 +                                       "InnoDB: The universal page size of the database is set to %lu.\n",
141 +                                       srv_page_size);
142 +                               break;
143 +                       }
144 +               }
145 +       } else {
146 +               srv_page_size_shift = 14;
147 +               srv_page_size = (1 << srv_page_size_shift);
148 +       }
149 +
150 +       if (!srv_page_size_shift) {
151 +               fprintf(stderr,
152 +                       "InnoDB: Error: %lu is not valid value for innodb_page_size.\n",
153 +                       innobase_page_size);
154 +               goto error;
155 +       }
156 +
157 +       srv_log_block_size = 0;
158 +       if (innobase_log_block_size != (1 << 9)) { /*!=512*/
159 +               uint    n_shift;
160 +
161 +               fprintf(stderr,
162 +                       "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
163 +               for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
164 +                       if (innobase_log_block_size == ((ulong)1 << n_shift)) {
165 +                               srv_log_block_size = (1 << n_shift);
166 +                               fprintf(stderr,
167 +                                       "InnoDB: The log block size is set to %lu.\n",
168 +                                       srv_log_block_size);
169 +                               break;
170 +                       }
171 +               }
172 +       } else {
173 +               srv_log_block_size = 512;
174 +       }
175 +
176 +       if (!srv_log_block_size) {
177 +               fprintf(stderr,
178 +                       "InnoDB: Error: %lu is not valid value for innodb_log_block_size.\n",
179 +                       innobase_log_block_size);
180 +               goto error;
181 +       }
182 +
183  #ifndef MYSQL_SERVER
184         innodb_overwrite_relay_log_info = FALSE;
185  #endif
186 @@ -6994,9 +7053,9 @@
187                                 | DICT_TF_COMPACT
188                                 | DICT_TF_FORMAT_ZIP
189                                 << DICT_TF_FORMAT_SHIFT;
190 -#if DICT_TF_ZSSIZE_MAX < 1
191 -# error "DICT_TF_ZSSIZE_MAX < 1"
192 -#endif
193 +//#if DICT_TF_ZSSIZE_MAX < 1
194 +//# error "DICT_TF_ZSSIZE_MAX < 1"
195 +//#endif
196                 }
197         }
198  
199 @@ -11196,6 +11255,16 @@
200    "#### Attention: The checksum is not compatible for normal or disabled version! ####",
201    NULL, NULL, FALSE);
202  
203 +static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
204 +  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
205 +  "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
206 +  NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
207 +
208 +static MYSQL_SYSVAR_ULONG(log_block_size, innobase_log_block_size,
209 +  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
210 +  "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!",
211 +  NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
212 +
213  static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
214    PLUGIN_VAR_READONLY,
215    "The common part for InnoDB table spaces.",
216 @@ -11683,6 +11752,8 @@
217    NULL, NULL, 0, 0, 2, 0);
218  
219  static struct st_mysql_sys_var* innobase_system_variables[]= {
220 +  MYSQL_SYSVAR(page_size),
221 +  MYSQL_SYSVAR(log_block_size),
222    MYSQL_SYSVAR(additional_mem_pool_size),
223    MYSQL_SYSVAR(autoextend_increment),
224    MYSQL_SYSVAR(buffer_pool_size),
225 --- a/storage/innodb_plugin/handler/innodb_patch_info.h
226 +++ b/storage/innodb_plugin/handler/innodb_patch_info.h
227 @@ -45,5 +45,6 @@
228  {"innodb_separate_doublewrite","Add option 'innodb_doublewrite_file' to separate doublewrite dedicated tablespace","","http://www.percona.com/docs/wiki/percona-xtradb"},
229  {"innodb_pass_corrupt_table","Treat tables as corrupt instead of crash, when meet corrupt blocks","","http://www.percona.com/docs/wiki/percona-xtradb"},
230  {"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
231 +{"innodb_files_extend","allow >4GB transaction log files, and can vary universal page size of datafiles","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
232  {NULL, NULL, NULL, NULL}
233  };
234 --- a/storage/innodb_plugin/include/buf0buddy.h
235 +++ b/storage/innodb_plugin/include/buf0buddy.h
236 @@ -78,7 +78,7 @@
237  
238  /** Statistics of the buddy system, indexed by block size.
239  Protected by buf_pool_mutex. */
240 -extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES + 1];
241 +extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
242  
243  #ifndef UNIV_NONINL
244  # include "buf0buddy.ic"
245 --- a/storage/innodb_plugin/include/buf0buf.h
246 +++ b/storage/innodb_plugin/include/buf0buf.h
247 @@ -1503,11 +1503,11 @@
248         UT_LIST_BASE_NODE_T(buf_page_t) zip_clean;
249                                         /*!< unmodified compressed pages */
250  #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
251 -       UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
252 +       UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
253                                         /*!< buddy free lists */
254 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
255 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
256 -#endif
257 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
258 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
259 +//#endif
260  #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
261  # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
262  #endif
263 --- a/storage/innodb_plugin/include/buf0types.h
264 +++ b/storage/innodb_plugin/include/buf0types.h
265 @@ -65,12 +65,13 @@
266  #define BUF_BUDDY_LOW          (1 << BUF_BUDDY_LOW_SHIFT)
267  
268  #define BUF_BUDDY_SIZES                (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
269 +#define BUF_BUDDY_SIZES_MAX    (UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
270                                         /*!< number of buddy sizes */
271  
272  /** twice the maximum block size of the buddy system;
273  the underlying memory is aligned by this amount:
274  this must be equal to UNIV_PAGE_SIZE */
275 -#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
276 +#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES)
277  /* @} */
278  
279  #endif
280 --- a/storage/innodb_plugin/include/fsp0types.h
281 +++ b/storage/innodb_plugin/include/fsp0types.h
282 @@ -42,7 +42,7 @@
283  /* @} */
284  
285  /** File space extent size (one megabyte) in pages */
286 -#define        FSP_EXTENT_SIZE         (1 << (20 - UNIV_PAGE_SIZE_SHIFT))
287 +#define        FSP_EXTENT_SIZE         ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT))
288  
289  /** On a page of any file segment, data may be put starting from this
290  offset */
291 --- a/storage/innodb_plugin/include/log0log.h
292 +++ b/storage/innodb_plugin/include/log0log.h
293 @@ -672,6 +672,9 @@
294                                         when mysqld is first time started
295                                         on the restored database, it can
296                                         print helpful info for the user */
297 +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64
298 +                                       /* extend to record log_block_size
299 +                                       of XtraDB. 0 means default 512 */
300  #define        LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE
301                                         /* this 4-byte field is TRUE when
302                                         the writing of an archived log file
303 --- a/storage/innodb_plugin/include/mtr0log.ic
304 +++ b/storage/innodb_plugin/include/mtr0log.ic
305 @@ -203,7 +203,7 @@
306         system tablespace */
307         if ((space == TRX_SYS_SPACE
308              || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
309 -           && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
310 +           && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
311                 if (trx_doublewrite_buf_is_being_created) {
312                         /* Do nothing: we only come to this branch in an
313                         InnoDB database creation. We do not redo log
314 --- a/storage/innodb_plugin/include/os0file.h
315 +++ b/storage/innodb_plugin/include/os0file.h
316 @@ -107,7 +107,7 @@
317  if this fails for a log block, then it is equivalent to a media failure in the
318  log. */
319  
320 -#define OS_FILE_LOG_BLOCK_SIZE         512
321 +#define OS_FILE_LOG_BLOCK_SIZE         srv_log_block_size
322  
323  /** Options for file_create @{ */
324  #define        OS_FILE_OPEN                    51
325 @@ -188,6 +188,8 @@
326  extern ulint   os_n_file_writes;
327  extern ulint   os_n_fsyncs;
328  
329 +extern ulint   srv_log_block_size;
330 +
331  /* File types for directory entry data type */
332  
333  enum os_file_type_enum{
334 --- a/storage/innodb_plugin/include/page0types.h
335 +++ b/storage/innodb_plugin/include/page0types.h
336 @@ -56,8 +56,9 @@
337  
338  /** Number of supported compressed page sizes */
339  #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
340 -#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
341 -# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
342 +#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
343 +#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
344 +# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
345  #endif
346  
347  /** Compressed page descriptor */
348 @@ -98,7 +99,7 @@
349  typedef struct page_zip_stat_struct page_zip_stat_t;
350  
351  /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
352 -extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
353 +extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
354  
355  /**********************************************************************//**
356  Write the "deleted" flag of a record on a compressed page.  The flag must
357 --- a/storage/innodb_plugin/include/trx0sys.h
358 +++ b/storage/innodb_plugin/include/trx0sys.h
359 @@ -526,9 +526,9 @@
360  /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
361  #define TRX_SYS_MYSQL_LOG_MAGIC_N      873422344
362  
363 -#if UNIV_PAGE_SIZE < 4096
364 -# error "UNIV_PAGE_SIZE < 4096"
365 -#endif
366 +//#if UNIV_PAGE_SIZE < 4096
367 +//# error "UNIV_PAGE_SIZE < 4096"
368 +//#endif
369  /** The offset of the MySQL replication info in the trx system header;
370  this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
371  #define TRX_SYS_MYSQL_MASTER_LOG_INFO  (UNIV_PAGE_SIZE - 2000)
372 --- a/storage/innodb_plugin/include/univ.i
373 +++ b/storage/innodb_plugin/include/univ.i
374 @@ -285,9 +285,13 @@
375  */
376  
377  /* The 2-logarithm of UNIV_PAGE_SIZE: */
378 -#define UNIV_PAGE_SIZE_SHIFT   14
379 +/* #define UNIV_PAGE_SIZE_SHIFT        14 */
380 +#define UNIV_PAGE_SIZE_SHIFT_MAX       14
381 +#define UNIV_PAGE_SIZE_SHIFT   srv_page_size_shift
382  /* The universal page size of the database */
383 -#define UNIV_PAGE_SIZE         (1 << UNIV_PAGE_SIZE_SHIFT)
384 +/* #define UNIV_PAGE_SIZE              (1 << UNIV_PAGE_SIZE_SHIFT) */
385 +#define UNIV_PAGE_SIZE         srv_page_size
386 +#define UNIV_PAGE_SIZE_MAX     (1 << UNIV_PAGE_SIZE_SHIFT_MAX)
387  
388  /* Maximum number of parallel threads in a parallelized operation */
389  #define UNIV_MAX_PARALLELISM   32
390 @@ -401,7 +405,7 @@
391  stored part of the field in the tablespace. The length field then
392  contains the sum of the following flag and the locally stored len. */
393  
394 -#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
395 +#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
396  
397  /* Some macros to improve branch prediction and reduce cache misses */
398  #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
399 @@ -504,4 +508,6 @@
400         UNIV_MEM_ALLOC(addr, size);                     \
401  } while (0)
402  
403 +extern ulint   srv_page_size_shift;
404 +extern ulint   srv_page_size;
405  #endif
406 --- a/storage/innodb_plugin/log/log0log.c
407 +++ b/storage/innodb_plugin/log/log0log.c
408 @@ -591,7 +591,9 @@
409  
410         offset = (gr_lsn_size_offset + difference) % group_size;
411  
412 +       if (sizeof(ulint) == 4) {
413         ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
414 +       }
415  
416         /* fprintf(stderr,
417         "Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
418 @@ -1182,6 +1184,9 @@
419         /* Wipe over possible label of ibbackup --restore */
420         memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, "    ", 4);
421  
422 +       mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE,
423 +                       srv_log_block_size);
424 +
425         dest_offset = nth_file * group->file_size;
426  
427  #ifdef UNIV_DEBUG
428 @@ -1775,9 +1780,7 @@
429         ulint           i;
430  
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"
434 -#endif
435 +       ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
436  
437         buf = group->checkpoint_buf;
438  
439 @@ -1791,6 +1794,7 @@
440         mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
441  
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;
446         } else {
447 @@ -1804,7 +1808,9 @@
448  
449         mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
450  #else /* UNIV_LOG_ARCHIVE */
451 -       mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
452 +       mach_write_ull(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 */
456  
457         for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
458 --- a/storage/innodb_plugin/log/log0recv.c
459 +++ b/storage/innodb_plugin/log/log0recv.c
460 @@ -702,8 +702,22 @@
461  
462                         group->lsn = mach_read_ull(
463                                 buf + LOG_CHECKPOINT_LSN);
464 +
465 +#ifdef UNIV_LOG_ARCHIVE
466 +#error "UNIV_LOG_ARCHIVE could not be enabled"
467 +#endif
468 +                       {
469 +                       ib_uint64_t tmp_lsn_offset = mach_read_ull(
470 +                                       buf + LOG_CHECKPOINT_ARCHIVED_LSN);
471 +                               if (sizeof(ulint) != 4
472 +                                   && tmp_lsn_offset != IB_ULONGLONG_MAX) {
473 +                                       group->lsn_offset = (ulint) tmp_lsn_offset;
474 +                               } else {
475                         group->lsn_offset = mach_read_from_4(
476                                 buf + LOG_CHECKPOINT_OFFSET);
477 +                               }
478 +                       }
479 +
480                         checkpoint_no = mach_read_ull(
481                                 buf + LOG_CHECKPOINT_NO);
482  
483 @@ -2942,6 +2956,7 @@
484         log_group_t*    max_cp_group;
485         log_group_t*    up_to_date_group;
486         ulint           max_cp_field;
487 +       ulint           log_hdr_log_block_size;
488         ib_uint64_t     checkpoint_lsn;
489         ib_uint64_t     checkpoint_no;
490         ib_uint64_t     old_scanned_lsn;
491 @@ -3043,6 +3058,20 @@
492                        log_hdr_buf, max_cp_group);
493         }
494  
495 +       log_hdr_log_block_size
496 +               = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
497 +       if (log_hdr_log_block_size == 0) {
498 +               /* 0 means default value */
499 +               log_hdr_log_block_size = 512;
500 +       }
501 +       if (log_hdr_log_block_size != srv_log_block_size) {
502 +               fprintf(stderr,
503 +                       "InnoDB: Error: The block size of ib_logfile (%lu) "
504 +                       "is not equal to innodb_log_block_size.\n",
505 +                       log_hdr_log_block_size);
506 +               return(DB_ERROR);
507 +       }
508 +
509  #ifdef UNIV_LOG_ARCHIVE
510         group = UT_LIST_GET_FIRST(log_sys->log_groups);
511  
512 --- a/storage/innodb_plugin/page/page0zip.c
513 +++ b/storage/innodb_plugin/page/page0zip.c
514 @@ -49,7 +49,7 @@
515  
516  #ifndef UNIV_HOTBACKUP
517  /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
518 -UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
519 +UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
520  #endif /* !UNIV_HOTBACKUP */
521  
522  /* Please refer to ../include/page0zip.ic for a description of the
523 --- a/storage/innodb_plugin/row/row0merge.c
524 +++ b/storage/innodb_plugin/row/row0merge.c
525 @@ -92,7 +92,7 @@
526  row_merge_block_t.  Thus, it must be able to hold one merge record,
527  whose maximum size is the same as the minimum size of
528  row_merge_block_t. */
529 -typedef byte   mrec_buf_t[UNIV_PAGE_SIZE];
530 +typedef byte   mrec_buf_t[UNIV_PAGE_SIZE_MAX];
531  
532  /** @brief Merge record in row_merge_block_t.
533  
534 --- a/storage/innodb_plugin/srv/srv0srv.c
535 +++ b/storage/innodb_plugin/srv/srv0srv.c
536 @@ -219,6 +219,14 @@
537  
538  /* Switch to enable random read ahead. */
539  UNIV_INTERN my_bool    srv_random_read_ahead   = FALSE;
540 +
541 +/* The universal page size of the database */
542 +UNIV_INTERN ulint      srv_page_size_shift     = 0;
543 +UNIV_INTERN ulint      srv_page_size           = 0;
544 +
545 +/* The log block size */
546 +UNIV_INTERN ulint      srv_log_block_size      = 0;
547 +
548  /* User settable value of the number of pages that must be present
549  in the buffer cache and accessed sequentially for InnoDB to trigger a
550  readahead request. */
551 --- a/storage/innodb_plugin/srv/srv0start.c
552 +++ b/storage/innodb_plugin/srv/srv0start.c
553 @@ -1513,10 +1513,12 @@
554         }
555  #endif /* UNIV_LOG_ARCHIVE */
556  
557 -       if (srv_n_log_files * srv_log_file_size >= 262144) {
558 +       if (sizeof(ulint) == 4
559 +           && srv_n_log_files * srv_log_file_size
560 +              >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
561                 fprintf(stderr,
562                         "InnoDB: Error: combined size of log files"
563 -                       " must be < 4 GB\n");
564 +                       " must be < 4 GB on 32-bit systems\n");
565  
566                 return(DB_ERROR);
567         }
568 @@ -1525,7 +1527,7 @@
569  
570         for (i = 0; i < srv_n_data_files; i++) {
571  #ifndef __WIN__
572 -               if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
573 +               if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
574                         fprintf(stderr,
575                                 "InnoDB: Error: file size must be < 4 GB"
576                                 " with this MySQL binary\n"
This page took 0.099759 seconds and 2 git commands to generate.