So far, the parameter innodb_change_buffering was only settable by the
SET GLOBAL command. Any change specified in the configuration file or
on the mysqld command line was ignored. This was reported as Issue #217.
rb://109 approved by Heikki Tuuri.
history. This addresses Mantis issue #116.
dict_index_t: Enable the storage of trx_id.
row_prebuilt_t: Make many fields bit-fields to reduce the memory
footprint. Add index_usable.
ha_innobase::change_active_index(): Check if the index is usable and
set prebuilt->index_usable accordingly. Unfortunately, the return
status of this function is ignored by MySQL, and the actual refusal to
use the index must be made in row_search_for_mysql().
row_search_for_mysql(): Return DB_MISSING_HISTORY if
!prebuilt->index_usable.
convert_error_code_to_mysql(): Map DB_MISSING_HISTORY to
HA_ERR_TABLE_DEF_CHANGED.
innodb-index.test: Add a test case where access to a newly created
secondary index must be blocked for old transactions.
rb://100 approved by Heikki Tuuri
Make ChangeLog entries for bugs in bugs.mysql.com in the form:
Fix Bug#12345 bug title
(for bugs after 1.0.2 was released and the ChangeLog published)
There is no need to bloat the ChangeLog with information that is available
via bugs.mysql.com.
Discussed with: Marko
Unprotected updates to ut_total_allocated_memory in
os_mem_alloc_large() and os_mem_free_large(), called during
fast index creation, may corrupt the variable and cause assertion failures.
Also, add UNIV_MEM_ALLOC() and UNIV_MEM_FREE() instrumentation around
os_mem_alloc_large() and os_mem_free_large(), so that Valgrind can
detect more errors.
rb://90 approved by Heikki Tuuri. This addresses Issue #177.
innodb_additional_mem_pool_size, because nothing will
be allocated from mem_comm_pool.
mem_pool_create(): Remove the assertion about size. The function will
work with any size. However, an assertion would fail in ut_malloc_low()
when size==0.
mem_init(): When srv_use_sys_malloc is set, pass size=1 to mem_pool_create().
mem0mem.c: Add #include "srv0srv.h" that is needed by mem0dbg.c.
If lower_case_table_names=1, MySQL will pass the table names in lower case.
Thus, we can use a binary comparison (strcmp) in the hash table.
rb://87 approved by Heikki Tuuri, to address Bug #41676 and Issue #167.
Implement the global variable innodb_change_buffering, with the
following values:
none - buffer nothing
inserts - buffer inserts (the default)
Approved by Ken Jacobs.
within UNIV_DEBUG. The two remaining callers in non-debug builds,
btr_search_guess_on_hash() and btr_search_validate(), were rewritten
to call buf_page_hash_get().
To implement support for a resizeable buffer pool, the function
buf_block_align() had been rewritten to perform a page hash lookup in
the buffer pool. The caller was also made responsible for holding the
buffer pool mutex.
Because the page hash lookup is expensive and it has to be done while
holding the buffer pool mutex, implement buf_block_align() by pointer
arithmetics again, and make btr_search_guess_on_hash() call it. Note
that this will have to be adjusted if the interface to the resizeable
buffer pool is actually implemented.
rb://83 approved by Heikki Tuuri, to address Issue #161.
As a deviation from the approved patch, this patch also makes
btr_search_validate() (invoked by CHECK TABLE) check that
buf_pool->page_hash is consistent with buf_block_align().
------------------------------------------------------------------------
r4032 | marko | 2009-01-23 15:43:51 +0200 (Fri, 23 Jan 2009) | 10 lines
branches/5.1: Merge r4031 from branches/5.0:
btr_search_drop_page_hash_when_freed(): Check if buf_page_get_gen()
returns NULL. The page may have been evicted from the buffer pool
between buf_page_peek_if_search_hashed() and buf_page_get_gen(),
because the buffer pool mutex will be released between these two calls.
(Bug #42279, Issue #160)
rb://82 approved by Heikki Tuuri
------------------------------------------------------------------------
satisfy some conditions when UNIV_DEBUG is defined.
HASH_SEARCH(): New parameter: ASSERTION. All users will pass an appropriate
ut_ad() or nothing.
dict_table_add_to_columns(): Assert that the table being added to the data
dictionary cache is not already being pointed to by the name_hash and
id_hash tables.
HASH_SEARCH_ALL(): New macro, for use in dict_table_add_to_columns().
dict_mem_table_free(): Set ut_d(table->cached = FALSE), so that we can
check ut_ad(table->cached) when traversing the hash tables, as in
HASH_SEARCH(name_hash, dict_sys->table_hash, ...) and
HASH_SEARCH(id_hash, dict_sys->table_id_hash, ...).
dict_table_get_low(), dict_table_get_on_id_low(): Assert
ut_ad(!table || table->cached).
fil_space_get_by_id(): Check ut_ad(space->magic_n == FIL_SPACE_MAGIC_N)
in HASH_SEARCH(hash, fil_system->spaces, ...).
fil_space_get_by_name(): Check ut_ad(space->magic_n == FIL_SPACE_MAGIC_N)
in HASH_SEARCH(name_hash, fil_system->name_hash, ...).
buf_buddy_block_free(): Check that the blocks are in valid state in
HASH_SEARCH(hash, buf_pool->zip_hash, ...).
buf_page_hash_get(): Check that the blocks are in valid state in
HASH_SEARCH(hash, buf_pool->page_hash, ...).
get_share(), free_share(): Check ut_ad(share->use_count > 0) in
HASH_SEARCH(table_name_hash, innobase_open_tables, ...).
This was posted as rb://75 for tracking down errors similar to Issue #153.
buf_page_struct: Note that space and offset are also protected by
buf_pool_mutex. They are only assigned to by
buf_block_set_file_page(). Thus, it suffices for buf_flush_batch() to
hold just buf_pool_mutex when checking these fields.
buf_flush_try_page(): Rename "locked" to "is_s_latched", per Heikki's request.
buf_flush_batch(): Move the common statement mutex_exit(block_mutex)
from all if-else if-else branches before the if block. Remove the
redundant test (buf_pool->init_flush[flush_type] == FALSE) that was
apparently copied from buf_flush_write_complete().
buf_flush_write_block_low(): Note why it is safe not to hold buf_pool_mutex
or block_mutex. Enumerate the assumptions in debug assertions.
buf_flush_insert_sorted_into_flush_list(): Remove unused code.
Change the parameter to buf_block_t* block and assert that
block->state == BUF_BLOCK_FILE_PAGE. This is part of Issue #155.
interpreter. It was only used for updating the InnoDB internal data
dictionary when renaming or dropping tables. It could have caused
deadlocks after acquiring latches on insert buffer bitmap pages.
This and r3544 should fix Issue #135.
Furthermore, the update-in-place-in-select does not account for
compression failure. That was not a problem yet, since the InnoDB SQL
interpreter has so far assumed ROW_FORMAT=REDUNDANT.
rb://63 approved by Heikki Tuuri
WHILE 1=1 in the SQL procedure, so that the loop will actually be
entered and temporary indexes be dropped during crash recovery.
Thanks to Sunny Bains for pointing this out.
Tested as follows:
Set a breakpoint in row_merge_rename_indexes.
CREATE TABLE t(a INT)ENGINE=InnoDB;
CREATE INDEX a ON t(a);
-- The breakpoint will be reached. Kill and restart mysqld.
SHOW CREATE TABLE t;
-- This shows the MySQL .frm file, without and index.
CREATE TABLE innodb_table_monitor(a INT)ENGINE=InnoDB;
-- This will dump the InnoDB dictionary to the error log, without the index.
to the data dictionary records. This should fix Issue #83.
row_drop_table_for_mysql_no_commit(): Rename back to
row_drop_table_for_mysql(). Commit the transaction if the data
dictionary was not locked when the function was called. Otherwise,
neither commit the transaction nor unlock the data dictionary.
row_merge_drop_table(): Let row_drop_table_for_mysql() take care of
locking the data dictionary.
dict_create_or_check_foreign_constraint_tables(),
trx_rollback_active(), row_create_table_for_mysql(),
row_create_index_for_mysql(), row_table_add_foreign_constraints():
Explicitly commit the transaction, because row_drop_table_for_mysql()
would no longer commit it, given that the data dictionary will be
locked during the calls.
Approved by Sunny (over IM). rb://23
(Bug #36285, rb://9).
innodb-index.test, innodb-index.result: Set innodb_lock_wait_timeout as
a session variable instead of relying on the global value.
innodb-index-master.opt: Remove.
innodb-timeout.test: Test that setting the innodb_lock_wait_timeout
works as advertised.
thd_lock_wait_timeout(): New function, to retrieve the lock wait timeout
for a given MySQL client connection (thd), or the global value (thd==NULL).
srv_lock_wait_timeout, innobase_lock_wait_timeout: Remove.
Replace MYSQL_SYSVAR_LONG(lock_wait_timeout)
with MYSQL_THDVAR_ULONG(lock_wait_timeout).
the maximum record size will never exceed the B-tree page size limit.
For uncompressed tables, there should always be enough space for two
records in an empty B-tree page. For compressed tables, there should
be enough space for storing two node pointer records or one data
record in an empty page in uncompressed format.
dict_build_table_def_step(): Remove the inaccurate check for table row
size.
dict_index_too_big_for_tree(): New function: check if the index
records would be too big for a B-tree page.
dict_index_add_to_cache(): Add the parameter "strict". Invoke
dict_index_too_big_for_tree() if it is set.
trx_is_strict(), thd_is_strict(): New functions, for determining if
innodb_strict_mode is enabled for the current transaction.
dict_create_index_step(): Pass the new parameter strict of
dict_index_add_to_cache() as trx_is_strict(trx). All other callers
pass it as FALSE.
innodb.test: Enable innodb_strict_mode before attempting to create a
table with a too big record size.
innodb-zip.test: Remove the test of inserting random data. Add tests
for checking that the maximum record lengths are enforced at table
creation time.