# 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! --- a/storage/innobase/fil/fil0fil.c +++ b/storage/innobase/fil/fil0fil.c @@ -731,7 +731,7 @@ ut_a(space->purpose != FIL_LOG); ut_a(!trx_sys_sys_space(space->id)); - if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { + if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) { fprintf(stderr, "InnoDB: Error: the size of single-table" " tablespace file %s\n" @@ -4169,7 +4169,7 @@ size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low; #ifndef UNIV_HOTBACKUP - if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { + if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) { fprintf(stderr, "InnoDB: Error: the size of single-table tablespace" " file %s\n" @@ -4189,7 +4189,7 @@ /* Align the memory for file i/o if we might have O_DIRECT set */ page = ut_align(buf2, UNIV_PAGE_SIZE); - if (size >= FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { + if (size >= FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) { success = os_file_read(file, page, 0, 0, UNIV_PAGE_SIZE); /* We have to read the tablespace id from the file */ @@ -5167,9 +5167,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_skip()); #ifndef UNIV_HOTBACKUP # ifndef UNIV_LOG_DEBUG --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c @@ -595,16 +595,18 @@ 0 for uncompressed pages */ 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 PAGE_ZIP_MIN_SIZE <= XDES_ARR_OFFSET \ - + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE -# error -# endif -#endif /* !DOXYGEN */ +//#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 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_a(PAGE_ZIP_MIN_SIZE > XDES_ARR_OFFSET + (PAGE_ZIP_MIN_SIZE / FSP_EXTENT_SIZE) * XDES_SIZE); ut_ad(ut_is_2pow(zip_size)); if (!zip_size) { @@ -1403,12 +1405,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)) { --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -148,6 +148,9 @@ static ulong innobase_write_io_threads; static long innobase_buffer_pool_instances = 1; +static ulong innobase_page_size; +static ulong innobase_log_block_size; + static my_bool innobase_thread_concurrency_timer_based; static long long innobase_buffer_pool_size, innobase_log_file_size; @@ -2352,6 +2355,65 @@ } #endif /* DBUG_OFF */ + 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 a valid value for innodb_page_size.\n" + "InnoDB: Error: Valid values are 4096, 8192, and 16384 (default=16384).\n", + innobase_page_size); + goto error; + } + + srv_log_block_size = 0; + if (innobase_log_block_size != (1 << 9)) { /*!=512*/ + uint n_shift; + + fprintf(stderr, + "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n"); + for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) { + if (innobase_log_block_size == ((ulong)1 << n_shift)) { + srv_log_block_size = (1 << n_shift); + fprintf(stderr, + "InnoDB: The log block size is set to %lu.\n", + srv_log_block_size); + break; + } + } + } else { + srv_log_block_size = 512; + } + + if (!srv_log_block_size) { + fprintf(stderr, + "InnoDB: Error: %lu is not a valid value for innodb_log_block_size.\n" + "InnoDB: Error: A valid value for innodb_log_block_size is\n" + "InnoDB: Error: a power of 2 from 512 to 16384.\n", + innobase_log_block_size); + goto error; + } + #ifndef MYSQL_SERVER innodb_overwrite_relay_log_info = FALSE; #endif @@ -7289,9 +7351,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 } } @@ -11552,6 +11614,16 @@ "#### 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_ULONG(log_block_size, innobase_log_block_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!", + NULL, NULL, (1 << 9)/*512*/, (1 << 9)/*512*/, (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.", @@ -12118,6 +12190,8 @@ NULL, NULL, 0, &corrupt_table_action_typelib); static struct st_mysql_sys_var* innobase_system_variables[]= { + MYSQL_SYSVAR(page_size), + MYSQL_SYSVAR(log_block_size), MYSQL_SYSVAR(additional_mem_pool_size), MYSQL_SYSVAR(autoextend_increment), MYSQL_SYSVAR(buffer_pool_size), --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1725,7 +1725,7 @@ time_t last_printout_time; /*!< when buf_print_io was last time called */ - buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES + 1]; + buf_buddy_stat_t buddy_stat[BUF_BUDDY_SIZES_MAX + 1]; /*!< Statistics of buddy system, indexed by block size */ buf_pool_stat_t stat; /*!< current statistics */ @@ -1823,7 +1823,7 @@ UT_LIST_BASE_NODE_T(buf_page_t) zip_clean; /*!< unmodified compressed pages */ #endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */ - 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 */ buf_page_t watch[BUF_POOL_WATCH_SIZE]; @@ -1831,9 +1831,9 @@ pool watches. Protected by buf_pool->mutex. */ -#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 --- a/storage/innobase/include/buf0types.h +++ b/storage/innobase/include/buf0types.h @@ -70,12 +70,13 @@ #define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT) #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; the underlying memory is aligned by this amount: this must be equal to UNIV_PAGE_SIZE */ -#define BUF_BUDDY_HIGH (BUF_BUDDY_LOW << BUF_BUDDY_SIZES) +#define BUF_BUDDY_HIGH ((ulint)BUF_BUDDY_LOW << BUF_BUDDY_SIZES) /* @} */ #endif --- a/storage/innobase/include/fsp0types.h +++ b/storage/innobase/include/fsp0types.h @@ -42,7 +42,7 @@ /* @} */ /** File space extent size (one megabyte) in pages */ -#define FSP_EXTENT_SIZE (1 << (20 - UNIV_PAGE_SIZE_SHIFT)) +#define FSP_EXTENT_SIZE ((ulint)1 << (20 - UNIV_PAGE_SIZE_SHIFT)) /** On a page of any file segment, data may be put starting from this offset */ --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -672,6 +672,9 @@ when mysqld is first time started on the restored database, it can print helpful info for the user */ +#define LOG_FILE_OS_FILE_LOG_BLOCK_SIZE 64 + /* extend to record log_block_size + of XtraDB. 0 means default 512 */ #define LOG_FILE_ARCH_COMPLETED OS_FILE_LOG_BLOCK_SIZE /* this 4-byte field is TRUE when the writing of an archived log file --- a/storage/innobase/include/mtr0log.ic +++ b/storage/innobase/include/mtr0log.ic @@ -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 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -101,7 +101,7 @@ if this fails for a log block, then it is equivalent to a media failure in the log. */ -#define OS_FILE_LOG_BLOCK_SIZE 512 +#define OS_FILE_LOG_BLOCK_SIZE srv_log_block_size /** Options for file_create @{ */ #define OS_FILE_OPEN 51 @@ -190,6 +190,8 @@ extern ulint os_n_file_writes; extern ulint os_n_fsyncs; +extern ulint srv_log_block_size; + #ifdef UNIV_PFS_IO /* Keys to register InnoDB I/O with performance schema */ extern mysql_pfs_key_t innodb_file_data_key; --- a/storage/innobase/include/page0types.h +++ b/storage/innobase/include/page0types.h @@ -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 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -526,9 +526,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) --- a/storage/innobase/include/univ.i +++ b/storage/innobase/include/univ.i @@ -313,9 +313,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 @@ -434,7 +438,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) @@ -537,4 +541,6 @@ UNIV_MEM_ALLOC(addr, size); \ } while (0) +extern ulint srv_page_size_shift; +extern ulint srv_page_size; #endif --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -604,7 +604,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", @@ -1201,6 +1203,9 @@ /* Wipe over possible label of ibbackup --restore */ memcpy(buf + LOG_FILE_WAS_CREATED_BY_HOT_BACKUP, " ", 4); + mach_write_to_4(buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE, + srv_log_block_size); + dest_offset = nth_file * group->file_size; #ifdef UNIV_DEBUG @@ -1797,9 +1802,7 @@ ulint i; ut_ad(mutex_own(&(log_sys->mutex))); -#if LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE -# error "LOG_CHECKPOINT_SIZE > OS_FILE_LOG_BLOCK_SIZE" -#endif + ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE); buf = group->checkpoint_buf; @@ -1813,6 +1816,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 { @@ -1826,7 +1830,9 @@ mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, archived_lsn); #else /* UNIV_LOG_ARCHIVE */ - mach_write_to_8(buf + LOG_CHECKPOINT_ARCHIVED_LSN, IB_ULONGLONG_MAX); + mach_write_to_8(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++) { --- a/storage/innobase/log/log0recv.c +++ b/storage/innobase/log/log0recv.c @@ -712,8 +712,22 @@ group->lsn = mach_read_from_8( 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_from_8( + 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_from_8( buf + LOG_CHECKPOINT_NO); @@ -2955,6 +2969,7 @@ log_group_t* max_cp_group; log_group_t* up_to_date_group; ulint max_cp_field; + ulint log_hdr_log_block_size; ib_uint64_t checkpoint_lsn; ib_uint64_t checkpoint_no; ib_uint64_t old_scanned_lsn; @@ -3056,6 +3071,21 @@ log_hdr_buf, max_cp_group); } + log_hdr_log_block_size + = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE); + if (log_hdr_log_block_size == 0) { + /* 0 means default value */ + log_hdr_log_block_size = 512; + } + if (log_hdr_log_block_size != srv_log_block_size) { + fprintf(stderr, + "InnoDB: Error: The block size of ib_logfile (%lu) " + "is not equal to innodb_log_block_size.\n" + "InnoDB: Error: Suggestion - Recreate log files.\n", + log_hdr_log_block_size); + return(DB_ERROR); + } + #ifdef UNIV_LOG_ARCHIVE group = UT_LIST_GET_FIRST(log_sys->log_groups); --- a/storage/innobase/page/page0zip.c +++ b/storage/innobase/page/page0zip.c @@ -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 --- a/storage/innobase/row/row0merge.c +++ b/storage/innobase/row/row0merge.c @@ -97,7 +97,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. --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -236,6 +236,14 @@ /* Switch to enable random read ahead. */ UNIV_INTERN my_bool srv_random_read_ahead = FALSE; + +/* The universal page size of the database */ +UNIV_INTERN ulint srv_page_size_shift = 0; +UNIV_INTERN ulint srv_page_size = 0; + +/* The log block size */ +UNIV_INTERN ulint srv_log_block_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. */ --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -1582,11 +1582,13 @@ } #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))) { ut_print_timestamp(stderr); 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); } @@ -1595,7 +1597,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))) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: file size must be < 4 GB"