From: kevin.lewis Date: March 23 2011 1:47pm Subject: bzr push into mysql-trunk-innodb branch (kevin.lewis:3550) List-Archive: http://lists.mysql.com/commits/133646 Message-Id: <20110323134759.E968ED6D9D1@kevin-lewis-macbook.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3550 kevin.lewis@stripped 2011-03-23 [merge] merge modified: storage/innobase/include/btr0pcur.h storage/innobase/include/btr0pcur.ic storage/innobase/include/page0page.h storage/innobase/include/rem0rec.h storage/innobase/include/rem0rec.ic storage/innobase/include/srv0srv.h storage/innobase/include/thr0loc.h storage/innobase/page/page0page.c storage/innobase/srv/srv0srv.c storage/innobase/thr/thr0loc.c === modified file 'storage/innobase/btr/btr0cur.c' --- a/storage/innobase/btr/btr0cur.c revid:marko.makela@stripped +++ b/storage/innobase/btr/btr0cur.c revid:kevin.lewis@stripped @@ -4534,8 +4534,8 @@ btr_check_blob_fil_page_type( ulint flags = fil_space_get_flags(space_id); #ifndef UNIV_DEBUG /* Improve debug test coverage */ - if (UNIV_LIKELY - ((flags & DICT_TF_FORMAT_MASK) == DICT_TF_FORMAT_51)) { + if (UNIV_LIKELY((flags & DICT_TF_FORMAT_MASK) + == (UNIV_FORMAT_A << DICT_TF_FORMAT_SHIFT))) { /* Old versions of InnoDB did not initialize FIL_PAGE_TYPE on BLOB pages. Do not print anything about the type mismatch when reading @@ -4935,8 +4935,8 @@ btr_copy_zblob_prefix( page_zip_set_alloc(&d_stream, heap); ut_ad(ut_is_2pow(zip_size)); - ut_ad(zip_size >= PAGE_ZIP_MIN_SIZE); - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size >= UNIV_ZIP_SIZE_MIN); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); ut_ad(space_id); err = inflateInit(&d_stream); === modified file 'storage/innobase/buf/buf0buddy.c' --- a/storage/innobase/buf/buf0buddy.c revid:marko.makela@stripped +++ b/storage/innobase/buf/buf0buddy.c revid:kevin.lewis@stripped @@ -434,13 +434,13 @@ buf_buddy_relocate( /* We look inside the allocated objects returned by buf_buddy_alloc() and assume that anything of - PAGE_ZIP_MIN_SIZE or larger is a compressed page that contains + UNIV_ZIP_SIZE_MIN or larger is a compressed page that contains a valid space_id and page_no in the page header. Should the fields be invalid, we will be unable to relocate the block. We also assume that anything that fits sizeof(buf_page_t) actually is a properly initialized buf_page_t object. */ - if (size >= PAGE_ZIP_MIN_SIZE) { + if (size >= UNIV_ZIP_SIZE_MIN) { /* This is a compressed page. */ mutex_t* mutex; @@ -659,7 +659,7 @@ buddy_nonfree: /* Free the block to the buddy list. */ bpage = buf; #ifdef UNIV_DEBUG - if (i < buf_buddy_get_slot(PAGE_ZIP_MIN_SIZE)) { + if (i < buf_buddy_get_slot(UNIV_ZIP_SIZE_MIN)) { /* This area has most likely been allocated for at least one compressed-only block descriptor. Check that there are no live objects in the area. This is === modified file 'storage/innobase/buf/buf0buf.c' --- a/storage/innobase/buf/buf0buf.c revid:marko.makela@stripped +++ b/storage/innobase/buf/buf0buf.c revid:kevin.lewis@stripped @@ -5619,7 +5619,7 @@ buf_page_init_for_backup_restore( /* We assume that block->page.data has been allocated with zip_size == UNIV_PAGE_SIZE. */ - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); ut_ad(ut_is_2pow(zip_size)); page_zip_set_size(&block->page.zip, zip_size); if (zip_size) { === modified file 'storage/innobase/buf/buf0flu.c' --- a/storage/innobase/buf/buf0flu.c revid:marko.makela@stripped +++ b/storage/innobase/buf/buf0flu.c revid:kevin.lewis@stripped @@ -1021,7 +1021,7 @@ buf_flush_init_for_writing( ulint zip_size = page_zip_get_size(page_zip); ut_ad(zip_size); ut_ad(ut_is_2pow(zip_size)); - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); switch (UNIV_EXPECT(fil_page_get_type(page), FIL_PAGE_INDEX)) { case FIL_PAGE_TYPE_ALLOCATED: === modified file 'storage/innobase/data/data0data.c' --- a/storage/innobase/data/data0data.c revid:marko.makela@stripped +++ b/storage/innobase/data/data0data.c revid:kevin.lewis@stripped @@ -583,7 +583,7 @@ dtuple_convert_big_rec( return(NULL); } - if (dict_table_get_format(index->table) < DICT_TF_FORMAT_ZIP) { + if (dict_table_get_format(index->table) < UNIV_FORMAT_B) { /* up to MySQL 5.1: store a 768-byte prefix locally */ local_len = BTR_EXTERN_FIELD_REF_SIZE + DICT_MAX_INDEX_COL_LEN; } else { === modified file 'storage/innobase/dict/dict0crea.c' --- a/storage/innobase/dict/dict0crea.c revid:marko.makela@stripped +++ b/storage/innobase/dict/dict0crea.c revid:kevin.lewis@stripped @@ -99,7 +99,7 @@ dict_create_sys_tables_tuple( ptr = mem_heap_alloc(heap, 4); if (table->flags & ~DICT_TF_COMPACT) { ut_a(table->flags & DICT_TF_COMPACT); - ut_a(dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP); + ut_a(dict_table_get_format(table) >= UNIV_FORMAT_B); ut_a((table->flags & DICT_TF_ZSSIZE_MASK) <= (DICT_TF_ZSSIZE_MAX << DICT_TF_ZSSIZE_SHIFT)); ut_a(!(table->flags & ~DICT_TF_BIT_MASK)); @@ -289,9 +289,9 @@ dict_build_table_def_step( is_path = FALSE; } - ut_ad(dict_table_get_format(table) <= DICT_TF_FORMAT_MAX); + ut_ad(dict_table_get_format(table) <= UNIV_FORMAT_MAX); ut_ad(!dict_table_zip_size(table) - || dict_table_get_format(table) >= DICT_TF_FORMAT_ZIP); + || dict_table_get_format(table) >= UNIV_FORMAT_B); flags = table->flags; ut_a(!(flags & ~DICT_TF_BIT_MASK)); @@ -1128,7 +1128,7 @@ dict_create_index_step( node->table, node->index, FIL_NULL, trx_is_strict(trx) || dict_table_get_format(node->table) - >= DICT_TF_FORMAT_ZIP); + >= UNIV_FORMAT_B); node->index = dict_index_get_if_in_cache_low(index_id); ut_a(!node->index == (err != DB_SUCCESS)); === modified file 'storage/innobase/dict/dict0dict.c' --- a/storage/innobase/dict/dict0dict.c revid:marko.makela@stripped +++ b/storage/innobase/dict/dict0dict.c revid:kevin.lewis@stripped @@ -1988,14 +1988,14 @@ too_big: } switch (dict_table_get_format(table)) { - case DICT_TF_FORMAT_51: + case UNIV_FORMAT_A: /* ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT store prefixes of externally stored columns locally within the record. There are no special considerations for the undo log record size. */ goto undo_size_ok; - case DICT_TF_FORMAT_ZIP: + case UNIV_FORMAT_B: /* In ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPRESSED, column prefix indexes require that prefixes of externally stored columns are written to the undo log. @@ -2005,8 +2005,8 @@ too_big: checked for below. */ break; -#if DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX -# error "DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX" +#if UNIV_FORMAT_B != UNIV_FORMAT_MAX +# error "UNIV_FORMAT_B != UNIV_FORMAT_MAX" #endif } === modified file 'storage/innobase/dict/dict0load.c' --- a/storage/innobase/dict/dict0load.c revid:marko.makela@stripped +++ b/storage/innobase/dict/dict0load.c revid:kevin.lewis@stripped @@ -612,15 +612,15 @@ dict_sys_tables_get_flags( switch (flags & (DICT_TF_FORMAT_MASK | DICT_TF_COMPACT)) { default: - case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT: - case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT: + case UNIV_FORMAT_A << DICT_TF_FORMAT_SHIFT: + case UNIV_FORMAT_A << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT: /* flags should be DICT_TABLE_ORDINARY, or DICT_TF_FORMAT_MASK should be nonzero. */ return(ULINT_UNDEFINED); - case DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT: -#if DICT_TF_FORMAT_MAX > DICT_TF_FORMAT_ZIP -# error "missing case labels for DICT_TF_FORMAT_ZIP .. DICT_TF_FORMAT_MAX" + case UNIV_FORMAT_B << DICT_TF_FORMAT_SHIFT | DICT_TF_COMPACT: +#if UNIV_FORMAT_MAX > UNIV_FORMAT_B +# error "missing case labels for UNIV_FORMAT_B .. UNIV_FORMAT_MAX" #endif /* We support this format. */ break; === modified file 'storage/innobase/fil/fil0fil.c' --- a/storage/innobase/fil/fil0fil.c revid:marko.makela@stripped +++ b/storage/innobase/fil/fil0fil.c revid:kevin.lewis@stripped @@ -2788,7 +2788,7 @@ error_exit2: page_zip_des_t page_zip; ulint zip_size; - zip_size = ((PAGE_ZIP_MIN_SIZE >> 1) + zip_size = ((UNIV_ZIP_SIZE_MIN >> 1) << ((flags & DICT_TF_ZSSIZE_MASK) >> DICT_TF_ZSSIZE_SHIFT)); @@ -2955,7 +2955,7 @@ fil_reset_too_high_lsns( fputs(".\n", stderr); ut_a(ut_is_2pow(zip_size)); - ut_a(zip_size <= UNIV_PAGE_SIZE); + ut_a(zip_size <= UNIV_ZIP_SIZE_MAX); /* Loop through all the pages in the tablespace and reset the lsn and the page checksum if necessary */ === modified file 'storage/innobase/fsp/fsp0fsp.c' --- a/storage/innobase/fsp/fsp0fsp.c revid:marko.makela@stripped +++ b/storage/innobase/fsp/fsp0fsp.c revid:kevin.lewis@stripped @@ -365,8 +365,8 @@ fsp_get_space_header( fsp_header_t* header; ut_ad(ut_is_2pow(zip_size)); - ut_ad(zip_size <= UNIV_PAGE_SIZE); - ut_ad(!zip_size || zip_size >= PAGE_ZIP_MIN_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); + ut_ad(!zip_size || zip_size >= UNIV_ZIP_SIZE_MIN); ut_ad(id || !zip_size); block = buf_page_get(id, zip_size, 0, RW_X_LATCH, mtr); @@ -656,8 +656,8 @@ xdes_calc_descriptor_page( + (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 +# if UNIV_ZIP_SIZE_MIN <= XDES_ARR_OFFSET \ + + (UNIV_ZIP_SIZE_MIN / FSP_EXTENT_SIZE) * XDES_SIZE # error # endif #endif /* !DOXYGEN */ @@ -1361,8 +1361,8 @@ fsp_fill_free_list( zip_size = dict_table_flags_to_zip_size( mach_read_from_4(FSP_SPACE_FLAGS + header)); ut_a(ut_is_2pow(zip_size)); - ut_a(zip_size <= UNIV_PAGE_SIZE); - ut_a(!zip_size || zip_size >= PAGE_ZIP_MIN_SIZE); + ut_a(zip_size <= UNIV_ZIP_SIZE_MAX); + ut_a(!zip_size || zip_size >= UNIV_ZIP_SIZE_MIN); if (space == 0 && srv_auto_extend_last_data_file && size < limit + FSP_EXTENT_SIZE * FSP_FREE_ADD) { @@ -1456,8 +1456,8 @@ fsp_fill_free_list( #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" +#if UNIV_ZIP_SIZE_MIN % FSP_EXTENT_SIZE +# error "UNIV_ZIP_SIZE_MIN % FSP_EXTENT_SIZE != 0" #endif if (UNIV_UNLIKELY(init_xdes)) { @@ -3935,8 +3935,8 @@ fsp_validate( latch = fil_space_get_latch(space, &flags); zip_size = dict_table_flags_to_zip_size(flags); ut_a(ut_is_2pow(zip_size)); - ut_a(zip_size <= UNIV_PAGE_SIZE); - ut_a(!zip_size || zip_size >= PAGE_ZIP_MIN_SIZE); + ut_a(zip_size <= UNIV_ZIP_SIZE_MAX); + ut_a(!zip_size || zip_size >= UNIV_ZIP_SIZE_MIN); /* Start first a mini-transaction mtr2 to lock out all other threads from the fsp system */ === modified file 'storage/innobase/handler/ha_innodb.cc' --- a/storage/innobase/handler/ha_innodb.cc revid:marko.makela@stripped +++ b/storage/innobase/handler/ha_innodb.cc revid:kevin.lewis@stripped @@ -2528,7 +2528,7 @@ mem_free_and_error: format_id = innobase_file_format_name_lookup( innobase_file_format_name); - if (format_id > DICT_TF_FORMAT_MAX) { + if (format_id > UNIV_FORMAT_MAX) { sql_print_error("InnoDB: wrong innodb_file_format."); @@ -2554,12 +2554,12 @@ mem_free_and_error: if (!innobase_file_format_check) { /* Set the value to disable checking. */ - srv_max_file_format_at_startup = DICT_TF_FORMAT_MAX + 1; + srv_max_file_format_at_startup = UNIV_FORMAT_MAX + 1; } else { /* Set the value to the lowest supported format. */ - srv_max_file_format_at_startup = DICT_TF_FORMAT_MIN; + srv_max_file_format_at_startup = UNIV_FORMAT_MIN; } /* Did the user specify a format name that we support? @@ -2573,7 +2573,7 @@ mem_free_and_error: "should be any value up to %s or its " "equivalent numeric id", trx_sys_file_format_id_to_name( - DICT_TF_FORMAT_MAX)); + UNIV_FORMAT_MAX)); goto mem_free_and_error; } @@ -3298,16 +3298,16 @@ ha_innobase::get_row_type() const ut_ad(flags & DICT_TF_COMPACT); switch (flags & DICT_TF_FORMAT_MASK) { - case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT: + case UNIV_FORMAT_A << DICT_TF_FORMAT_SHIFT: return(ROW_TYPE_COMPACT); - case DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT: + case UNIV_FORMAT_B << DICT_TF_FORMAT_SHIFT: if (flags & DICT_TF_ZSSIZE_MASK) { return(ROW_TYPE_COMPRESSED); } else { return(ROW_TYPE_DYNAMIC); } -#if DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX -# error "DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX" +#if UNIV_FORMAT_B != UNIV_FORMAT_MAX +# error "UNIV_FORMAT_B != UNIV_FORMAT_MAX" #endif } } @@ -7028,7 +7028,7 @@ get_row_format_name( /** If file-format is Antelope, issue warning and set ret false */ #define CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE \ - if (srv_file_format < DICT_TF_FORMAT_ZIP) { \ + if (srv_file_format < UNIV_FORMAT_B) { \ push_warning_printf( \ thd, MYSQL_ERROR::WARN_LEVEL_WARN, \ ER_ILLEGAL_HA_CREATE_OPTION, \ @@ -7086,7 +7086,7 @@ create_options_are_valid( " innodb_file_per_table."); ret = FALSE; } - if (srv_file_format < DICT_TF_FORMAT_ZIP) { + if (srv_file_format < UNIV_FORMAT_B) { push_warning( thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, @@ -7275,7 +7275,7 @@ ha_innobase::create( if (key_block_size == ksize) { flags = ssize << DICT_TF_ZSSIZE_SHIFT | DICT_TF_COMPACT - | DICT_TF_FORMAT_ZIP + | UNIV_FORMAT_B << DICT_TF_FORMAT_SHIFT; break; } @@ -7290,7 +7290,7 @@ ha_innobase::create( flags = 0; } - if (file_format < DICT_TF_FORMAT_ZIP) { + if (file_format < UNIV_FORMAT_B) { push_warning( thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, @@ -7339,7 +7339,7 @@ ha_innobase::create( flags = (DICT_TF_ZSSIZE_MAX - 1) << DICT_TF_ZSSIZE_SHIFT | DICT_TF_COMPACT - | DICT_TF_FORMAT_ZIP + | UNIV_FORMAT_B << DICT_TF_FORMAT_SHIFT; #if DICT_TF_ZSSIZE_MAX < 1 # error "DICT_TF_ZSSIZE_MAX < 1" @@ -7359,7 +7359,7 @@ ha_innobase::create( "InnoDB: ROW_FORMAT=%s requires" " innodb_file_per_table.", get_row_format_name(row_format)); - } else if (file_format < DICT_TF_FORMAT_ZIP) { + } else if (file_format < UNIV_FORMAT_B) { push_warning_printf( thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_ILLEGAL_HA_CREATE_OPTION, @@ -7368,7 +7368,7 @@ ha_innobase::create( get_row_format_name(row_format)); } else { flags |= DICT_TF_COMPACT - | (DICT_TF_FORMAT_ZIP + | (UNIV_FORMAT_B << DICT_TF_FORMAT_SHIFT); break; } @@ -11076,13 +11076,13 @@ innobase_file_format_name_lookup( /* Check for valid parse. */ if (*endp == '\0' && *format_name != '\0') { - if (format_id <= DICT_TF_FORMAT_MAX) { + if (format_id <= UNIV_FORMAT_MAX) { return(format_id); } } else { - for (format_id = 0; format_id <= DICT_TF_FORMAT_MAX; + for (format_id = 0; format_id <= UNIV_FORMAT_MAX; format_id++) { const char* name; @@ -11095,7 +11095,7 @@ innobase_file_format_name_lookup( } } - return(DICT_TF_FORMAT_MAX + 1); + return(UNIV_FORMAT_MAX + 1); } /************************************************************//** @@ -11112,7 +11112,7 @@ innobase_file_format_validate_and_set( format_id = innobase_file_format_name_lookup(format_max); - if (format_id < DICT_TF_FORMAT_MAX + 1) { + if (format_id < UNIV_FORMAT_MAX + 1) { srv_max_file_format_at_startup = format_id; return((int) format_id); @@ -11151,7 +11151,7 @@ innodb_file_format_name_validate( format_id = innobase_file_format_name_lookup( file_format_input); - if (format_id <= DICT_TF_FORMAT_MAX) { + if (format_id <= UNIV_FORMAT_MAX) { /* Save a pointer to the name in the 'file_format_name_map' constant array. */ @@ -11193,7 +11193,7 @@ innodb_file_format_name_update( format_id = innobase_file_format_name_lookup(format_name); - if (format_id <= DICT_TF_FORMAT_MAX) { + if (format_id <= UNIV_FORMAT_MAX) { srv_file_format = format_id; } } @@ -11248,8 +11248,8 @@ innodb_file_format_max_validate( "InnoDB: invalid innodb_file_format_max " "value; can be any format up to %s " "or equivalent id of %d", - trx_sys_file_format_id_to_name(DICT_TF_FORMAT_MAX), - DICT_TF_FORMAT_MAX); + trx_sys_file_format_id_to_name(UNIV_FORMAT_MAX), + UNIV_FORMAT_MAX); } } @@ -11288,7 +11288,7 @@ innodb_file_format_max_update( format_id = innobase_file_format_name_lookup(format_name_in); - if (format_id > DICT_TF_FORMAT_MAX) { + if (format_id > UNIV_FORMAT_MAX) { /* DEFAULT is "on", which is invalid at runtime. */ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_WRONG_ARGUMENTS, === modified file 'storage/innobase/handler/i_s.cc' --- a/storage/innobase/handler/i_s.cc revid:marko.makela@stripped +++ b/storage/innobase/handler/i_s.cc revid:kevin.lewis@stripped @@ -39,7 +39,7 @@ extern "C" { #include "btr0pcur.h" /* for file sys_tables related info. */ #include "btr0types.h" #include "buf0buddy.h" /* for i_s_cmpmem */ -#include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */ +#include "buf0buf.h" /* for buf_pool */ #include "dict0load.h" /* for file sys_tables related info. */ #include "dict0mem.h" #include "dict0types.h" @@ -1371,7 +1371,7 @@ i_s_cmp_fill_low( for (uint i = 0; i < PAGE_ZIP_NUM_SSIZE - 1; i++) { page_zip_stat_t* zip_stat = &page_zip_stat[i]; - table->field[0]->store(PAGE_ZIP_MIN_SIZE << i); + table->field[0]->store(UNIV_ZIP_SIZE_MIN << i); /* The cumulated counts are not protected by any mutex. Thus, some operation in page0zip.c could @@ -3190,8 +3190,9 @@ i_s_innodb_buffer_page_fill( page_info->data_size)); OK(fields[IDX_BUFFER_PAGE_ZIP_SIZE]->store( - page_info->zip_ssize ? - 512 << page_info->zip_ssize : 0)); + page_info->zip_ssize + ? (UNIV_ZIP_SIZE_MIN >> 1) << page_info->zip_ssize + : 0)); #if BUF_PAGE_STATE_BITS > 3 # error "BUF_PAGE_STATE_BITS > 3, please ensure that all 1< PAGE_ZIP_MIN_SIZE -# error "BUF_BUDDY_LOW > PAGE_ZIP_MIN_SIZE" +#if BUF_BUDDY_LOW > UNIV_ZIP_SIZE_MIN +# error "BUF_BUDDY_LOW > UNIV_ZIP_SIZE_MIN" #endif /* @} */ }; === modified file 'storage/innobase/include/buf0buf.ic' --- a/storage/innobase/include/buf0buf.ic revid:marko.makela@stripped +++ b/storage/innobase/include/buf0buf.ic revid:kevin.lewis@stripped @@ -690,7 +690,8 @@ buf_page_get_zip_size( /*==================*/ const buf_page_t* bpage) /*!< in: pointer to the control block */ { - return(bpage->zip.ssize ? 512 << bpage->zip.ssize : 0); + return(bpage->zip.ssize + ? (UNIV_ZIP_SIZE_MIN >> 1) << bpage->zip.ssize : 0); } /*********************************************************************//** @@ -702,7 +703,8 @@ buf_block_get_zip_size( /*===================*/ const buf_block_t* block) /*!< in: pointer to the control block */ { - return(block->page.zip.ssize ? 512 << block->page.zip.ssize : 0); + return(block->page.zip.ssize + ? (UNIV_ZIP_SIZE_MIN >> 1) << block->page.zip.ssize : 0); } #ifndef UNIV_HOTBACKUP === modified file 'storage/innobase/include/dict0dict.ic' --- a/storage/innobase/include/dict0dict.ic revid:marko.makela@stripped +++ b/storage/innobase/include/dict0dict.ic revid:kevin.lewis@stripped @@ -467,10 +467,10 @@ dict_table_flags_to_zip_size( ulint zip_size = flags & DICT_TF_ZSSIZE_MASK; if (UNIV_UNLIKELY(zip_size)) { - zip_size = ((PAGE_ZIP_MIN_SIZE >> 1) + zip_size = ((UNIV_ZIP_SIZE_MIN >> 1) << (zip_size >> DICT_TF_ZSSIZE_SHIFT)); - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); } return(zip_size); === modified file 'storage/innobase/include/dict0mem.h' --- a/storage/innobase/include/dict0mem.h revid:marko.makela@stripped +++ b/storage/innobase/include/dict0mem.h revid:kevin.lewis@stripped @@ -64,17 +64,17 @@ combination of types */ /** Table flags. All unused bits must be 0. */ /* @{ */ -#define DICT_TF_COMPACT 1 /* Compact page format. - This must be set for - new file formats - (later than - DICT_TF_FORMAT_51). */ +/** Compact page format. +This flag is set for all row formats later than Redundant. It identifies +the Compact row format. It is also used for the later formats, Compressed +and Dynamic, because they add features to the Compact structure. */ +#define DICT_TF_COMPACT 1 /** Compressed page size (0=uncompressed, up to 15 compressed sizes) */ /* @{ */ #define DICT_TF_ZSSIZE_SHIFT 1 #define DICT_TF_ZSSIZE_MASK (15 << DICT_TF_ZSSIZE_SHIFT) -#define DICT_TF_ZSSIZE_MAX (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 1) +#define DICT_TF_ZSSIZE_MAX (UNIV_PAGE_SIZE_SHIFT - UNIV_ZIP_SIZE_SHIFT_MIN + 1) /* @} */ /** File format */ @@ -82,22 +82,12 @@ combination of types */ #define DICT_TF_FORMAT_SHIFT 5 /* file format */ #define DICT_TF_FORMAT_MASK \ ((~(~0 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT))) << DICT_TF_FORMAT_SHIFT) -#define DICT_TF_FORMAT_51 0 /*!< InnoDB/MySQL up to 5.1 */ #define DICT_N_COLS_COMPACT 0x80000000UL /*!< Set if ROW_FORMAT!=REDUNDANT */ -#define DICT_TF_FORMAT_ZIP 1 /*!< InnoDB plugin for 5.1: - compressed tables, - new BLOB treatment */ -/** Maximum supported file format */ -#define DICT_TF_FORMAT_MAX DICT_TF_FORMAT_ZIP - -/** Minimum supported file format */ -#define DICT_TF_FORMAT_MIN DICT_TF_FORMAT_51 - /* @} */ #define DICT_TF_BITS 6 /*!< number of flag bits */ -#if (1 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT)) <= DICT_TF_FORMAT_MAX -# error "DICT_TF_BITS is insufficient for DICT_TF_FORMAT_MAX" +#if (1 << (DICT_TF_BITS - DICT_TF_FORMAT_SHIFT)) <= UNIV_FORMAT_MAX +# error "DICT_TF_BITS is insufficient for UNIV_FORMAT_MAX" #endif /** Valid table flag bits */ #define DICT_TF_BIT_MASK (~(~0 << DICT_TF_BITS)) === modified file 'storage/innobase/include/ibuf0ibuf.ic' --- a/storage/innobase/include/ibuf0ibuf.ic revid:marko.makela@stripped +++ b/storage/innobase/include/ibuf0ibuf.ic revid:kevin.lewis@stripped @@ -158,7 +158,7 @@ ibuf_index_page_calc_free_bits( ulint n; ut_ad(ut_is_2pow(zip_size)); ut_ad(!zip_size || zip_size > IBUF_PAGE_SIZE_PER_FREE_SPACE); - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); if (zip_size) { n = max_ins_size @@ -193,7 +193,7 @@ ibuf_index_page_calc_free_from_bits( ut_ad(bits < 4); ut_ad(ut_is_2pow(zip_size)); ut_ad(!zip_size || zip_size > IBUF_PAGE_SIZE_PER_FREE_SPACE); - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); if (zip_size) { if (bits == 3) { === modified file 'storage/innobase/include/page0types.h' --- a/storage/innobase/include/page0types.h revid:marko.makela@stripped +++ b/storage/innobase/include/page0types.h revid:kevin.lewis@stripped @@ -49,13 +49,9 @@ page0*.h includes rem0rec.h and may incl /** Number of bits needed for representing different compressed page sizes */ #define PAGE_ZIP_SSIZE_BITS 3 -/** log2 of smallest compressed page size */ -#define PAGE_ZIP_MIN_SIZE_SHIFT 10 -/** Smallest compressed page size */ -#define PAGE_ZIP_MIN_SIZE (1 << PAGE_ZIP_MIN_SIZE_SHIFT) - /** Number of supported compressed page sizes */ -#define PAGE_ZIP_NUM_SSIZE (UNIV_PAGE_SIZE_SHIFT - PAGE_ZIP_MIN_SIZE_SHIFT + 2) +#define PAGE_ZIP_NUM_SSIZE \ + (UNIV_ZIP_SIZE_SHIFT_MAX - UNIV_ZIP_SIZE_SHIFT_MIN + 2) #if PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS) # error "PAGE_ZIP_NUM_SSIZE > (1 << PAGE_ZIP_SSIZE_BITS)" #endif @@ -77,7 +73,7 @@ struct page_zip_des_struct unsigned ssize:PAGE_ZIP_SSIZE_BITS; /*!< 0 or compressed page size; the size in bytes is - PAGE_ZIP_MIN_SIZE << (ssize - 1). */ + UNIV_ZIP_SIZE_MIN << (ssize - 1). */ }; /** Compression statistics for a given page size */ === modified file 'storage/innobase/include/page0zip.ic' --- a/storage/innobase/include/page0zip.ic revid:marko.makela@stripped +++ b/storage/innobase/include/page0zip.ic revid:kevin.lewis@stripped @@ -124,9 +124,9 @@ page_zip_get_size( return(0); } - size = (PAGE_ZIP_MIN_SIZE >> 1) << page_zip->ssize; + size = (UNIV_ZIP_SIZE_MIN >> 1) << page_zip->ssize; - ut_ad(size >= PAGE_ZIP_MIN_SIZE); + ut_ad(size >= UNIV_ZIP_SIZE_MIN); ut_ad(size <= UNIV_PAGE_SIZE); return(size); === modified file 'storage/innobase/include/srv0srv.h' --- a/storage/innobase/include/srv0srv.h revid:marko.makela@stripped +++ b/storage/innobase/include/srv0srv.h revid:kevin.lewis@stripped @@ -109,7 +109,7 @@ extern ibool srv_file_per_table; /** The file format to use on new *.ibd files. */ extern ulint srv_file_format; /** Whether to check file format during startup. A value of -DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to +UNIV_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support. */ extern ulint srv_max_file_format_at_startup; /** Place locks to records only i.e. do not use next-key locking except === modified file 'storage/innobase/include/univ.i' --- a/storage/innobase/include/univ.i revid:marko.makela@stripped +++ b/storage/innobase/include/univ.i revid:kevin.lewis@stripped @@ -308,25 +308,58 @@ management to ensure correct alignment f ======================== */ -/* The 2-logarithm of UNIV_PAGE_SIZE: */ +/** Antelope File Format: InnoDB/MySQL up to 5.1. +This format includes REDUNDANT and COMPACT row formats */ +#define UNIV_FORMAT_A 0 + +/** Barracuda File Format: Introduced in InnoDB plugin for 5.1: +This format includes COMPRESSED and DYNAMIC row formats, +including new BLOB treatment */ +#define UNIV_FORMAT_B 1 + +/** Minimum supported file format */ +#define UNIV_FORMAT_MIN UNIV_FORMAT_A + +/** Maximum supported file format */ +#define UNIV_FORMAT_MAX UNIV_FORMAT_B + +/** The 2-logarithm of UNIV_PAGE_SIZE: */ #define UNIV_PAGE_SIZE_SHIFT 14 -/* The universal page size of the database */ + +/** The universal page size of the database */ #define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT) -/* Maximum number of parallel threads in a parallelized operation */ +/** log2 of smallest compressed page size (1<<10 == 1024 bytes) */ +#define UNIV_ZIP_SIZE_SHIFT_MIN 10 + +/** log2 of largest compressed page size (1<<14 == 16384 bytes). +A compressed page directory entry reserves 14 bits for the start offset +and 2 bits for flags. This limits the uncompressed page size to 16k. +So even though a 16k uncompressed page can theoretically be compressed +into a larger compressed page, it is not a useful feature so we will +limit both with this same constant. */ +#define UNIV_ZIP_SIZE_SHIFT_MAX 14 + +/** Smallest compressed page size */ +#define UNIV_ZIP_SIZE_MIN (1 << UNIV_ZIP_SIZE_SHIFT_MIN) + +/** Largest compressed page size */ +#define UNIV_ZIP_SIZE_MAX (1 << UNIV_ZIP_SIZE_SHIFT_MAX) + +/** Maximum number of parallel threads in a parallelized operation */ #define UNIV_MAX_PARALLELISM 32 -/* The maximum length of a table name. This is the MySQL limit and is +/** The maximum length of a table name. This is the MySQL limit and is defined in mysql_com.h like NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN, the number does not include a terminating '\0'. InnoDB probably can handle longer names internally */ #define MAX_TABLE_NAME_LEN 192 -/* The maximum length of a database name. Like MAX_TABLE_NAME_LEN this is +/** The maximum length of a database name. Like MAX_TABLE_NAME_LEN this is the MySQL's NAME_LEN, see check_and_convert_db_name(). */ #define MAX_DATABASE_NAME_LEN MAX_TABLE_NAME_LEN -/* MAX_FULL_NAME_LEN defines the full name path including the +/** MAX_FULL_NAME_LEN defines the full name path including the database name and table name. In addition, 14 bytes is added for: 2 for surrounding quotes around table name 1 for the separating dot (.) @@ -371,7 +404,7 @@ typedef long int lint; typedef __int64 ib_int64_t; typedef unsigned __int64 ib_uint64_t; #elif !defined(UNIV_HOTBACKUP) -/* Note: longlong and ulonglong come from MySQL headers. */ +/** Note: longlong and ulonglong come from MySQL headers. */ typedef longlong ib_int64_t; typedef ulonglong ib_uint64_t; #endif @@ -386,31 +419,31 @@ typedef unsigned long long int ullint; #endif #endif -/* The 'undefined' value for a ulint */ +/** The 'undefined' value for a ulint */ #define ULINT_UNDEFINED ((ulint)(-1)) -/* The 'undefined' value for a ib_uint64_t */ +/** The 'undefined' value for a ib_uint64_t */ #define UINT64_UNDEFINED ((ib_uint64_t)(-1)) /** The bitmask of 32-bit unsigned integer */ #define ULINT32_MASK 0xFFFFFFFF -/* The undefined 32-bit unsigned integer */ +/** The undefined 32-bit unsigned integer */ #define ULINT32_UNDEFINED ULINT32_MASK -/* Maximum value for a ulint */ +/** Maximum value for a ulint */ #define ULINT_MAX ((ulint)(-2)) -/* Maximum value for ib_uint64_t */ +/** Maximum value for ib_uint64_t */ #define IB_ULONGLONG_MAX ((ib_uint64_t) (~0ULL)) #define IB_UINT64_MAX IB_ULONGLONG_MAX /** The generic InnoDB system object identifier data type */ typedef ib_uint64_t ib_id_t; -/* The 'undefined' value for a ullint */ +/** The 'undefined' value for a ullint */ #define ULLINT_UNDEFINED ((ullint)(-1)) -/* This 'ibool' type is used within Innobase. Remember that different included +/** This 'ibool' type is used within Innobase. Remember that different included headers may define 'bool' differently. Do not assume that 'bool' is a ulint! */ #define ibool ulint @@ -421,7 +454,7 @@ headers may define 'bool' differently. D #endif -/* The following number as the length of a logical field means that the field +/** The following number as the length of a logical field means that the field has the SQL NULL as its value. NOTE that because we assume that the length of a field is a 32-bit integer when we store it, for example, to an undo log on disk, we must have also this number fit in 32 bits, also in 64-bit @@ -429,7 +462,7 @@ computers! */ #define UNIV_SQL_NULL ULINT32_UNDEFINED -/* Lengths which are not UNIV_SQL_NULL, but bigger than the following +/** Lengths which are not UNIV_SQL_NULL, but bigger than the following number indicate that a field contains a reference to an externally stored part of the field in the tablespace. The length field then contains the sum of the following flag and the locally stored len. */ === modified file 'storage/innobase/row/row0ext.c' --- a/storage/innobase/row/row0ext.c revid:marko.makela@stripped +++ b/storage/innobase/row/row0ext.c revid:kevin.lewis@stripped @@ -93,7 +93,7 @@ row_ext_create( + (n_ext - 1) * sizeof ret->len); ut_ad(ut_is_2pow(zip_size)); - ut_ad(zip_size <= UNIV_PAGE_SIZE); + ut_ad(zip_size <= UNIV_ZIP_SIZE_MAX); ret->n_ext = n_ext; ret->ext = ext; === modified file 'storage/innobase/row/row0row.c' --- a/storage/innobase/row/row0row.c revid:marko.makela@stripped +++ b/storage/innobase/row/row0row.c revid:kevin.lewis@stripped @@ -298,8 +298,7 @@ row_build( /* REDUNDANT and COMPACT formats store a local 768-byte prefix of each externally stored column. No cache is needed. */ - ut_ad(dict_table_get_format(index->table) - < DICT_TF_FORMAT_ZIP); + ut_ad(dict_table_get_format(index->table) < UNIV_FORMAT_B); } else if (j) { *ext = row_ext_create(j, ext_cols, row, dict_table_zip_size(index->table), === modified file 'storage/innobase/row/row0umod.c' --- a/storage/innobase/row/row0umod.c revid:marko.makela@stripped +++ b/storage/innobase/row/row0umod.c revid:kevin.lewis@stripped @@ -698,7 +698,7 @@ row_undo_mod_upd_exist_sec( store a local 768-byte prefix of each externally stored column. */ ut_a(dict_table_get_format(index->table) - >= DICT_TF_FORMAT_ZIP); + >= UNIV_FORMAT_B); /* This is only legitimate when rolling back an incomplete transaction === modified file 'storage/innobase/row/row0undo.c' --- a/storage/innobase/row/row0undo.c revid:marko.makela@stripped +++ b/storage/innobase/row/row0undo.c revid:kevin.lewis@stripped @@ -200,7 +200,7 @@ row_undo_search_clust_to_pcur( } else { row_ext_t** ext; - if (dict_table_get_format(node->table) >= DICT_TF_FORMAT_ZIP) { + if (dict_table_get_format(node->table) >= UNIV_FORMAT_B) { /* In DYNAMIC or COMPRESSED format, there is no prefix of externally stored columns in the clustered index record. Build a cache of === modified file 'storage/innobase/row/row0upd.c' --- a/storage/innobase/row/row0upd.c revid:marko.makela@stripped +++ b/storage/innobase/row/row0upd.c revid:kevin.lewis@stripped @@ -1507,7 +1507,7 @@ row_upd_store_row( offsets = rec_get_offsets(rec, clust_index, offsets_, ULINT_UNDEFINED, &heap); - if (dict_table_get_format(node->table) >= DICT_TF_FORMAT_ZIP) { + if (dict_table_get_format(node->table) >= UNIV_FORMAT_B) { /* In DYNAMIC or COMPRESSED format, there is no prefix of externally stored columns in the clustered index record. Build a cache of column prefixes. */ === modified file 'storage/innobase/srv/srv0srv.c' --- a/storage/innobase/srv/srv0srv.c revid:marko.makela@stripped +++ b/storage/innobase/srv/srv0srv.c revid:kevin.lewis@stripped @@ -106,12 +106,12 @@ UNIV_INTERN my_bool srv_file_per_table; /** The file format to use on new *.ibd files. */ UNIV_INTERN ulint srv_file_format = 0; /** Whether to check file format during startup. A value of -DICT_TF_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to +UNIV_FORMAT_MAX + 1 means no checking ie. FALSE. The default is to set it to the highest format we support. */ -UNIV_INTERN ulint srv_max_file_format_at_startup = DICT_TF_FORMAT_MAX; +UNIV_INTERN ulint srv_max_file_format_at_startup = UNIV_FORMAT_MAX; -#if DICT_TF_FORMAT_51 -# error "DICT_TF_FORMAT_51 must be 0!" +#if UNIV_FORMAT_A +# error "UNIV_FORMAT_A must be 0!" #endif /** Place locks to records only i.e. do not use next-key locking except on duplicate key checking and foreign key checking */ === modified file 'storage/innobase/trx/trx0rec.c' --- a/storage/innobase/trx/trx0rec.c revid:marko.makela@stripped +++ b/storage/innobase/trx/trx0rec.c revid:kevin.lewis@stripped @@ -353,7 +353,7 @@ trx_undo_rec_get_col_val( /* @see dtuple_convert_big_rec() */ ut_ad(*len >= BTR_EXTERN_FIELD_REF_SIZE * 2); /* we do not have access to index->table here - ut_ad(dict_table_get_format(index->table) >= DICT_TF_FORMAT_ZIP + ut_ad(dict_table_get_format(index->table) >= UNIV_FORMAT_B || *len >= REC_MAX_INDEX_COL_LEN + BTR_EXTERN_FIELD_REF_SIZE); */ @@ -1084,7 +1084,7 @@ trx_undo_rec_get_partial_row( ut_a(dfield_get_len(dfield) >= 2 * BTR_EXTERN_FIELD_REF_SIZE); ut_a(dict_table_get_format(index->table) - >= DICT_TF_FORMAT_ZIP + >= UNIV_FORMAT_B || dfield_get_len(dfield) >= REC_MAX_INDEX_COL_LEN + BTR_EXTERN_FIELD_REF_SIZE); === modified file 'storage/innobase/trx/trx0sys.c' --- a/storage/innobase/trx/trx0sys.c revid:marko.makela@stripped +++ b/storage/innobase/trx/trx0sys.c revid:kevin.lewis@stripped @@ -1189,7 +1189,7 @@ trx_sys_file_format_id_to_name( /*****************************************************************//** Check for the max file format tag stored on disk. Note: If max_format_id -is == DICT_TF_FORMAT_MAX + 1 then we only print a warning. +is == UNIV_FORMAT_MAX + 1 then we only print a warning. @return DB_SUCCESS or error code */ UNIV_INTERN ulint @@ -1206,15 +1206,15 @@ trx_sys_file_format_max_check( if (format_id == ULINT_UNDEFINED) { /* Format ID was not set. Set it to minimum possible value. */ - format_id = DICT_TF_FORMAT_MIN; + format_id = UNIV_FORMAT_MIN; } ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: highest supported file format is %s.\n", - trx_sys_file_format_id_to_name(DICT_TF_FORMAT_MAX)); + trx_sys_file_format_id_to_name(UNIV_FORMAT_MAX)); - if (format_id > DICT_TF_FORMAT_MAX) { + if (format_id > UNIV_FORMAT_MAX) { ut_a(format_id < FILE_FORMAT_NAME_N); @@ -1222,11 +1222,11 @@ trx_sys_file_format_max_check( fprintf(stderr, " InnoDB: %s: the system tablespace is in a file " "format that this version doesn't support - %s\n", - ((max_format_id <= DICT_TF_FORMAT_MAX) + ((max_format_id <= UNIV_FORMAT_MAX) ? "Error" : "Warning"), trx_sys_file_format_id_to_name(format_id)); - if (max_format_id <= DICT_TF_FORMAT_MAX) { + if (max_format_id <= UNIV_FORMAT_MAX) { return(DB_ERROR); } } @@ -1255,7 +1255,7 @@ trx_sys_file_format_max_set( { ibool ret = FALSE; - ut_a(format_id <= DICT_TF_FORMAT_MAX); + ut_a(format_id <= UNIV_FORMAT_MAX); mutex_enter(&file_format_max.mutex); @@ -1286,7 +1286,7 @@ trx_sys_file_format_tag_init(void) /* If format_id is not set then set it to the minimum. */ if (format_id == ULINT_UNDEFINED) { - trx_sys_file_format_max_set(DICT_TF_FORMAT_MIN, NULL); + trx_sys_file_format_max_set(UNIV_FORMAT_MIN, NULL); } } @@ -1305,7 +1305,7 @@ trx_sys_file_format_max_upgrade( ut_a(name); ut_a(file_format_max.name != NULL); - ut_a(format_id <= DICT_TF_FORMAT_MAX); + ut_a(format_id <= UNIV_FORMAT_MAX); mutex_enter(&file_format_max.mutex); @@ -1342,7 +1342,7 @@ trx_sys_file_format_init(void) /* We don't need a mutex here, as this function should only be called once at start up. */ - file_format_max.id = DICT_TF_FORMAT_MIN; + file_format_max.id = UNIV_FORMAT_MIN; file_format_max.name = trx_sys_file_format_id_to_name( file_format_max.id); No bundle (reason: useless for push emails).