mariadb/storage/innobase/buf/buf0flu.c
unknown bf2f50d345 Applied innodb-5.1 snapshots ss799 and ss854
Bugs fixed:
- Bug #20877: InnoDB data dictionary memory footprint is too big
- Bug #13544: Second delete of same row in transaction illustrates non-optimal locking
- Bug #20791: valgrind errors in InnoDB


storage/innobase/btr/btr0btr.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r823:
  Minor cleanup related to Bug #20877.
  
  btr_print_recursive(): Replace tree->tree_indexes with tree->index.
  This should have been done in r453.
  
  univ.i: Add UNIV_BTR_PRINT.
  
  rw_lock_t: Reduce writer_is_wait_ex to a bit and move it close to
  other bitfields.  Change the types to unsigned, in case ulint or ibool
  bitfields will not work.
  
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/btr/btr0cur.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r830:
  page_align(ptr): New utility function to replace
  ut_align_down(ptr, UNIV_PAGE_SIZE) calls.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/btr/btr0pcur.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r830:
  page_align(ptr): New utility function to replace
  ut_align_down(ptr, UNIV_PAGE_SIZE) calls.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/btr/btr0sea.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r824:
  Reduce the size of btr_search_t from 13 machine words to 7.  This
  structure is reserved for every index in the data dictionary cache.
  (Bug #20877)
  
  We could shrink the structure further to three 32-bit words or two
  64-bit words by turning the remaining fields to bit-fields.
  Unfortunately, the fields are not protected by any mutex, and thus we
  would better keep each field aligned to a machine word.
  
  btr_search_t, buf_block_t: Rename "ulint side" to "ibool left_side".
  Remove BTR_SEARCH_LEFT_SIDE and BTR_SEARCH_RIGHT_SIDE, and also rename
  some local variables and function parameters from "ulint side" to
  "ibool left_side".
  
  btr_search_t: Remove the unused fields last_search, n_direction, direction,
  and modify_clock.  Remove the unused constants BTR_SEA_NO_DIRECTION,
  BTR_SEA_LEFT, BTR_SEA_RIGHT, and BTR_SEA_SAME_REC.
  
  btr_search_t: Remove magic_n unless #defined UNIV_DEBUG.  Turn an assertion
  about the magic number into a debug assertion.
  
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/buf/buf0buf.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r824:
  Reduce the size of btr_search_t from 13 machine words to 7.  This
  structure is reserved for every index in the data dictionary cache.
  (Bug #20877)
  
  We could shrink the structure further to three 32-bit words or two
  64-bit words by turning the remaining fields to bit-fields.
  Unfortunately, the fields are not protected by any mutex, and thus we
  would better keep each field aligned to a machine word.
  
  btr_search_t, buf_block_t: Rename "ulint side" to "ibool left_side".
  Remove BTR_SEARCH_LEFT_SIDE and BTR_SEARCH_RIGHT_SIDE, and also rename
  some local variables and function parameters from "ulint side" to
  "ibool left_side".
  
  btr_search_t: Remove the unused fields last_search, n_direction, direction,
  and modify_clock.  Remove the unused constants BTR_SEA_NO_DIRECTION,
  BTR_SEA_LEFT, BTR_SEA_RIGHT, and BTR_SEA_SAME_REC.
  
  btr_search_t: Remove magic_n unless #defined UNIV_DEBUG.  Turn an assertion
  about the magic number into a debug assertion.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/buf/buf0flu.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/buf/buf0lru.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/buf/buf0rea.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/data/data0data.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/data/data0type.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
storage/innobase/dict/dict0boot.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r827:
  Make dict_index_find_cols() always succeed.
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/dict/dict0crea.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r827:
  Make dict_index_find_cols() always succeed.
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r833:
  Tweak the bit-field definitions introduced since r813 to address Bug #20877.
  
  rw_lock_t: Do not make writer_is_wait_ex a bit-field.  There are no fields
  yet that could be fused to the same machine word, but we play it safe,
  because the field writer_is_wait_ex may be modified by several threads
  simultaneously.  Such fields should always be allocated an own machine
  word.
  
  dict_table_t: Change the type of all bit-fields to "unsigned".  Make
  "space" a bit-field of 32 bits.  Move name_hash and id_hash after all
  bit-fields, so that the bit-fields can be allocated together.  Do not
  make autoinc_inited a bit-field, as we cannot allocate any field
  from the same machine word.
  
  dict_build_table_def_step(): Pass a local variable to
  fil_create_new_single_table_tablespace() and initialize table->space
  from it after the call, now that table->space is a bit-field.
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/dict/dict0dict.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r818:
  Remove dict_col_t::hash, dict_col_t::table,
  dict_sys->col_hash, and DICT_POOL_PER_COL_HASH.  (Bug #20877)
  
  The col->table pointer was only needed for maintaining a hash table of
  all defined columns in all tables.  The hash table was only looked up
  in dict_index_find_cols().  Removing the col->hash and col->table
  pointers reduces the size of a table column by two machine words
  (usually 8 or 16 bytes).
  
  dict_col_add_to_cache(), dict_col_reposition_in_cache(),
  dict_col_remove_from_cache(): Remove.  These only updated dict_sys->col_hash.
  
  dict_index_find_cols(): Use a linear search instead of the hash table.
  The time complexity is affected, but this function is only invoked by
  dict_index_add_to_cache(), and we only search the columns of a single
  table (typically at most a few dozen) as opposed to all columns of all
  tables.
  
  
  Revision r819:
  dict_col_t: Reduce ord_part to one bit.
  
  dict_index_add_to_cache(): Instead of incrementing ord_part, set it.
  
  dict_index_remove_from_cache(): Do not touch ord_part.
  
  dtype_t: Reduce mbminlen from 3 to 2 bits.
  
  row_upd(): Add a UNIV_LIKELY hint around node->in_mysql_interface.
  
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r821:
  dict_table_t: Rename the integer field max_row_size
  to the Boolean field big_rows.  (Bug #20877)
  
  BIG_ROW_SIZE: Move the definition from row0sel.c to dict_table_add_to_cache().
  
  
  Revision r826:
  The code base was reindented in r763 and automatic .emacs indentation
  settings introduced. Some problems were found, so from this commit on one
  additional indentation rule is introduced:
  
   (add-to-list 'c-offsets-alist '(arglist-intro . +))
  
  Note that fixing some of the unfortunate line-splits done in r764 will be
  done in a future change.
  
  Revision r827:
  Make dict_index_find_cols() always succeed.
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r831:
  Add dict_col_get_clust_pos_noninline(), which was forgotten from r820.
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r836:
  Remove dict_col_t::name, replace it with a packed array of column names in
  dict_table_t. This saves 8-15+ bytes of memory per column on 64-bit
  machines.
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
  
  Revision r845:
  Split long lines with [] operators better.
storage/innobase/dict/dict0load.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/dict/dict0mem.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r818:
  Remove dict_col_t::hash, dict_col_t::table,
  dict_sys->col_hash, and DICT_POOL_PER_COL_HASH.  (Bug #20877)
  
  The col->table pointer was only needed for maintaining a hash table of
  all defined columns in all tables.  The hash table was only looked up
  in dict_index_find_cols().  Removing the col->hash and col->table
  pointers reduces the size of a table column by two machine words
  (usually 8 or 16 bytes).
  
  dict_col_add_to_cache(), dict_col_reposition_in_cache(),
  dict_col_remove_from_cache(): Remove.  These only updated dict_sys->col_hash.
  
  dict_index_find_cols(): Use a linear search instead of the hash table.
  The time complexity is affected, but this function is only invoked by
  dict_index_add_to_cache(), and we only search the columns of a single
  table (typically at most a few dozen) as opposed to all columns of all
  tables.
  
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r821:
  dict_table_t: Rename the integer field max_row_size
  to the Boolean field big_rows.  (Bug #20877)
  
  BIG_ROW_SIZE: Move the definition from row0sel.c to dict_table_add_to_cache().
  
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r836:
  Remove dict_col_t::name, replace it with a packed array of column names in
  dict_table_t. This saves 8-15+ bytes of memory per column on 64-bit
  machines.
storage/innobase/eval/eval0eval.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r826:
  The code base was reindented in r763 and automatic .emacs indentation
  settings introduced. Some problems were found, so from this commit on one
  additional indentation rule is introduced:
  
   (add-to-list 'c-offsets-alist '(arglist-intro . +))
  
  Note that fixing some of the unfortunate line-splits done in r764 will be
  done in a future change.
storage/innobase/eval/eval0proc.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/fil/fil0fil.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/fsp/fsp0fsp.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
  
  Revision r845:
  Split long lines with [] operators better.
storage/innobase/handler/ha_innodb.cc:
  Applied innodb-5.1 snapshots ss799 and ss854
storage/innobase/handler/ha_innodb.h:
  Applied innodb-5.1 snapshots ss799 and ss854
storage/innobase/ibuf/ibuf0ibuf.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/include/btr0btr.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
storage/innobase/include/btr0btr.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
storage/innobase/include/btr0cur.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
storage/innobase/include/btr0cur.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
storage/innobase/include/btr0pcur.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r817:
  btr0pcur.h: Change FIXME to TODO.
storage/innobase/include/btr0sea.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r824:
  Reduce the size of btr_search_t from 13 machine words to 7.  This
  structure is reserved for every index in the data dictionary cache.
  (Bug #20877)
  
  We could shrink the structure further to three 32-bit words or two
  64-bit words by turning the remaining fields to bit-fields.
  Unfortunately, the fields are not protected by any mutex, and thus we
  would better keep each field aligned to a machine word.
  
  btr_search_t, buf_block_t: Rename "ulint side" to "ibool left_side".
  Remove BTR_SEARCH_LEFT_SIDE and BTR_SEARCH_RIGHT_SIDE, and also rename
  some local variables and function parameters from "ulint side" to
  "ibool left_side".
  
  btr_search_t: Remove the unused fields last_search, n_direction, direction,
  and modify_clock.  Remove the unused constants BTR_SEA_NO_DIRECTION,
  BTR_SEA_LEFT, BTR_SEA_RIGHT, and BTR_SEA_SAME_REC.
  
  btr_search_t: Remove magic_n unless #defined UNIV_DEBUG.  Turn an assertion
  about the magic number into a debug assertion.
storage/innobase/include/buf0buf.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r824:
  Reduce the size of btr_search_t from 13 machine words to 7.  This
  structure is reserved for every index in the data dictionary cache.
  (Bug #20877)
  
  We could shrink the structure further to three 32-bit words or two
  64-bit words by turning the remaining fields to bit-fields.
  Unfortunately, the fields are not protected by any mutex, and thus we
  would better keep each field aligned to a machine word.
  
  btr_search_t, buf_block_t: Rename "ulint side" to "ibool left_side".
  Remove BTR_SEARCH_LEFT_SIDE and BTR_SEARCH_RIGHT_SIDE, and also rename
  some local variables and function parameters from "ulint side" to
  "ibool left_side".
  
  btr_search_t: Remove the unused fields last_search, n_direction, direction,
  and modify_clock.  Remove the unused constants BTR_SEA_NO_DIRECTION,
  BTR_SEA_LEFT, BTR_SEA_RIGHT, and BTR_SEA_SAME_REC.
  
  btr_search_t: Remove magic_n unless #defined UNIV_DEBUG.  Turn an assertion
  about the magic number into a debug assertion.
storage/innobase/include/data0data.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
storage/innobase/include/data0type.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r819:
  dict_col_t: Reduce ord_part to one bit.
  
  dict_index_add_to_cache(): Instead of incrementing ord_part, set it.
  
  dict_index_remove_from_cache(): Do not touch ord_part.
  
  dtype_t: Reduce mbminlen from 3 to 2 bits.
  
  row_upd(): Add a UNIV_LIKELY hint around node->in_mysql_interface.
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
storage/innobase/include/data0type.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/include/dict0boot.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r816:
  Remove more remnants of mixed indexes.
storage/innobase/include/dict0dict.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r816:
  Remove more remnants of mixed indexes.
  
  Revision r818:
  Remove dict_col_t::hash, dict_col_t::table,
  dict_sys->col_hash, and DICT_POOL_PER_COL_HASH.  (Bug #20877)
  
  The col->table pointer was only needed for maintaining a hash table of
  all defined columns in all tables.  The hash table was only looked up
  in dict_index_find_cols().  Removing the col->hash and col->table
  pointers reduces the size of a table column by two machine words
  (usually 8 or 16 bytes).
  
  dict_col_add_to_cache(), dict_col_reposition_in_cache(),
  dict_col_remove_from_cache(): Remove.  These only updated dict_sys->col_hash.
  
  dict_index_find_cols(): Use a linear search instead of the hash table.
  The time complexity is affected, but this function is only invoked by
  dict_index_add_to_cache(), and we only search the columns of a single
  table (typically at most a few dozen) as opposed to all columns of all
  tables.
  
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r827:
  Make dict_index_find_cols() always succeed.
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r831:
  Add dict_col_get_clust_pos_noninline(), which was forgotten from r820.
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r836:
  Remove dict_col_t::name, replace it with a packed array of column names in
  dict_table_t. This saves 8-15+ bytes of memory per column on 64-bit
  machines.
storage/innobase/include/dict0dict.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
storage/innobase/include/dict0mem.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r815:
  dict_index_t: Remove tree_indexes.  It should have been removed in r453
  when the list in dict_tree_t was replaced with the pointer tree_index.
  
  
  Revision r818:
  Remove dict_col_t::hash, dict_col_t::table,
  dict_sys->col_hash, and DICT_POOL_PER_COL_HASH.  (Bug #20877)
  
  The col->table pointer was only needed for maintaining a hash table of
  all defined columns in all tables.  The hash table was only looked up
  in dict_index_find_cols().  Removing the col->hash and col->table
  pointers reduces the size of a table column by two machine words
  (usually 8 or 16 bytes).
  
  dict_col_add_to_cache(), dict_col_reposition_in_cache(),
  dict_col_remove_from_cache(): Remove.  These only updated dict_sys->col_hash.
  
  dict_index_find_cols(): Use a linear search instead of the hash table.
  The time complexity is affected, but this function is only invoked by
  dict_index_add_to_cache(), and we only search the columns of a single
  table (typically at most a few dozen) as opposed to all columns of all
  tables.
  
  
  Revision r819:
  dict_col_t: Reduce ord_part to one bit.
  
  dict_index_add_to_cache(): Instead of incrementing ord_part, set it.
  
  dict_index_remove_from_cache(): Do not touch ord_part.
  
  dtype_t: Reduce mbminlen from 3 to 2 bits.
  
  row_upd(): Add a UNIV_LIKELY hint around node->in_mysql_interface.
  
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r821:
  dict_table_t: Rename the integer field max_row_size
  to the Boolean field big_rows.  (Bug #20877)
  
  BIG_ROW_SIZE: Move the definition from row0sel.c to dict_table_add_to_cache().
  
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r833:
  Tweak the bit-field definitions introduced since r813 to address Bug #20877.
  
  rw_lock_t: Do not make writer_is_wait_ex a bit-field.  There are no fields
  yet that could be fused to the same machine word, but we play it safe,
  because the field writer_is_wait_ex may be modified by several threads
  simultaneously.  Such fields should always be allocated an own machine
  word.
  
  dict_table_t: Change the type of all bit-fields to "unsigned".  Make
  "space" a bit-field of 32 bits.  Move name_hash and id_hash after all
  bit-fields, so that the bit-fields can be allocated together.  Do not
  make autoinc_inited a bit-field, as we cannot allocate any field
  from the same machine word.
  
  dict_build_table_def_step(): Pass a local variable to
  fil_create_new_single_table_tablespace() and initialize table->space
  from it after the call, now that table->space is a bit-field.
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r835:
  Change the recently introduced ulint bit-fields to unsigned.
  
  
  Revision r836:
  Remove dict_col_t::name, replace it with a packed array of column names in
  dict_table_t. This saves 8-15+ bytes of memory per column on 64-bit
  machines.
storage/innobase/include/dict0types.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
storage/innobase/include/ibuf0ibuf.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/include/page0page.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r830:
  page_align(ptr): New utility function to replace
  ut_align_down(ptr, UNIV_PAGE_SIZE) calls.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
storage/innobase/include/page0page.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r830:
  page_align(ptr): New utility function to replace
  ut_align_down(ptr, UNIV_PAGE_SIZE) calls.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/include/read0read.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/include/rem0cmp.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
storage/innobase/include/rem0cmp.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
storage/innobase/include/rem0rec.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
storage/innobase/include/rem0rec.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/include/rem0types.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
storage/innobase/include/row0upd.ic:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
storage/innobase/include/sync0rw.h:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r823:
  Minor cleanup related to Bug #20877.
  
  btr_print_recursive(): Replace tree->tree_indexes with tree->index.
  This should have been done in r453.
  
  univ.i: Add UNIV_BTR_PRINT.
  
  rw_lock_t: Reduce writer_is_wait_ex to a bit and move it close to
  other bitfields.  Change the types to unsigned, in case ulint or ibool
  bitfields will not work.
  
  
  Revision r833:
  Tweak the bit-field definitions introduced since r813 to address Bug #20877.
  
  rw_lock_t: Do not make writer_is_wait_ex a bit-field.  There are no fields
  yet that could be fused to the same machine word, but we play it safe,
  because the field writer_is_wait_ex may be modified by several threads
  simultaneously.  Such fields should always be allocated an own machine
  word.
  
  dict_table_t: Change the type of all bit-fields to "unsigned".  Make
  "space" a bit-field of 32 bits.  Move name_hash and id_hash after all
  bit-fields, so that the bit-fields can be allocated together.  Do not
  make autoinc_inited a bit-field, as we cannot allocate any field
  from the same machine word.
  
  dict_build_table_def_step(): Pass a local variable to
  fil_create_new_single_table_tablespace() and initialize table->space
  from it after the call, now that table->space is a bit-field.
storage/innobase/include/univ.i:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r823:
  Minor cleanup related to Bug #20877.
  
  btr_print_recursive(): Replace tree->tree_indexes with tree->index.
  This should have been done in r453.
  
  univ.i: Add UNIV_BTR_PRINT.
  
  rw_lock_t: Reduce writer_is_wait_ex to a bit and move it close to
  other bitfields.  Change the types to unsigned, in case ulint or ibool
  bitfields will not work.
storage/innobase/lock/lock0lock.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/log/log0log.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/log/log0recv.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/mem/mem0dbg.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/mem/mem0pool.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/mtr/mtr0log.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/mtr/mtr0mtr.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/os/os0file.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/os/os0thread.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/page/page0cur.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/page/page0page.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
storage/innobase/pars/pars0opt.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/pars/pars0pars.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/pars/pars0sym.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
storage/innobase/read/read0read.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/rem/rem0cmp.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/rem/rem0rec.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0ins.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0mysql.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0purge.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r828:
  Remove dict_tree_t, which should have been removed in r453.
  There always was a one-to-one mapping between dict_tree_t and dict_index_t.
  
  This saves 6 machine words per B-tree index in the data dictionary
  cache plus the memory allocation overhead.  We save one mem_heap_t
  object per index (15 machine words).  Considering the internal
  fragmentation of the buddy allocator in mem_area_alloc(), this should
  save 32 machine words per index (128 bytes on 32-bit systems and 256
  bytes on 64-bit systems).  (Bug #20877)
  
  struct dict_tree_struct, dict_tree_t: Remove.
  
  struct dict_index_struct: Add page and lock.
  
  dict_tree_create(): Remove.  Replace the invocation with
  assignment to index->page and a call to rw_lock_create(&index->lock).
  
  dict_tree_free(): Remove.  Replace the invocation wtih
  a call to rw_lock_free(&index->lock).
  
  dict_index_get_tree(): Remove.
  
  dict_tree_get_space_reserve(): Rename to dict_index_get_space_reserve()
  and remove the parameter, which was unused.
  
  btr_level_list_remove(): Remove the unused parameter "tree".
  
  Replace the occurrences of "tree" with "index" in names of variables,
  functions and data types, e.g. "dict_tree_t tree" becomes
  "dict_index_t index".  Remove local variables "tree" or "index" of
  functions that needed both "tree" and "index".
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0row.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0sel.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r821:
  dict_table_t: Rename the integer field max_row_size
  to the Boolean field big_rows.  (Bug #20877)
  
  BIG_ROW_SIZE: Move the definition from row0sel.c to dict_table_add_to_cache().
  
  
  Revision r825:
  row_search_for_mysql(): Skip setting the next-key lock on an already 
  delete-marked record in a clustered index where the search criteria is 
  unique, within the same transaction (Bug #13544).
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r837:
  page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
  calls.
  
  dict_index_build_node_ptr(): Correct a typo in a comment.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
  
  Revision r845:
  Split long lines with [] operators better.
storage/innobase/row/row0uins.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0umod.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/row/row0upd.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r819:
  dict_col_t: Reduce ord_part to one bit.
  
  dict_index_add_to_cache(): Instead of incrementing ord_part, set it.
  
  dict_index_remove_from_cache(): Do not touch ord_part.
  
  dtype_t: Reduce mbminlen from 3 to 2 bits.
  
  row_upd(): Add a UNIV_LIKELY hint around node->in_mysql_interface.
  
  
  Revision r820:
  Remove dict_col_t::clust_pos.
  
  dict_col_get_clust_pos(): Add parameter clust_index.  Replace the
  look-up with a linear search of all columns in the clustered index.
  
  row_upd_index_replace_new_col_vals(): Compute clust_index outside
  the loops.  Compute clust_pos outside the inner loop.
  
  row_upd_changes_ord_field_binary(), row_upd_changes_first_fields_binary():
  Compute clust_index outside the loops.  Declare the auxiliary variables
  inside the loop scope.
  
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
  
  Revision r851:
  row_upd_sec_step(): Fix false comment.
storage/innobase/row/row0vers.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/srv/srv0srv.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
  
  
  Revision r832:
  Add dict_table_get_col_name() in preparation for getting rid of
  dict_col_t::name, and use it instead of col->name everywhere.
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/srv/srv0start.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/sync/sync0arr.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/sync/sync0rw.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r813:
  Reduce the size of the data dictionary cache.  (Bug #20877)
  
  dtype_t: Remove unused field "prec", which was supposed to be used for
  the precision of decimal columns in stand-alone InnoDB.
  
  dtype_get_prec(): Remove.
  
  dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".
  
  dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
  into bit-fields.
  
  dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.
  
  dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.
  
  Replace the default clust_pos value ULINT_UNDEFINED with
  REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
  the accessor function dict_col_get_clust_pos().
  
  dict_field_t: Turn prefix_len and fixed_len into bit-fields.
  
  dict_tree_t: Remove pad[64].
  
  dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
  cached, flags, stat_initialized, and autoinc_inited into bit-fields.
  Remove does_not_fit_in_memory from non-debug builds.
  
  dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
  n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.
  
  dict_foreign_struct: Turn n_fields and type into bit-fields.
  
  rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
  Omit level unless #defined UNIV_SYNC_DEBUG.
  
  Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
  from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
  dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
storage/innobase/sync/sync0sync.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/trx/trx0purge.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/trx/trx0rec.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r834:
  dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
  so that all integer fields can be packed into 64 bits.  (Bug #20877)
  
  dtype_t: Change the type of all bit-fields to unsigned.
  
  dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
  dict_table_get_sys_col(), dict_field_get_col(): Return const
  dict_col_t*, so that changes to dict_col_t can be detected more
  easily.  Add const to many dict_col_t* declarations.
  
  dict_index_get_nth_type(): Replace with dict_index_get_nth_col().
  
  dict_col_get_type(): Replace with dict_col_copy_type().
  
  dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
  dict_col_get_sql_null_size(): New functions.
  
  dtype_get_at_most_n_mbchars(): Replace the parameter dtype
  with the parameters prtype, mbminlen, mbmaxlen.
  
  dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
  cmp_whole_field(): Replace the dtype_t* parameter with the ulint
  parameters mtype, prtype.
  
  dtype_copy(): Add a const qualifier to type2 (the one being copied from).
  
  dtype_set_mblen(): Replaced with dtype_get_mblen().
  
  dtype_get_fixed_size_low(), dtype_get_min_size_low(),
  dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
  dtype_get_min_size(), and dtype_get_max_size().  These are used by the
  dict_col_get_{fixed,min,max}_size() functions.
  
  cmp_types_are_equal(): Replace with cmp_cols_are_equal().
  
  dict_table_get_col_name(): Add a const qualifier parameter to the
  parameter "table".
  
  dtype_binary, dtype_binary_val: Remove.
  
  dtype_is_fixed_size(): Remove.
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/trx/trx0rseg.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/trx/trx0sys.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r829:
  Erase the magic number in the trx sys header using a redo-logged write;
  it should be redo-logged because the data structure is file-based;
  this patch does not fix any bug; the original erase operation was added
  in r781 to fix Valgrind Bug #20791
  
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/trx/trx0trx.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
storage/innobase/trx/trx0undo.c:
  Applied innodb-5.1 snapshots ss799 and ss854
  
  Revision r838:
  Revamp the line splits done in r763 and r764 that can now be done better,
  thanks to r826.
2006-09-21 01:39:09 -06:00

1085 lines
28 KiB
C

/******************************************************
The database buffer buf_pool flush algorithm
(c) 1995-2001 Innobase Oy
Created 11/11/1995 Heikki Tuuri
*******************************************************/
#include "buf0flu.h"
#ifdef UNIV_NONINL
#include "buf0flu.ic"
#include "trx0sys.h"
#endif
#include "ut0byte.h"
#include "ut0lst.h"
#include "page0page.h"
#include "fil0fil.h"
#include "buf0buf.h"
#include "buf0lru.h"
#include "buf0rea.h"
#include "ibuf0ibuf.h"
#include "log0log.h"
#include "os0file.h"
#include "trx0sys.h"
#include "srv0srv.h"
/* When flushed, dirty blocks are searched in neighborhoods of this size, and
flushed along with the original page. */
#define BUF_FLUSH_AREA ut_min(BUF_READ_AHEAD_AREA,\
buf_pool->curr_size / 16)
/**********************************************************************
Validates the flush list. */
static
ibool
buf_flush_validate_low(void);
/*========================*/
/* out: TRUE if ok */
/************************************************************************
Inserts a modified block into the flush list. */
void
buf_flush_insert_into_flush_list(
/*=============================*/
buf_block_t* block) /* in: block which is modified */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL)
|| (ut_dulint_cmp((UT_LIST_GET_FIRST(buf_pool->flush_list))
->oldest_modification,
block->oldest_modification) <= 0));
UT_LIST_ADD_FIRST(flush_list, buf_pool->flush_list, block);
ut_ad(buf_flush_validate_low());
}
/************************************************************************
Inserts a modified block into the flush list in the right sorted position.
This function is used by recovery, because there the modifications do not
necessarily come in the order of lsn's. */
void
buf_flush_insert_sorted_into_flush_list(
/*====================================*/
buf_block_t* block) /* in: block which is modified */
{
buf_block_t* prev_b;
buf_block_t* b;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
prev_b = NULL;
b = UT_LIST_GET_FIRST(buf_pool->flush_list);
while (b && (ut_dulint_cmp(b->oldest_modification,
block->oldest_modification) > 0)) {
prev_b = b;
b = UT_LIST_GET_NEXT(flush_list, b);
}
if (prev_b == NULL) {
UT_LIST_ADD_FIRST(flush_list, buf_pool->flush_list, block);
} else {
UT_LIST_INSERT_AFTER(flush_list, buf_pool->flush_list, prev_b,
block);
}
ut_ad(buf_flush_validate_low());
}
/************************************************************************
Returns TRUE if the file page block is immediately suitable for replacement,
i.e., the transition FILE_PAGE => NOT_USED allowed. */
ibool
buf_flush_ready_for_replace(
/*========================*/
/* out: TRUE if can replace immediately */
buf_block_t* block) /* in: buffer control block, must be in state
BUF_BLOCK_FILE_PAGE and in the LRU list */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
if (block->state != BUF_BLOCK_FILE_PAGE) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: buffer block state %lu"
" in the LRU list!\n",
(ulong)block->state);
ut_print_buf(stderr, block, sizeof(buf_block_t));
return(FALSE);
}
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
|| (block->buf_fix_count != 0)
|| (block->io_fix != 0)) {
return(FALSE);
}
return(TRUE);
}
/************************************************************************
Returns TRUE if the block is modified and ready for flushing. */
UNIV_INLINE
ibool
buf_flush_ready_for_flush(
/*======================*/
/* out: TRUE if can flush immediately */
buf_block_t* block, /* in: buffer control block, must be in state
BUF_BLOCK_FILE_PAGE */
ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
&& (block->io_fix == 0)) {
if (flush_type != BUF_FLUSH_LRU) {
return(TRUE);
} else if (block->buf_fix_count == 0) {
/* If we are flushing the LRU list, to avoid deadlocks
we require the block not to be bufferfixed, and hence
not latched. */
return(TRUE);
}
}
return(FALSE);
}
/************************************************************************
Updates the flush system data structures when a write is completed. */
void
buf_flush_write_complete(
/*=====================*/
buf_block_t* block) /* in: pointer to the block in question */
{
ut_ad(block);
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
block->oldest_modification = ut_dulint_zero;
UT_LIST_REMOVE(flush_list, buf_pool->flush_list, block);
ut_d(UT_LIST_VALIDATE(flush_list, buf_block_t, buf_pool->flush_list));
(buf_pool->n_flush[block->flush_type])--;
if (block->flush_type == BUF_FLUSH_LRU) {
/* Put the block to the end of the LRU list to wait to be
moved to the free list */
buf_LRU_make_block_old(block);
buf_pool->LRU_flush_ended++;
}
/* fprintf(stderr, "n pending flush %lu\n",
buf_pool->n_flush[block->flush_type]); */
if ((buf_pool->n_flush[block->flush_type] == 0)
&& (buf_pool->init_flush[block->flush_type] == FALSE)) {
/* The running flush batch has ended */
os_event_set(buf_pool->no_flush[block->flush_type]);
}
}
/************************************************************************
Flushes possible buffered writes from the doublewrite memory buffer to disk,
and also wakes up the aio thread if simulated aio is used. It is very
important to call this function after a batch of writes has been posted,
and also when we may have to wait for a page latch! Otherwise a deadlock
of threads can occur. */
static
void
buf_flush_buffered_writes(void)
/*===========================*/
{
buf_block_t* block;
byte* write_buf;
ulint len;
ulint len2;
ulint i;
if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) {
os_aio_simulated_wake_handler_threads();
return;
}
mutex_enter(&(trx_doublewrite->mutex));
/* Write first to doublewrite buffer blocks. We use synchronous
aio and thus know that file write has been completed when the
control returns. */
if (trx_doublewrite->first_free == 0) {
mutex_exit(&(trx_doublewrite->mutex));
return;
}
for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i];
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
!= mach_read_from_4(block->frame + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written"
" seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the buffer pool\n"
"InnoDB: before posting to the"
" doublewrite buffer.\n");
}
if (block->check_index_page_at_flush
&& !page_simple_validate(block->frame)) {
buf_page_print(block->frame);
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Apparent corruption of an"
" index page n:o %lu in space %lu\n"
"InnoDB: to be written to data file."
" We intentionally crash server\n"
"InnoDB: to prevent corrupt data"
" from ending up in data\n"
"InnoDB: files.\n",
(ulong) block->offset, (ulong) block->space);
ut_error;
}
}
/* increment the doublewrite flushed pages counter */
srv_dblwr_pages_written+= trx_doublewrite->first_free;
srv_dblwr_writes++;
if (trx_doublewrite->first_free > TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
len = TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE;
} else {
len = trx_doublewrite->first_free * UNIV_PAGE_SIZE;
}
fil_io(OS_FILE_WRITE,
TRUE, TRX_SYS_SPACE,
trx_doublewrite->block1, 0, len,
(void*)trx_doublewrite->write_buf, NULL);
write_buf = trx_doublewrite->write_buf;
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len; len2 += UNIV_PAGE_SIZE) {
if (mach_read_from_4(write_buf + len2 + FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2 + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written"
" seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the doublewrite block1.\n");
}
}
if (trx_doublewrite->first_free > TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
len = (trx_doublewrite->first_free
- TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) * UNIV_PAGE_SIZE;
fil_io(OS_FILE_WRITE,
TRUE, TRX_SYS_SPACE,
trx_doublewrite->block2, 0, len,
(void*)(trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
* UNIV_PAGE_SIZE),
NULL);
write_buf = trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE;
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len;
len2 += UNIV_PAGE_SIZE) {
if (mach_read_from_4(write_buf + len2
+ FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2
+ UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM
+ 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be"
" written seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in"
" the doublewrite block2.\n");
}
}
}
/* Now flush the doublewrite buffer data to disk */
fil_flush(TRX_SYS_SPACE);
/* We know that the writes have been flushed to disk now
and in recovery we will find them in the doublewrite buffer
blocks. Next do the writes to the intended positions. */
for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i];
if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
!= mach_read_from_4(block->frame + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written"
" seems corrupt!\n"
"InnoDB: The lsn fields do not match!"
" Noticed in the buffer pool\n"
"InnoDB: after posting and flushing"
" the doublewrite buffer.\n"
"InnoDB: Page buf fix count %lu,"
" io fix %lu, state %lu\n",
(ulong)block->buf_fix_count,
(ulong)block->io_fix,
(ulong)block->state);
}
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER,
FALSE, block->space, block->offset, 0, UNIV_PAGE_SIZE,
(void*)block->frame, (void*)block);
}
/* Wake possible simulated aio thread to actually post the
writes to the operating system */
os_aio_simulated_wake_handler_threads();
/* Wait that all async writes to tablespaces have been posted to
the OS */
os_aio_wait_until_no_pending_writes();
/* Now we flush the data to disk (for example, with fsync) */
fil_flush_file_spaces(FIL_TABLESPACE);
/* We can now reuse the doublewrite memory buffer: */
trx_doublewrite->first_free = 0;
mutex_exit(&(trx_doublewrite->mutex));
}
/************************************************************************
Posts a buffer page for writing. If the doublewrite memory buffer is
full, calls buf_flush_buffered_writes and waits for for free space to
appear. */
static
void
buf_flush_post_to_doublewrite_buf(
/*==============================*/
buf_block_t* block) /* in: buffer block to write */
{
try_again:
mutex_enter(&(trx_doublewrite->mutex));
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if (trx_doublewrite->first_free
>= 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
mutex_exit(&(trx_doublewrite->mutex));
buf_flush_buffered_writes();
goto try_again;
}
ut_memcpy(trx_doublewrite->write_buf
+ UNIV_PAGE_SIZE * trx_doublewrite->first_free,
block->frame, UNIV_PAGE_SIZE);
trx_doublewrite->buf_block_arr[trx_doublewrite->first_free] = block;
trx_doublewrite->first_free++;
if (trx_doublewrite->first_free
>= 2 * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
mutex_exit(&(trx_doublewrite->mutex));
buf_flush_buffered_writes();
return;
}
mutex_exit(&(trx_doublewrite->mutex));
}
/************************************************************************
Initializes a page for writing to the tablespace. */
void
buf_flush_init_for_writing(
/*=======================*/
byte* page, /* in: page */
dulint newest_lsn, /* in: newest modification lsn to the page */
ulint space, /* in: space id */
ulint page_no) /* in: page number */
{
/* Write the newest modification lsn to the page header and trailer */
mach_write_to_8(page + FIL_PAGE_LSN, newest_lsn);
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
newest_lsn);
/* Write the page number and the space id */
mach_write_to_4(page + FIL_PAGE_OFFSET, page_no);
mach_write_to_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID, space);
/* Store the new formula checksum */
mach_write_to_4(page + FIL_PAGE_SPACE_OR_CHKSUM,
srv_use_checksums
? buf_calc_page_new_checksum(page)
: BUF_NO_CHECKSUM_MAGIC);
/* We overwrite the first 4 bytes of the end lsn field to store
the old formula checksum. Since it depends also on the field
FIL_PAGE_SPACE_OR_CHKSUM, it has to be calculated after storing the
new formula checksum. */
mach_write_to_4(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
srv_use_checksums
? buf_calc_page_old_checksum(page)
: BUF_NO_CHECKSUM_MAGIC);
}
/************************************************************************
Does an asynchronous write of a buffer page. NOTE: in simulated aio and
also when the doublewrite buffer is used, we must call
buf_flush_buffered_writes after we have posted a batch of writes! */
static
void
buf_flush_write_block_low(
/*======================*/
buf_block_t* block) /* in: buffer block to write */
{
#ifdef UNIV_LOG_DEBUG
static ibool univ_log_debug_warned;
#endif /* UNIV_LOG_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
#ifdef UNIV_IBUF_DEBUG
ut_a(ibuf_count_get(block->space, block->offset) == 0);
#endif
ut_ad(!ut_dulint_is_zero(block->newest_modification));
#ifdef UNIV_LOG_DEBUG
if (!univ_log_debug_warned) {
univ_log_debug_warned = TRUE;
fputs("Warning: cannot force log to disk if"
" UNIV_LOG_DEBUG is defined!\n"
"Crash recovery will not work!\n",
stderr);
}
#else
/* Force the log to the disk before writing the modified block */
log_write_up_to(block->newest_modification, LOG_WAIT_ALL_GROUPS, TRUE);
#endif
buf_flush_init_for_writing(block->frame, block->newest_modification,
block->space, block->offset);
if (!srv_use_doublewrite_buf || !trx_doublewrite) {
fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER,
FALSE, block->space, block->offset, 0, UNIV_PAGE_SIZE,
(void*)block->frame, (void*)block);
} else {
buf_flush_post_to_doublewrite_buf(block);
}
}
/************************************************************************
Writes a page asynchronously from the buffer buf_pool to a file, if it can be
found in the buf_pool and it is in a flushable state. NOTE: in simulated aio
we must call os_aio_simulated_wake_handler_threads after we have posted a batch
of writes! */
static
ulint
buf_flush_try_page(
/*===============*/
/* out: 1 if a page was flushed, 0 otherwise */
ulint space, /* in: space id */
ulint offset, /* in: page offset */
ulint flush_type) /* in: BUF_FLUSH_LRU, BUF_FLUSH_LIST, or
BUF_FLUSH_SINGLE_PAGE */
{
buf_block_t* block;
ibool locked;
ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST
|| flush_type == BUF_FLUSH_SINGLE_PAGE);
mutex_enter(&(buf_pool->mutex));
block = buf_page_hash_get(space, offset);
ut_a(!block || block->state == BUF_BLOCK_FILE_PAGE);
if (flush_type == BUF_FLUSH_LIST
&& block && buf_flush_ready_for_flush(block, flush_type)) {
block->io_fix = BUF_IO_WRITE;
/* If AWE is enabled and the page is not mapped to a frame,
then map it */
if (block->frame == NULL) {
ut_a(srv_use_awe);
/* We set second parameter TRUE because the block is
in the LRU list and we must put it to
awe_LRU_free_mapped list once mapped to a frame */
buf_awe_map_page_to_frame(block, TRUE);
}
block->flush_type = flush_type;
if (buf_pool->n_flush[flush_type] == 0) {
os_event_reset(buf_pool->no_flush[flush_type]);
}
(buf_pool->n_flush[flush_type])++;
locked = FALSE;
/* If the simulated aio thread is not running, we must
not wait for any latch, as we may end up in a deadlock:
if buf_fix_count == 0, then we know we need not wait */
if (block->buf_fix_count == 0) {
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
locked = TRUE;
}
mutex_exit(&(buf_pool->mutex));
if (!locked) {
buf_flush_buffered_writes();
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
}
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing page space %lu, page no %lu \n",
(ulong) block->space, (ulong) block->offset);
}
#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
return(1);
} else if (flush_type == BUF_FLUSH_LRU && block
&& buf_flush_ready_for_flush(block, flush_type)) {
/* VERY IMPORTANT:
Because any thread may call the LRU flush, even when owning
locks on pages, to avoid deadlocks, we must make sure that the
s-lock is acquired on the page without waiting: this is
accomplished because in the if-condition above we require
the page not to be bufferfixed (in function
..._ready_for_flush). */
block->io_fix = BUF_IO_WRITE;
/* If AWE is enabled and the page is not mapped to a frame,
then map it */
if (block->frame == NULL) {
ut_a(srv_use_awe);
/* We set second parameter TRUE because the block is
in the LRU list and we must put it to
awe_LRU_free_mapped list once mapped to a frame */
buf_awe_map_page_to_frame(block, TRUE);
}
block->flush_type = flush_type;
if (buf_pool->n_flush[flush_type] == 0) {
os_event_reset(buf_pool->no_flush[flush_type]);
}
(buf_pool->n_flush[flush_type])++;
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
/* Note that the s-latch is acquired before releasing the
buf_pool mutex: this ensures that the latch is acquired
immediately. */
mutex_exit(&(buf_pool->mutex));
buf_flush_write_block_low(block);
return(1);
} else if (flush_type == BUF_FLUSH_SINGLE_PAGE && block
&& buf_flush_ready_for_flush(block, flush_type)) {
block->io_fix = BUF_IO_WRITE;
/* If AWE is enabled and the page is not mapped to a frame,
then map it */
if (block->frame == NULL) {
ut_a(srv_use_awe);
/* We set second parameter TRUE because the block is
in the LRU list and we must put it to
awe_LRU_free_mapped list once mapped to a frame */
buf_awe_map_page_to_frame(block, TRUE);
}
block->flush_type = flush_type;
if (buf_pool->n_flush[block->flush_type] == 0) {
os_event_reset(buf_pool->no_flush[block->flush_type]);
}
(buf_pool->n_flush[flush_type])++;
mutex_exit(&(buf_pool->mutex));
rw_lock_s_lock_gen(&(block->lock), BUF_IO_WRITE);
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
"Flushing single page space %lu,"
" page no %lu \n",
(ulong) block->space,
(ulong) block->offset);
}
#endif /* UNIV_DEBUG */
buf_flush_write_block_low(block);
return(1);
} else {
mutex_exit(&(buf_pool->mutex));
return(0);
}
}
/***************************************************************
Flushes to disk all flushable pages within the flush area. */
static
ulint
buf_flush_try_neighbors(
/*====================*/
/* out: number of pages flushed */
ulint space, /* in: space id */
ulint offset, /* in: page offset */
ulint flush_type) /* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */
{
buf_block_t* block;
ulint low, high;
ulint count = 0;
ulint i;
ut_ad(flush_type == BUF_FLUSH_LRU || flush_type == BUF_FLUSH_LIST);
low = (offset / BUF_FLUSH_AREA) * BUF_FLUSH_AREA;
high = (offset / BUF_FLUSH_AREA + 1) * BUF_FLUSH_AREA;
if (UT_LIST_GET_LEN(buf_pool->LRU) < BUF_LRU_OLD_MIN_LEN) {
/* If there is little space, it is better not to flush any
block except from the end of the LRU list */
low = offset;
high = offset + 1;
}
/* fprintf(stderr, "Flush area: low %lu high %lu\n", low, high); */
if (high > fil_space_get_size(space)) {
high = fil_space_get_size(space);
}
mutex_enter(&(buf_pool->mutex));
for (i = low; i < high; i++) {
block = buf_page_hash_get(space, i);
ut_a(!block || block->state == BUF_BLOCK_FILE_PAGE);
if (block && flush_type == BUF_FLUSH_LRU && i != offset
&& !block->old) {
/* We avoid flushing 'non-old' blocks in an LRU flush,
because the flushed blocks are soon freed */
continue;
}
if (block && buf_flush_ready_for_flush(block, flush_type)
&& (i == offset || block->buf_fix_count == 0)) {
/* We only try to flush those neighbors != offset
where the buf fix count is zero, as we then know that
we probably can latch the page without a semaphore
wait. Semaphore waits are expensive because we must
flush the doublewrite buffer before we start
waiting. */
mutex_exit(&(buf_pool->mutex));
/* Note: as we release the buf_pool mutex above, in
buf_flush_try_page we cannot be sure the page is still
in a flushable state: therefore we check it again
inside that function. */
count += buf_flush_try_page(space, i, flush_type);
mutex_enter(&(buf_pool->mutex));
}
}
mutex_exit(&(buf_pool->mutex));
return(count);
}
/***********************************************************************
This utility flushes dirty blocks from the end of the LRU list or flush_list.
NOTE 1: in the case of an LRU flush the calling thread may own latches to
pages: to avoid deadlocks, this function must be written so that it cannot
end up waiting for these latches! NOTE 2: in the case of a flush list flush,
the calling thread is not allowed to own any latches on pages! */
ulint
buf_flush_batch(
/*============*/
/* out: number of blocks for which the write
request was queued; ULINT_UNDEFINED if there
was a flush of the same type already running */
ulint flush_type, /* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST; if
BUF_FLUSH_LIST, then the caller must not own
any latches on pages */
ulint min_n, /* in: wished minimum mumber of blocks flushed
(it is not guaranteed that the actual number
is that big, though) */
dulint lsn_limit) /* in the case BUF_FLUSH_LIST all blocks whose
oldest_modification is smaller than this
should be flushed (if their number does not
exceed min_n), otherwise ignored */
{
buf_block_t* block;
ulint page_count = 0;
ulint old_page_count;
ulint space;
ulint offset;
ibool found;
ut_ad((flush_type == BUF_FLUSH_LRU)
|| (flush_type == BUF_FLUSH_LIST));
ut_ad((flush_type != BUF_FLUSH_LIST)
|| sync_thread_levels_empty_gen(TRUE));
mutex_enter(&(buf_pool->mutex));
if ((buf_pool->n_flush[flush_type] > 0)
|| (buf_pool->init_flush[flush_type] == TRUE)) {
/* There is already a flush batch of the same type running */
mutex_exit(&(buf_pool->mutex));
return(ULINT_UNDEFINED);
}
(buf_pool->init_flush)[flush_type] = TRUE;
for (;;) {
/* If we have flushed enough, leave the loop */
if (page_count >= min_n) {
break;
}
/* Start from the end of the list looking for a suitable
block to be flushed. */
if (flush_type == BUF_FLUSH_LRU) {
block = UT_LIST_GET_LAST(buf_pool->LRU);
} else {
ut_ad(flush_type == BUF_FLUSH_LIST);
block = UT_LIST_GET_LAST(buf_pool->flush_list);
if (!block
|| (ut_dulint_cmp(block->oldest_modification,
lsn_limit) >= 0)) {
/* We have flushed enough */
break;
}
}
found = FALSE;
/* Note that after finding a single flushable page, we try to
flush also all its neighbors, and after that start from the
END of the LRU list or flush list again: the list may change
during the flushing and we cannot safely preserve within this
function a pointer to a block in the list! */
while ((block != NULL) && !found) {
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if (buf_flush_ready_for_flush(block, flush_type)) {
found = TRUE;
space = block->space;
offset = block->offset;
mutex_exit(&(buf_pool->mutex));
old_page_count = page_count;
/* Try to flush also all the neighbors */
page_count += buf_flush_try_neighbors(
space, offset, flush_type);
/* fprintf(stderr,
"Flush type %lu, page no %lu, neighb %lu\n",
flush_type, offset,
page_count - old_page_count); */
mutex_enter(&(buf_pool->mutex));
} else if (flush_type == BUF_FLUSH_LRU) {
block = UT_LIST_GET_PREV(LRU, block);
} else {
ut_ad(flush_type == BUF_FLUSH_LIST);
block = UT_LIST_GET_PREV(flush_list, block);
}
}
/* If we could not find anything to flush, leave the loop */
if (!found) {
break;
}
}
(buf_pool->init_flush)[flush_type] = FALSE;
if ((buf_pool->n_flush[flush_type] == 0)
&& (buf_pool->init_flush[flush_type] == FALSE)) {
/* The running flush batch has ended */
os_event_set(buf_pool->no_flush[flush_type]);
}
mutex_exit(&(buf_pool->mutex));
buf_flush_buffered_writes();
#ifdef UNIV_DEBUG
if (buf_debug_prints && page_count > 0) {
ut_a(flush_type == BUF_FLUSH_LRU
|| flush_type == BUF_FLUSH_LIST);
fprintf(stderr, flush_type == BUF_FLUSH_LRU
? "Flushed %lu pages in LRU flush\n"
: "Flushed %lu pages in flush list flush\n",
(ulong) page_count);
}
#endif /* UNIV_DEBUG */
if (page_count != ULINT_UNDEFINED)
srv_buf_pool_flushed+= page_count;
return(page_count);
}
/**********************************************************************
Waits until a flush batch of the given type ends */
void
buf_flush_wait_batch_end(
/*=====================*/
ulint type) /* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */
{
ut_ad((type == BUF_FLUSH_LRU) || (type == BUF_FLUSH_LIST));
os_event_wait(buf_pool->no_flush[type]);
}
/**********************************************************************
Gives a recommendation of how many blocks should be flushed to establish
a big enough margin of replaceable blocks near the end of the LRU list
and in the free list. */
static
ulint
buf_flush_LRU_recommendation(void)
/*==============================*/
/* out: number of blocks which should be flushed
from the end of the LRU list */
{
buf_block_t* block;
ulint n_replaceable;
ulint distance = 0;
mutex_enter(&(buf_pool->mutex));
n_replaceable = UT_LIST_GET_LEN(buf_pool->free);
block = UT_LIST_GET_LAST(buf_pool->LRU);
while ((block != NULL)
&& (n_replaceable < BUF_FLUSH_FREE_BLOCK_MARGIN
+ BUF_FLUSH_EXTRA_MARGIN)
&& (distance < BUF_LRU_FREE_SEARCH_LEN)) {
if (buf_flush_ready_for_replace(block)) {
n_replaceable++;
}
distance++;
block = UT_LIST_GET_PREV(LRU, block);
}
mutex_exit(&(buf_pool->mutex));
if (n_replaceable >= BUF_FLUSH_FREE_BLOCK_MARGIN) {
return(0);
}
return(BUF_FLUSH_FREE_BLOCK_MARGIN + BUF_FLUSH_EXTRA_MARGIN
- n_replaceable);
}
/*************************************************************************
Flushes pages from the end of the LRU list if there is too small a margin
of replaceable pages there or in the free list. VERY IMPORTANT: this function
is called also by threads which have locks on pages. To avoid deadlocks, we
flush only pages such that the s-lock required for flushing can be acquired
immediately, without waiting. */
void
buf_flush_free_margin(void)
/*=======================*/
{
ulint n_to_flush;
ulint n_flushed;
n_to_flush = buf_flush_LRU_recommendation();
if (n_to_flush > 0) {
n_flushed = buf_flush_batch(BUF_FLUSH_LRU, n_to_flush,
ut_dulint_zero);
if (n_flushed == ULINT_UNDEFINED) {
/* There was an LRU type flush batch already running;
let us wait for it to end */
buf_flush_wait_batch_end(BUF_FLUSH_LRU);
}
}
}
/**********************************************************************
Validates the flush list. */
static
ibool
buf_flush_validate_low(void)
/*========================*/
/* out: TRUE if ok */
{
buf_block_t* block;
dulint om;
UT_LIST_VALIDATE(flush_list, buf_block_t, buf_pool->flush_list);
block = UT_LIST_GET_FIRST(buf_pool->flush_list);
while (block != NULL) {
om = block->oldest_modification;
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_a(ut_dulint_cmp(om, ut_dulint_zero) > 0);
block = UT_LIST_GET_NEXT(flush_list, block);
if (block) {
ut_a(ut_dulint_cmp(om, block->oldest_modification)
>= 0);
}
}
return(TRUE);
}
/**********************************************************************
Validates the flush list. */
ibool
buf_flush_validate(void)
/*====================*/
/* out: TRUE if ok */
{
ibool ret;
mutex_enter(&(buf_pool->mutex));
ret = buf_flush_validate_low();
mutex_exit(&(buf_pool->mutex));
return(ret);
}