]> git.pld-linux.org Git - packages/mysql.git/blob - innodb_files_extend.patch
- rel 2; update percona patches
[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 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
11 @@ -731,7 +731,7 @@
12                 ut_a(space->purpose != FIL_LOG);
13                 ut_a(!trx_sys_sys_space(space->id));
14  
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) {
17                         fprintf(stderr,
18                                 "InnoDB: Error: the size of single-table"
19                                 " tablespace file %s\n"
20 @@ -4151,7 +4151,7 @@
21  
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) {
26                 fprintf(stderr,
27                         "InnoDB: Error: the size of single-table tablespace"
28                         " file %s\n"
29 @@ -4171,7 +4171,7 @@
30         /* Align the memory for file i/o if we might have O_DIRECT set */
31         page = ut_align(buf2, UNIV_PAGE_SIZE);
32  
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);
36  
37                 /* We have to read the tablespace id from the file */
38 @@ -5149,9 +5149,9 @@
39         ut_ad(ut_is_2pow(zip_size));
40         ut_ad(buf);
41         ut_ad(len > 0);
42 -#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
43 -# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
44 -#endif
45 +//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
46 +//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
47 +//#endif
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
54 @@ -656,16 +656,18 @@
55                                 0 for uncompressed pages */
56         ulint   offset)         /*!< in: page offset */
57  {
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
61 -#  error
62 -# endif
63 -# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
64 -               + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
65 -#  error
66 -# endif
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
71 +//#  error
72 +//# endif
73 +//# if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET
74 +//             + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
75 +//#  error
76 +//# endif
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));
81  
82         if (!zip_size) {
83 @@ -1464,12 +1466,12 @@
84                                                            mtr);
85                 xdes_init(descr, mtr);
86  
87 -#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
88 -# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
89 -#endif
90 -#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
91 -# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
92 -#endif
93 +//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
94 +//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
95 +//#endif
96 +//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
97 +//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
98 +//#endif
99  
100                 if (UNIV_UNLIKELY(init_xdes)) {
101  
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
105 @@ -148,6 +148,9 @@
106  static ulong innobase_write_io_threads;
107  static long innobase_buffer_pool_instances = 1;
108  
109 +static ulong innobase_page_size;
110 +static ulong innobase_log_block_size;
111 +
112  static my_bool innobase_thread_concurrency_timer_based;
113  static long long innobase_buffer_pool_size, innobase_log_file_size;
114  
115 @@ -2316,6 +2319,65 @@
116         }
117  #endif /* DBUG_OFF */
118  
119 +       srv_page_size = 0;
120 +       srv_page_size_shift = 0;
121 +
122 +       if (innobase_page_size != (1 << 14)) {
123 +               uint n_shift;
124 +
125 +               fprintf(stderr,
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);
131 +                               fprintf(stderr,
132 +                                       "InnoDB: The universal page size of the database is set to %lu.\n",
133 +                                       srv_page_size);
134 +                               break;
135 +                       }
136 +               }
137 +       } else {
138 +               srv_page_size_shift = 14;
139 +               srv_page_size = (1 << srv_page_size_shift);
140 +       }
141 +
142 +       if (!srv_page_size_shift) {
143 +               fprintf(stderr,
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);
147 +               goto error;
148 +       }
149 +
150 +       srv_log_block_size = 0;
151 +       if (innobase_log_block_size != (1 << 9)) { /*!=512*/
152 +               uint    n_shift;
153 +
154 +               fprintf(stderr,
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);
159 +                               fprintf(stderr,
160 +                                       "InnoDB: The log block size is set to %lu.\n",
161 +                                       srv_log_block_size);
162 +                               break;
163 +                       }
164 +               }
165 +       } else {
166 +               srv_log_block_size = 512;
167 +       }
168 +
169 +       if (!srv_log_block_size) {
170 +               fprintf(stderr,
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);
175 +               goto error;
176 +       }
177 +
178  #ifndef MYSQL_SERVER
179         innodb_overwrite_relay_log_info = FALSE;
180  #endif
181 @@ -7241,9 +7303,9 @@
182                                 | DICT_TF_COMPACT
183                                 | DICT_TF_FORMAT_ZIP
184                                 << DICT_TF_FORMAT_SHIFT;
185 -#if DICT_TF_ZSSIZE_MAX < 1
186 -# error "DICT_TF_ZSSIZE_MAX < 1"
187 -#endif
188 +//#if DICT_TF_ZSSIZE_MAX < 1
189 +//# error "DICT_TF_ZSSIZE_MAX < 1"
190 +//#endif
191                 }
192         }
193  
194 @@ -11432,6 +11494,16 @@
195    "#### Attention: The checksum is not compatible for normal or disabled version! ####",
196    NULL, NULL, FALSE);
197  
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);
202 +
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);
207 +
208  static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
209    PLUGIN_VAR_READONLY,
210    "The common part for InnoDB table spaces.",
211 @@ -11936,6 +12008,8 @@
212    NULL, NULL, 0, &corrupt_table_action_typelib);
213  
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
226                                         called */
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 @@
233         /* @{ */
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 */
239  
240         buf_page_t                      watch[BUF_POOL_WATCH_SIZE];
241 @@ -1787,9 +1787,9 @@
242                                         pool watches. Protected by
243                                         buf_pool->mutex. */
244  
245 -#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
246 -# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
247 -#endif
248 +//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
249 +//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
250 +//#endif
251  #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
252  # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
253  #endif
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
257 @@ -72,12 +72,13 @@
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 */
263  
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)
269  /* @} */
270  
271  #endif
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
275 @@ -42,7 +42,7 @@
276  /* @} */
277  
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))
281  
282  /** On a page of any file segment, data may be put starting from this
283  offset */
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
287 @@ -672,6 +672,9 @@
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
300 @@ -203,7 +203,7 @@
301         system tablespace */
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
312 @@ -101,7 +101,7 @@
313  if this fails for a log block, then it is equivalent to a media failure in the
314  log. */
315  
316 -#define OS_FILE_LOG_BLOCK_SIZE         512
317 +#define OS_FILE_LOG_BLOCK_SIZE         srv_log_block_size
318  
319  /** Options for file_create @{ */
320  #define        OS_FILE_OPEN                    51
321 @@ -190,6 +190,8 @@
322  extern ulint   os_n_file_writes;
323  extern ulint   os_n_fsyncs;
324  
325 +extern ulint   srv_log_block_size;
326 +
327  #ifdef UNIV_PFS_IO
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
333 @@ -56,8 +56,9 @@
334  
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)"
342  #endif
343  
344  /** Compressed page descriptor */
345 @@ -98,7 +99,7 @@
346  typedef struct page_zip_stat_struct page_zip_stat_t;
347  
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];
351  
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
357 @@ -515,9 +515,9 @@
358  /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
359  #define TRX_SYS_MYSQL_LOG_MAGIC_N      873422344
360  
361 -#if UNIV_PAGE_SIZE < 4096
362 -# error "UNIV_PAGE_SIZE < 4096"
363 -#endif
364 +//#if UNIV_PAGE_SIZE < 4096
365 +//# error "UNIV_PAGE_SIZE < 4096"
366 +//#endif
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
373 @@ -311,9 +311,13 @@
374  */
375  
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)
386  
387  /* Maximum number of parallel threads in a parallelized operation */
388  #define UNIV_MAX_PARALLELISM   32
389 @@ -432,7 +436,7 @@
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. */
392  
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)
395  
396  /* Some macros to improve branch prediction and reduce cache misses */
397  #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
398 @@ -535,4 +539,6 @@
399         UNIV_MEM_ALLOC(addr, size);                     \
400  } while (0)
401  
402 +extern ulint   srv_page_size_shift;
403 +extern ulint   srv_page_size;
404  #endif
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
408 @@ -604,7 +604,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 @@ -1201,6 +1203,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 @@ -1794,9 +1799,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 @@ -1810,6 +1813,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 @@ -1823,7 +1827,9 @@
448  
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 */
456  
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
461 @@ -712,8 +712,22 @@
462  
463                         group->lsn = mach_read_from_8(
464                                 buf + LOG_CHECKPOINT_LSN);
465 +
466 +#ifdef UNIV_LOG_ARCHIVE
467 +#error "UNIV_LOG_ARCHIVE could not be enabled"
468 +#endif
469 +                       {
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;
475 +                               } else {
476                         group->lsn_offset = mach_read_from_4(
477                                 buf + LOG_CHECKPOINT_OFFSET);
478 +                               }
479 +                       }
480 +
481                         checkpoint_no = mach_read_from_8(
482                                 buf + LOG_CHECKPOINT_NO);
483  
484 @@ -2955,6 +2969,7 @@
485         log_group_t*    max_cp_group;
486         log_group_t*    up_to_date_group;
487         ulint           max_cp_field;
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);
494         }
495  
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;
501 +       }
502 +       if (log_hdr_log_block_size != srv_log_block_size) {
503 +               fprintf(stderr,
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);
508 +               return(DB_ERROR);
509 +       }
510 +
511  #ifdef UNIV_LOG_ARCHIVE
512         group = UT_LIST_GET_FIRST(log_sys->log_groups);
513  
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
517 @@ -49,7 +49,7 @@
518  
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 */
524  
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
529 @@ -97,7 +97,7 @@
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];
535  
536  /** @brief Merge record in row_merge_block_t.
537  
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
541 @@ -234,6 +234,13 @@
542  UNIV_INTERN ulint      srv_n_read_io_threads   = ULINT_MAX;
543  UNIV_INTERN ulint      srv_n_write_io_threads  = ULINT_MAX;
544  
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;
548 +
549 +/* The log block size */
550 +UNIV_INTERN ulint      srv_log_block_size      = 0;
551 +
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 @@
559         }
560  #endif /* UNIV_LOG_ARCHIVE */
561  
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);
567                 fprintf(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");
571  
572                 return(DB_ERROR);
573         }
574 @@ -1574,7 +1576,7 @@
575  
576         for (i = 0; i < srv_n_data_files; i++) {
577  #ifndef __WIN__
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);
581                         fprintf(stderr,
582                                 " InnoDB: Error: file size must be < 4 GB"
This page took 0.131298 seconds and 3 git commands to generate.