~percona-dev/percona-server/release-5.1.49-12-rnt-pre

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# name       : innodb_files_extend.patch
# introduced : 11 or before
# maintainer : Yasufumi
#
#!!! notice !!!
# Any small change to this file in the main branch
# should be done or reviewed by the maintainer!
diff -Nur a/storage/innodb_plugin/buf/buf0buddy.c b/storage/innodb_plugin/buf/buf0buddy.c
--- a/storage/innodb_plugin/buf/buf0buddy.c	2010-08-10 15:31:56.568242479 +0400
+++ b/storage/innodb_plugin/buf/buf0buddy.c	2010-08-10 15:31:57.016993492 +0400
@@ -43,7 +43,7 @@
 #endif /* UNIV_DEBUG */
 /** Statistics of the buddy system, indexed by block size.
 Protected by buf_pool_mutex. */
-UNIV_INTERN buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES + 1];
+UNIV_INTERN buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
 
 /**********************************************************************//**
 Get the offset of the buddy of a compressed page frame.
diff -Nur a/storage/innodb_plugin/fil/fil0fil.c b/storage/innodb_plugin/fil/fil0fil.c
--- a/storage/innodb_plugin/fil/fil0fil.c	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/fil/fil0fil.c	2010-08-10 15:31:57.157004344 +0400
@@ -4588,9 +4588,9 @@
 	ut_ad(ut_is_2pow(zip_size));
 	ut_ad(buf);
 	ut_ad(len > 0);
-#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
-# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
-#endif
+//#if (1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE
+//# error "(1 << UNIV_PAGE_SIZE_SHIFT) != UNIV_PAGE_SIZE"
+//#endif
 	ut_ad(fil_validate());
 #ifndef UNIV_HOTBACKUP
 # ifndef UNIV_LOG_DEBUG
diff -Nur a/storage/innodb_plugin/fsp/fsp0fsp.c b/storage/innodb_plugin/fsp/fsp0fsp.c
--- a/storage/innodb_plugin/fsp/fsp0fsp.c	2010-08-10 15:31:56.548242166 +0400
+++ b/storage/innodb_plugin/fsp/fsp0fsp.c	2010-08-10 15:31:57.427006049 +0400
@@ -658,15 +658,16 @@
 	ulint	offset)		/*!< in: page offset */
 {
 #ifndef DOXYGEN /* Doxygen gets confused of these */
-# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET \
-		+ (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
-#  error
-# endif
+//# if UNIV_PAGE_SIZE <= XDES_ARR_OFFSET
+//		+ (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
+//#  error
+//# endif
 # if PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \
 		+ (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE
 #  error
 # endif
 #endif /* !DOXYGEN */
+	ut_a(UNIV_PAGE_SIZE > XDES_ARR_OFFSET + (UNIV_PAGE_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE);
 	ut_ad(ut_is_2pow(zip_size));
 
 	if (!zip_size) {
@@ -1465,12 +1466,12 @@
 							   mtr);
 		xdes_init(descr, mtr);
 
-#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
-# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
-#endif
-#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
-# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
-#endif
+//#if UNIV_PAGE_SIZE % FSP_EXTENT_SIZE
+//# error "UNIV_PAGE_SIZE % FSP_EXTENT_SIZE != 0"
+//#endif
+//#if PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE
+//# error "PAGE_ZIP_MIN_SIZE % FSP_EXTENT_SIZE != 0"
+//#endif
 
 		if (UNIV_UNLIKELY(init_xdes)) {
 
diff -Nur a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
--- a/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/handler/ha_innodb.cc	2010-08-10 15:31:58.236991347 +0400
@@ -151,6 +151,8 @@
 static ulong innobase_read_io_threads;
 static ulong innobase_write_io_threads;
 
+static ulong innobase_page_size;
+
 static my_bool innobase_thread_concurrency_timer_based;
 static long long innobase_buffer_pool_size, innobase_log_file_size;
 
@@ -2071,6 +2073,36 @@
 	}
 #endif /* UNIV_DEBUG */
 
+	srv_page_size = 0;
+	srv_page_size_shift = 0;
+
+	if (innobase_page_size != (1 << 14)) {
+		uint n_shift;
+
+		fprintf(stderr,
+			"InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
+		for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
+			if (innobase_page_size == ((ulong)1 << n_shift)) {
+				srv_page_size_shift = n_shift;
+				srv_page_size = (1 << srv_page_size_shift);
+				fprintf(stderr,
+					"InnoDB: The universal page size of the database is set to %lu.\n",
+					srv_page_size);
+				break;
+			}
+		}
+	} else {
+		srv_page_size_shift = 14;
+		srv_page_size = (1 << srv_page_size_shift);
+	}
+
+	if (!srv_page_size_shift) {
+		fprintf(stderr,
+			"InnoDB: Error: %lu is not valid value for innodb_page_size.\n",
+			innobase_page_size);
+		goto error;
+	}
+
 #ifndef MYSQL_SERVER
 	innodb_overwrite_relay_log_info = FALSE;
 #endif
@@ -6985,9 +7017,9 @@
 				| DICT_TF_COMPACT
 				| DICT_TF_FORMAT_ZIP
 				<< DICT_TF_FORMAT_SHIFT;
-#if DICT_TF_ZSSIZE_MAX < 1
-# error "DICT_TF_ZSSIZE_MAX < 1"
-#endif
+//#if DICT_TF_ZSSIZE_MAX < 1
+//# error "DICT_TF_ZSSIZE_MAX < 1"
+//#endif
 		}
 	}
 
@@ -11082,6 +11114,11 @@
   "#### Attention: The checksum is not compatible for normal or disabled version! ####",
   NULL, NULL, FALSE);
 
+static MYSQL_SYSVAR_ULONG(page_size, innobase_page_size,
+  PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+  "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!",
+  NULL, NULL, (1 << 14), (1 << 12), (1 << UNIV_PAGE_SIZE_SHIFT_MAX), 0);
+
 static MYSQL_SYSVAR_STR(data_home_dir, innobase_data_home_dir,
   PLUGIN_VAR_READONLY,
   "The common part for InnoDB table spaces.",
@@ -11555,6 +11592,7 @@
   NULL, NULL, 0, 0, 1, 0);
 
 static struct st_mysql_sys_var* innobase_system_variables[]= {
+  MYSQL_SYSVAR(page_size),
   MYSQL_SYSVAR(additional_mem_pool_size),
   MYSQL_SYSVAR(autoextend_increment),
   MYSQL_SYSVAR(buffer_pool_size),
diff -Nur a/storage/innodb_plugin/handler/innodb_patch_info.h b/storage/innodb_plugin/handler/innodb_patch_info.h
--- a/storage/innodb_plugin/handler/innodb_patch_info.h	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/handler/innodb_patch_info.h	2010-08-10 15:31:58.257002834 +0400
@@ -45,5 +45,6 @@
 {"innodb_separate_doublewrite","Add option 'innodb_doublewrite_file' to separate doublewrite dedicated tablespace","","http://www.percona.com/docs/wiki/percona-xtradb"},
 {"innodb_pass_corrupt_table","Treat tables as corrupt instead of crash, when meet corrupt blocks","","http://www.percona.com/docs/wiki/percona-xtradb"},
 {"innodb_fast_checksum","Using the checksum on 32bit-unit calculation","incompatible for unpatched ver.","http://www.percona.com/docs/wiki/percona-xtradb"},
+{"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"},
 {NULL, NULL, NULL, NULL}
 };
diff -Nur a/storage/innodb_plugin/include/buf0buddy.h b/storage/innodb_plugin/include/buf0buddy.h
--- a/storage/innodb_plugin/include/buf0buddy.h	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/buf0buddy.h	2010-08-10 15:31:58.257002834 +0400
@@ -83,7 +83,7 @@
 
 /** Statistics of the buddy system, indexed by block size.
 Protected by buf_pool_mutex. */
-extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES + 1];
+extern buf_buddy_stat_t buf_buddy_stat[BUF_BUDDY_SIZES_MAX + 1];
 
 #ifndef UNIV_NONINL
 # include "buf0buddy.ic"
diff -Nur a/storage/innodb_plugin/include/buf0buf.h b/storage/innodb_plugin/include/buf0buf.h
--- a/storage/innodb_plugin/include/buf0buf.h	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/buf0buf.h	2010-08-10 15:31:58.257002834 +0400
@@ -1452,11 +1452,11 @@
 	/* @{ */
 	UT_LIST_BASE_NODE_T(buf_page_t)	zip_clean;
 					/*!< unmodified compressed pages */
-	UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES];
+	UT_LIST_BASE_NODE_T(buf_page_t) zip_free[BUF_BUDDY_SIZES_MAX];
 					/*!< buddy free lists */
-#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
-# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
-#endif
+//#if BUF_BUDDY_HIGH != UNIV_PAGE_SIZE
+//# error "BUF_BUDDY_HIGH != UNIV_PAGE_SIZE"
+//#endif
 #if BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE
 # error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE"
 #endif
diff -Nur a/storage/innodb_plugin/include/buf0types.h b/storage/innodb_plugin/include/buf0types.h
--- a/storage/innodb_plugin/include/buf0types.h	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/buf0types.h	2010-08-10 15:31:58.257002834 +0400
@@ -70,6 +70,7 @@
 					buddy system; must be at least
 					sizeof(buf_page_t) */
 #define BUF_BUDDY_SIZES		(UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
+#define BUF_BUDDY_SIZES_MAX	(UNIV_PAGE_SIZE_SHIFT_MAX - BUF_BUDDY_LOW_SHIFT)
 					/*!< number of buddy sizes */
 
 /** twice the maximum block size of the buddy system;
diff -Nur a/storage/innodb_plugin/include/mtr0log.ic b/storage/innodb_plugin/include/mtr0log.ic
--- a/storage/innodb_plugin/include/mtr0log.ic	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/mtr0log.ic	2010-08-10 15:31:58.257002834 +0400
@@ -203,7 +203,7 @@
 	system tablespace */
 	if ((space == TRX_SYS_SPACE
 	     || (srv_doublewrite_file && space == TRX_DOUBLEWRITE_SPACE))
-	    && offset >= FSP_EXTENT_SIZE && offset < 3 * FSP_EXTENT_SIZE) {
+	    && offset >= (ulint)FSP_EXTENT_SIZE && offset < 3 * (ulint)FSP_EXTENT_SIZE) {
 		if (trx_doublewrite_buf_is_being_created) {
 			/* Do nothing: we only come to this branch in an
 			InnoDB database creation. We do not redo log
diff -Nur a/storage/innodb_plugin/include/page0types.h b/storage/innodb_plugin/include/page0types.h
--- a/storage/innodb_plugin/include/page0types.h	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/page0types.h	2010-08-10 15:31:58.257002834 +0400
@@ -56,8 +56,9 @@
 
 /** Number of supported compressed page sizes */
 #define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
-#if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)
-# error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)"
+#define PAGE_ZIP_NUM_SSIZE_MAX (UNIV_PAGE_SIZE_SHIFT_MAX - PAGE_ZIP_MIN_SIZE_SHIFT + 2)
+#if PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)
+# error "PAGE_ZIP_NUM_SSIZE_MAX > (1 << PAGE_ZIP_SSIZE_BITS)"
 #endif
 
 /** Compressed page descriptor */
@@ -98,7 +99,7 @@
 typedef struct page_zip_stat_struct page_zip_stat_t;
 
 /** Statistics on compression, indexed by page_zip_des_struct::ssize - 1 */
-extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
+extern page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
 
 /**********************************************************************//**
 Write the "deleted" flag of a record on a compressed page.  The flag must
diff -Nur a/storage/innodb_plugin/include/trx0sys.h b/storage/innodb_plugin/include/trx0sys.h
--- a/storage/innodb_plugin/include/trx0sys.h	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/trx0sys.h	2010-08-10 15:31:58.257002834 +0400
@@ -515,9 +515,9 @@
 /** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
 #define TRX_SYS_MYSQL_LOG_MAGIC_N	873422344
 
-#if UNIV_PAGE_SIZE < 4096
-# error "UNIV_PAGE_SIZE < 4096"
-#endif
+//#if UNIV_PAGE_SIZE < 4096
+//# error "UNIV_PAGE_SIZE < 4096"
+//#endif
 /** The offset of the MySQL replication info in the trx system header;
 this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
 #define TRX_SYS_MYSQL_MASTER_LOG_INFO	(UNIV_PAGE_SIZE - 2000)
diff -Nur a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i
--- a/storage/innodb_plugin/include/univ.i	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/include/univ.i	2010-08-10 15:31:58.257002834 +0400
@@ -283,9 +283,13 @@
 */
 
 /* The 2-logarithm of UNIV_PAGE_SIZE: */
-#define UNIV_PAGE_SIZE_SHIFT	14
+/* #define UNIV_PAGE_SIZE_SHIFT	14 */
+#define UNIV_PAGE_SIZE_SHIFT_MAX	14
+#define UNIV_PAGE_SIZE_SHIFT	srv_page_size_shift
 /* The universal page size of the database */
-#define UNIV_PAGE_SIZE		(1 << UNIV_PAGE_SIZE_SHIFT)
+/* #define UNIV_PAGE_SIZE		(1 << UNIV_PAGE_SIZE_SHIFT) */
+#define UNIV_PAGE_SIZE		srv_page_size
+#define UNIV_PAGE_SIZE_MAX	(1 << UNIV_PAGE_SIZE_SHIFT_MAX)
 
 /* Maximum number of parallel threads in a parallelized operation */
 #define UNIV_MAX_PARALLELISM	32
@@ -384,7 +388,7 @@
 stored part of the field in the tablespace. The length field then
 contains the sum of the following flag and the locally stored len. */
 
-#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)
+#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE_MAX)
 
 /* Some macros to improve branch prediction and reduce cache misses */
 #if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
@@ -487,4 +491,6 @@
 	UNIV_MEM_ALLOC(addr, size);			\
 } while (0)
 
+extern ulint	srv_page_size_shift;
+extern ulint	srv_page_size;
 #endif
diff -Nur a/storage/innodb_plugin/log/log0log.c b/storage/innodb_plugin/log/log0log.c
--- a/storage/innodb_plugin/log/log0log.c	2010-08-10 15:31:56.548242166 +0400
+++ b/storage/innodb_plugin/log/log0log.c	2010-08-10 15:31:58.257002834 +0400
@@ -591,7 +591,9 @@
 
 	offset = (gr_lsn_size_offset + difference) % group_size;
 
+	if (sizeof(ulint) == 4) {
 	ut_a(offset < (((ib_int64_t) 1) << 32)); /* offset must be < 4 GB */
+	}
 
 	/* fprintf(stderr,
 	"Offset is %lu gr_lsn_offset is %lu difference is %lu\n",
@@ -1791,6 +1793,7 @@
 	mach_write_to_4(buf + LOG_CHECKPOINT_LOG_BUF_SIZE, log_sys->buf_size);
 
 #ifdef UNIV_LOG_ARCHIVE
+#error "UNIV_LOG_ARCHIVE could not be enabled"
 	if (log_sys->archiving_state == LOG_ARCH_OFF) {
 		archived_lsn = IB_ULONGLONG_MAX;
 	} else {
@@ -1804,7 +1807,9 @@
 
 	mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn);
 #else /* UNIV_LOG_ARCHIVE */
-	mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX);
+	mach_write_ull(buf + LOG_CHECKPOINT_ARCHIVED_LSN,
+			(ib_uint64_t)log_group_calc_lsn_offset(
+				log_sys->next_checkpoint_lsn, group));
 #endif /* UNIV_LOG_ARCHIVE */
 
 	for (i = 0; i < LOG_MAX_N_GROUPS; i++) {
diff -Nur a/storage/innodb_plugin/log/log0recv.c b/storage/innodb_plugin/log/log0recv.c
--- a/storage/innodb_plugin/log/log0recv.c	2010-08-10 15:31:56.548242166 +0400
+++ b/storage/innodb_plugin/log/log0recv.c	2010-08-10 15:31:58.257002834 +0400
@@ -704,8 +704,22 @@
 
 			group->lsn = mach_read_ull(
 				buf + LOG_CHECKPOINT_LSN);
+
+#ifdef UNIV_LOG_ARCHIVE
+#error "UNIV_LOG_ARCHIVE could not be enabled"
+#endif
+			{
+			ib_uint64_t tmp_lsn_offset = mach_read_ull(
+					buf + LOG_CHECKPOINT_ARCHIVED_LSN);
+				if (sizeof(ulint) != 4
+				    && tmp_lsn_offset != IB_ULONGLONG_MAX) {
+					group->lsn_offset = (ulint) tmp_lsn_offset;
+				} else {
 			group->lsn_offset = mach_read_from_4(
 				buf + LOG_CHECKPOINT_OFFSET);
+				}
+			}
+
 			checkpoint_no = mach_read_ull(
 				buf + LOG_CHECKPOINT_NO);
 
diff -Nur a/storage/innodb_plugin/page/page0zip.c b/storage/innodb_plugin/page/page0zip.c
--- a/storage/innodb_plugin/page/page0zip.c	2010-08-10 15:31:56.548242166 +0400
+++ b/storage/innodb_plugin/page/page0zip.c	2010-08-10 15:31:58.266991537 +0400
@@ -49,7 +49,7 @@
 
 #ifndef UNIV_HOTBACKUP
 /** Statistics on compression, indexed by page_zip_des_t::ssize - 1 */
-UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE - 1];
+UNIV_INTERN page_zip_stat_t page_zip_stat[PAGE_ZIP_NUM_SSIZE_MAX - 1];
 #endif /* !UNIV_HOTBACKUP */
 
 /* Please refer to ../include/page0zip.ic for a description of the
diff -Nur a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c
--- a/storage/innodb_plugin/row/row0merge.c	2010-08-10 15:31:56.548242166 +0400
+++ b/storage/innodb_plugin/row/row0merge.c	2010-08-10 15:31:58.266991537 +0400
@@ -92,7 +92,7 @@
 row_merge_block_t.  Thus, it must be able to hold one merge record,
 whose maximum size is the same as the minimum size of
 row_merge_block_t. */
-typedef byte	mrec_buf_t[UNIV_PAGE_SIZE];
+typedef byte	mrec_buf_t[UNIV_PAGE_SIZE_MAX];
 
 /** @brief Merge record in row_merge_block_t.
 
diff -Nur a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
--- a/storage/innodb_plugin/srv/srv0srv.c	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/srv/srv0srv.c	2010-08-10 15:31:58.266991537 +0400
@@ -217,6 +217,10 @@
 UNIV_INTERN ulint	srv_n_read_io_threads	= ULINT_MAX;
 UNIV_INTERN ulint	srv_n_write_io_threads	= ULINT_MAX;
 
+/* The universal page size of the database */
+UNIV_INTERN ulint	srv_page_size_shift	= 0;
+UNIV_INTERN ulint	srv_page_size		= 0;
+
 /* User settable value of the number of pages that must be present
 in the buffer cache and accessed sequentially for InnoDB to trigger a
 readahead request. */
diff -Nur a/storage/innodb_plugin/srv/srv0start.c b/storage/innodb_plugin/srv/srv0start.c
--- a/storage/innodb_plugin/srv/srv0start.c	2010-08-10 15:31:56.558241205 +0400
+++ b/storage/innodb_plugin/srv/srv0start.c	2010-08-10 15:31:58.266991537 +0400
@@ -1489,10 +1489,12 @@
 	}
 #endif /* UNIV_LOG_ARCHIVE */
 
-	if (srv_n_log_files * srv_log_file_size >= 262144) {
+	if (sizeof(ulint) == 4
+	    && srv_n_log_files * srv_log_file_size
+	       >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
 		fprintf(stderr,
 			"InnoDB: Error: combined size of log files"
-			" must be < 4 GB\n");
+			" must be < 4 GB on 32-bit systems\n");
 
 		return(DB_ERROR);
 	}
@@ -1501,7 +1503,7 @@
 
 	for (i = 0; i < srv_n_data_files; i++) {
 #ifndef __WIN__
-		if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= 262144) {
+		if (sizeof(off_t) < 5 && srv_data_file_sizes[i] >= ((ulint)1 << (32 - UNIV_PAGE_SIZE_SHIFT))) {
 			fprintf(stderr,
 				"InnoDB: Error: file size must be < 4 GB"
 				" with this MySQL binary\n"