do not incorrectly mark the column as fixed-length. (Bug #28138)
ibuf_entry_build(): Instead of prefix_len, pass fixed_len to
dtype_new_store_for_order_and_null_size(). Add debug assertions.
btr_index_rec_validate(): Correct a comment about prefix indexes.
rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add
debug assertions and comments.
dict_col_type_assert_equal(): New debug function.
and adapt some things.
Note that ha_innodb.cc depends on mysql_tmpfile() being declared in
<mysql/plugin.h>. Until the function is declared there, you can
uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc.
Remove storage/innobase/*/Makefile.am. The whole compilation is driven by
storage/innobase/Makefile.am and storage/innobase/plug.in.
plug.in: Declare InnoDB as a dynamic plugin.
ha_innodb.h: Remove the declarations of many global variables. The variables
are no longer directly referenced outside of storage/innobase.
trx_t: Add the field trx->duplicates.
trx_create(): Initialize the fields trx->active_trans and trx->duplicates.
innobase_query_is_update(): Remove. Consult trx->duplicates instead.
ChangeSet@1.2372, 2006-12-31 02:29:11+01:00, kent@mysql.com +79 -0
Many files:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
Adjusted year(s) in copyright header
Added GPL copyright text
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.
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".
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.
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.
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.
and lexer files). From now on, the following Emacs cc-mode settings apply
when indenting C function bodies in InnoDB:
(setq c-basic-offset 8)
(setq c-label-minimum-indentation 0)
(add-to-list 'c-offsets-alist '(c . 0))
(add-to-list 'c-offsets-alist '(label . [0]))
The indentation rules for function declarations still have not been
formalized, and they must be formatted manually.
Try to limit all lines to at most 79 characters (assuming TAB stops every
8 characters) by splitting lines before opening parenthesis, or at
string constants.
Fix some grammar mistakes in diagnostic output:
match to, match with -> match
found from -> found in
trying rename -> trying to rename
Fix an error in page_check_dir(): it said "supremum not pointed to"
when the infimum was not pointed to.
Enclose commented-out code snippets in #if 0 ... #endif instead of /* ... */.
Add (void*) casts to some %p parameters in fprintf() calls. Try to
split lines before a binary operator, not after one. (These three fixes
were not made everywhere.)
to the insert buffer. This was noticed while analyzing Bug #19081, but
this should not fix Bug #19081, since according to Heikki, btr_search_latch
is not reserved during an insert.
ut_print_name(), ut_print_namel(): Add parameter table_id for distinguishing
names of tables from other identifiers (names of indexes, columns and
constraints).
innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_convert_from_filename(), innobase_get_charset(): New functions.
dict_accept(), dict_scan_id(), dict_scan_col(), dict_scan_table_name(),
dict_skip_word(), dict_create_foreign_constraints_low():
Add parameter "cs", so that isspace() can be replaced with my_isspace(),
whose operation depends on the connection character set.
dict_scan_id(): Convert the identifier to UTF-8.
dict_str_starts_with_keyword(): New extern function, to replace dict_accept()
in row_search_for_mysql().
mysql_get_identifier_quote_char(): Replaced with innobase_print_identifier().
ha_innobase::create(): Remove the thd->convert_string() call.
Pass the statement to InnoDB in the connection character set
and let InnoDB convert the identifiers to UTF-8.
FIL_PAGE_NEXT and FIL_PAGE_PREV when accessing sibling pages
of B-tree indexes.
btr_validate_level(): Check the validity of the doubly linked list
formed by FIL_PAGE_NEXT and FIL_PAGE_PREV.
the implementation would be challenging with ROW_FORMAT=COMPACT.
Remove the table types DICT_TABLE_CLUSTER_MEMBER and DICT_TABLE_CLUSTER and
all related tests and functions.
dict_table_t: Remove mix_id, mix_len, mix_id_len, mix_id_buf, and
cluster_name.
plan_t: Remove mixed_index.
dict_create_sys_tables_tuple(): Set MIX_ID=0, MIX_LEN=0 and CLUSTER_NAME=NULL
when inserting into SYS_TABLES.
dict_tree_check_search_tuple(): Enclose in #ifdef UNIV_DEBUG.
r340: Fix http://bugs.mysql.com/bug.php?id=18283 in ha_innodb.cc and
http://bugs.mysql.com/bug.php?id=18238 in InnoDB
r339: Remove disk space leak on update of BLOB columns (Bug #18252).
btr_cur_pessimistic_update(): Invoke rec_get_offsets() after
rec_set_field_extern_bits().
btr_store_big_rec_extern_fields(): Note that offsets will no longer be
valid after calling this function.
r338: Fix bug 18238 : check in pessimistic insert and update if the buffer
pool is exhausted by locks
row_upd_index_replace_new_col_vals_index_pos(): Add a parameter, "ibool
order_only", for limiting the replacement to the ordering fields of the
index. Adjust callers.
In this port, the comment for the parameter was adjusted to make it clear
that it only supports clustered indexes.
which can contain the new flag DICT_TF_COMPACT. Change dict_mem_table_create
to take a flags argument. Add dict_table_is_comp(). Adapt all users.
Change some places to explicitly assume that system tables do not use the
compact page format.
Corrected some comments.
os_file_create_tmpfile(): Remove the implementation from InnoDB Hot Backup.
In InnoDB Hot Backup builds, do not define dict_casedn_str(),
which is invoked in fil_load_single_table_tablespace() on
Windows. This function depends on innobase_casedn_str() and
my_casedn_str().
Define btr_check_node_ptr() and data_error only #ifdef UNIV_DEBUG.
They are only being used in ut_ad() assertions.
Replace the occurrences of the type uint with ulint, because InnoDB
Hot Backup does not define any uint data type.
Disable lock_validate() in InnoDB Hot Backup builds.
Disable some unused static variables of srv0srv.c in InnoDB Hot Backup builds.
Disable some srv_table_...() functions in InnoDB Hot Backup builds.
Disable some unused static variables in srv0start.c in
InnoDB Hot Backup builds.
Disable io_handler_thread() in InnoDB Hot Backup builds.
Disable srv_calc_low32() and srv_calc_high32() in InnoDB Hot Backup builds
to avoid warnings about unused functions.
In fil_node_open_file(), avoid bogus assertions in InnoDB Hot Backup builds.
In fil_load_single_table_tablespace(), remove the call to dict_casedn_str(),
as it depends on MySQL code.
Copy the code of recv_reset_log_files_for_backup() from InnoDB Hot Backup.
Disable innobase_mysql_cmp(), cmp_whole_field(), cmp_data_data_slow(),
cmp_dtuple_rec_with_match() and cmp_rec_rec_with_match()
in InnoDB Hot Backup builds, as they depend on MySQL code.
Adapt dtype_set_mblen() and dtype_get_fixed_size() for InnoDB Hot Backup
builds, assuming that they will only be called on system tables, which
do not contain multi-byte characters.
Disable the static functions row_ins_set_exclusive_rec_lock() and
row_ins_dupl_error_with_rec() in InnoDB Hot Backup builds
to avoid warnings about unused functions.
In row_sel_field_store_in_mysql_format(), disable some UTF-8 related
assertions #ifndef UNIV_RELEASE_NOT_YET_STABLE.
new tablespaces created from now on.
btr_store_big_rec_extern_fields(): Set FIL_PAGE_TYPE to FIL_PAGE_TYPE_BLOB.
buf_page_print(): Decode FIL_PAGE_TYPE. Replace if-else with switch().
buf_page_create(): Set FIL_PAGE_PREV, FIL_PAGE_NEXT and FIL_PAGE_TYPE.
trx_sysf_create(): Set FIL_PAGE_TYPE to FIL_PAGE_TYPE_TRX_SYS.
Initialize TRX_SYS_RSEG_SPACE.
FIL_PAGE_TYPE: Document that the field cannot be relied on in older
versions of MySQL/InnoDB. Add new type codes.
ibuf_bitmap_page_init(): Document that the rest of the page is uninitialized.
ibuf_add_free_page(): Log the setting of FIL_PAGE_TYPE.
fsp_header_init(): Set FIL_PAGE_TYPE to FIL_PAGE_TYPE_FSP_HDR.
Initialize FSP_NOT_USED.
fsp_fill_free_list(): Set FIL_PAGE_TYPE to FIL_PAGE_TYPE_XDES.
fsp_alloc_seg_inode_page(): Set FIL_PAGE_TYPE to FIL_PAGE_INODE.
fseg_create_general(): Set FIL_PAGE_TYPE to FIL_PAGE_TYPE_SYS.
adaptive hash index for a B-tree page. (Bug #16582)
btr_search_drop_page_hash_index(): Retry the operation if a hash index
with different parameters was built meanwhile. Add diagnostics for the
case that hash node pointers to the page remain. This fix is from Heikki.
btr_search_info_update_hash(), btr_search_info_update_slow():
Document the parameter "info" as in/out.
Note that buf_block_t::index should be protected by btr_search_latch
or an s-latch or x-latch on the index page.
btr_search_drop_page_hash_index(): Read block->index while holding
btr_search_latch and use the cached value in the loop. Remove some
redundant assertions.