Fixed that mysql-test-run --skip-from starts from the given test
mysql-test/lib/mtr_cases.pl:
Moved testing of $opt_start_from to mysql-test-run.pl because tests are now run per suite and the old way would rerun not wanted tests
mysql-test/mysql-test-run.pl:
Fixed that mysql-test-run --skip-from starts from the given test
MARIA_MAX_MSG_BUF -> HA_MAX_MSG_BUF
include/maria.h:
Remove MARIA_MAX_MSG_BUF; We are now using HA_MAX_MSG_BUF
Added maria_test_invalid_symlink
storage/maria/ha_maria.cc:
MARIA_MAX_MSG_BUF -> HA_MAX_MSG_BUF
storage/maria/ma_check.c:
Removed tab in string constant
Add extra argument to ma_open_datafile()
storage/maria/ma_create.c:
Set error number if table is in use
storage/maria/ma_open.c:
Added name argument to open functions for security check if filename is linked to another file in database directory
storage/maria/ma_static.c:
Default functions for checking if wrong symlink
storage/maria/maria_chk.c:
Add extra argument to _ma_open_datafile()
storage/maria/maria_def.h:
Add extra argument to _ma_open_datafile()
in write_changed_bitmap(), and page cache forbids that. Here we make the page
cache more relaxed. Original patch by Sanja, simplified by me as limited to
not-locked. See comment of ma_bitmap.c.
With that, maria_stress.yy runs until hitting BUG 39665.
storage/maria/ma_bitmap.c:
A thread which unpins bitmap pages in _ma_bitmap_unpin_all() sometimes
hit an assertion in the page cache (info!=0 in remove_pin()) which states
that you can unpin/unlock only what *you* have pinned/locked.
Fixed by setting the new last parameter of pagecache_unlock_by_link()
to TRUE in _ma_bitmap_unpin_all().
storage/maria/ma_blockrec.c:
new prototype and splitting assertion in three (3rd one fires: BUG 39665)
storage/maria/ma_check.c:
new prototype
storage/maria/ma_key_recover.c:
new prototype
storage/maria/ma_loghandler.c:
new prototype
storage/maria/ma_pagecache.c:
Allow a thread to unpin, with pagecache_unlock_by_link(), a non-locked page pinned by others.
This is a hack for _ma_bitmap_unpin_all() which needs to unpin pages which were
pinned by other threads in write_changed_bitmap().
storage/maria/ma_pagecache.h:
new prototype
storage/maria/ma_preload.c:
new prototype
storage/maria/unittest/ma_pagecache_rwconsist.c:
new prototype
storage/maria/unittest/ma_pagecache_single.c:
new prototype
already supports pin-without-lock so implementation of this WL is instant and
done here. This could improve concurrency. No testcase, this requires
multiple threads and is automatically tested at push time by maria_stress.yy (pushbuild2).
storage/maria/ma_bitmap.c:
As the page cache supports pinning without write-locking, we don't take write lock
in write_changed_bitmap(), only a pin; this could improve concurrency (WL#4595).
which nobody woke up (see comment of ma_bitmap.c). No testcase, this requires
multiple threads and is automatically tested at push time by maria_stress.yy (pushbuild2).
storage/maria/ma_bitmap.c:
* _ma_bitmap_wait_or_flush() didn't publish that it was waiting for bitmap to not
be over-allocated (i.e. didn't modify bitmap->flush_all_requested) so nobody
(_ma_bitmap_flushable(), _ma_bitmap_release_unused()) knew it had to wake it up
=> it stalled (BUG#39210). In fact the wait in _ma_bitmap_wait_or_flush()
is not needed, it's ok if this function sends the over-allocated bitmap to page
cache and keeps pin on it (_ma_bitmap_unpin_all() will unpin it later, and
the one who added _ma_bitmap_wait_or_flush() didn't know it). Function
is thus deleted, as _ma_bitmap_flush() can do its job.
* After fixing that, test runs longer and BUG 39665 happens, which looks like
a separate page cache bug.
* Smaller changes: _ma_bitmap_flush_all() called write_changed_bitmap() even
though it might not be changed; added some DBUG calls in functions; split
assertions.
* In _ma_bitmap_release_unused(), it's more logical to test non_flushable_state
than now_transactional to know if we have to decrement non_flushable
(it's exactly per the definition of non_flushable_state).
storage/maria/ma_blockrec.c:
_ma_bitmap_wait_or_flush() is not needed.
******
new prototype and splitting assertion in three (3rd one fires: BUG 39665)
storage/maria/ma_blockrec.h:
_ma_bitmap_wait_or_flush() is not needed.
- The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction.
Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION
Fix for Bug #39987 main.partition_not_windows fails under debug build
Fixed some compiler errors & warnings found by pushbuild
include/my_base.h:
Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed
include/my_global.h:
Removed 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves
mysql-test/r/subselect_debug.result:
Reset value of the debug variable; Without setting this the subselect_innodb test will fail when run after this one
mysql-test/suite/maria/r/maria.result:
Merged test with myisam.test
Added tests for new fixed bugs
mysql-test/suite/maria/t/maria.test:
Merged test with myisam.test
Added tests for new fixed bugs
mysql-test/t/subselect_debug.test:
Reset value of the debug variable; Without setting this the subselect_innodb test will fail when run after this one
mysys/my_uuid.c:
Fixed compiler error on windows
sql/ha_partition.cc:
Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226)
Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227)
sql/mysqld.cc:
Fix for Bug #39987 main.partition_not_windows fails under debug build
The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't
sql/sql_base.cc:
Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit
sql/sql_parse.cc:
More DBUG_PRINT. Fixed comments
storage/maria/ma_extra.c:
If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction.
This is safe as this is only used as part of flush tables or when the table is not part of a transaction
storage/myisam/mi_open.c:
Indentation fix
unittest/mysys/waiting_threads-t.c:
Remove not needed 'volatile' to get rid of compiler warnings on windows
It was a forgotten rw_unlock(), due to the deadlock detector feature (so bug was only in 5.1-maria, not
6.0-maria).
mysql-test/suite/maria/r/maria3.result:
result, all fine
mysql-test/suite/maria/t/maria3.test:
Test of BUG#39697: two scenarios (transactional tables, and non-transactional table but dynamic row format so still taking the rwlock) where the hang happened.
t2 added by this test was masked by a temporary table created earlier in the test, which we forgot to drop.
storage/maria/ha_maria.cc:
use new macro
storage/maria/ma_blockrec.c:
use new macro
storage/maria/ma_commit.c:
use new macro
storage/maria/ma_init.c:
putting address of dummy_transaction_object in --debug trace can be useful
storage/maria/ma_open.c:
use new macro
storage/maria/ma_write.c:
if local_lock_tree is true, we have acquired keyinfo->root_lock so need to release it before "goto err".
A pair of assertions so that our usage of TrIDs is kept sensible.
storage/maria/maria_def.h:
A macro so that changes of MARIA_HA::trn can be tracked with --debug. It helped to understand in what cases,
in maria_write(), we could have !(info->dup_key_trid == info->trn->trid) && !share->now_transactional
(answer: ALTER TABLE adding UNIQUE index on transactional table).
mysql-test/r/maria.result:
Test suite of BUG#39399.
mysql-test/t/maria.test:
Test suite of BUG#39399.
storage/maria/ha_maria.cc:
Comparison of tables during altering fixed. (BUG#39399)
Unused function parameter removed.
Symptom was that records_in_range() found 0 matching keys which confused the optimizer to belive that there was no matching rows for the query
mysql-test/r/maria.result:
New testcase
mysql-test/t/maria.test:
New testcase
storage/maria/ma_search.c:
Fix bug in skip_key for keys that starts with a CHAR/VARCHAR NULL key.
storage/maria/ma_delete.c:
Remove wrong optimization (first_key is not related to keypos value at this point)
storage/maria/maria_chk.c:
Added printing of forgotten option
it forces the user to bzero a key before setting it as a pointer, otherwise
it'll have random content on architectures where
sizeof(void*) < sizeof(ulonglong).
Declaring a key as ulonglong only (not a union) makes this user mistake
impossible.
include/waiting_threads.h:
WT_RESOURCE_ID::value is an ulonglong, not a union
mysys/waiting_threads.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
storage/maria/ma_write.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
storage/maria/trnman.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
unittest/mysys/waiting_threads-t.c:
WT_RESOURCE_ID::value is an ulonglong, not a union
This allowed me to remove a lot of parameters to functions, local variables,
duplicate code and identical constructs. It should also make the code easier
to read.
Changed all marking of page as changed to use offset instead of pointers; This removed
one theoretical problem where dynamic_array may have been moved between two calls.
In addition I changed some functions from return my_bool
include/maria.h:
Changes to use MARIA_PAGE
storage/maria/ma_check.c:
Changes to use MARIA_PAGE
Folded lines longer > 79 characters
storage/maria/ma_delete.c:
Changes to use MARIA_PAGE
Changed _ma_ck_delete(), ma_log_delete(), ma_write_undo_key_delete() and _ma_ck_real_delete() to return type my_bool
Removed some calls to maria_print_error() as the caller (maria_delete() and maria_write()) also prints the error
storage/maria/ma_ft_update.c:
Fix needed as _ma_ck_delete() now returns my_bool
New parameter for ma_write_keypage.
storage/maria/ma_key_recover.c:
Changes to use MARIA_PAGE
storage/maria/ma_key_recover.h:
Updated function prototypes
storage/maria/ma_page.c:
Changes to use MARIA_PAGE
Added _ma_page_setup() for old functions that doesn't (yet) use MARIA_PAGE natively
storage/maria/ma_range.c:
Changes to use MARIA_PAGE
storage/maria/ma_rt_index.c:
Changes to use MARIA_PAGE
Changed maria_rtree_delete() and maria_rtree_real_delete() to return type my_bool
Removed one 'if (node_flag) as this was always true
Changed lable 'err1' to 'err' as there was no other error lables
Moved allocation of page_buff outside of loop for fewer alloc/free calls
Changed n_pages and m_pages to uint as 65000 pages is more than enough
storage/maria/ma_rt_index.h:
Updated function prototypes
storage/maria/ma_rt_key.c:
Changes to use MARIA_PAGE
storage/maria/ma_rt_key.h:
Updated function prototypes
storage/maria/ma_rt_mbr.c:
Changes to use MARIA_PAGE
storage/maria/ma_rt_mbr.h:
Updated function prototypes
storage/maria/ma_rt_split.c:
Changes to use MARIA_PAGE
storage/maria/ma_search.c:
Changes to use MARIA_PAGE
storage/maria/ma_write.c:
Changes to use MARIA_PAGE
Changed _ma_ck_write_btree_with_log(), _ma_ck_real_write_btree(), ma_enlarge_root() to use return type my_bool
Don't set *root to HA_OFFSET_ERROR in case of error
Removed maria_print_error() calls as caller will do this
Simplified logic in balance_page by introducing pointers to left and right pages
storage/maria/maria_chk.c:
Changes to use MARIA_PAGE
storage/maria/maria_def.h:
Changes to use MARIA_PAGE
Removed some not used macros
Added macros for MARIA_PAGE handling
This was done by introducing another mutex for handling the key_del link
I also renamed all key_del variables to start with key_del prefix
storage/maria/ma_close.c:
Rename of key_del variables
storage/maria/ma_key_recover.c:
Changed key_del to be protexted by it's own mutex: key_del_lock
Rename of key_del variables
Removed comment for old bug
storage/maria/ma_key_recover.h:
Rename of key_del variables
storage/maria/ma_open.c:
Initialization for new key_del_lock mutex
Renamed intern_cond to key_del_cond as it was only used for protection of key_del
storage/maria/ma_page.c:
Rename of key_del variables
storage/maria/ma_write.c:
Rename of key_del variables
storage/maria/maria_def.h:
Rename of key_del variables
Added key_del_lock
Fixed compiler warning
Ensure that pagecache returns correct error number
storage/maria/ma_pagecache.c:
Ensure that block->error contain error code from my_errno (not return value from pread/pwrite)
Went through usage of my_pread/my_pwrite and ensured that result was threated correctly
Fixed some wrong usage of my_bool
Ensure that pagecache gives correct error number even if error for block happend
mysys/my_pread.c:
Indentation fix
storage/maria/ha_maria.cc:
filenames changed to be of type LEX_STRING
storage/maria/ma_check.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_checkpoint.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_create.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_dbug.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_delete.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_info.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_keycache.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_locking.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_loghandler.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_open.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_pagecache.c:
Store error number for last failed operation in the page block
This should fix some asserts() when errno was not properly set after failure to read block in another thread
storage/maria/ma_recovery.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_update.c:
filenames changed to be of type LEX_STRING
storage/maria/ma_write.c:
filenames changed to be of type LEX_STRING
storage/maria/maria_def.h:
filenames changed to be of type LEX_STRING
storage/maria/maria_ftdump.c:
filenames changed to be of type LEX_STRING
storage/maria/maria_pack.c:
filenames changed to be of type LEX_STRING
There is no test cases as it's not trivial to do a test case for this.
The new code for Maria is however executed by the test case in the bug report.
mysql-test/mysql-test-run.pl:
Avoid warnings when running with --extern
storage/maria/ha_maria.cc:
Disable not complete assert until Sanja can push a proper fix
storage/maria/ma_delete.c:
Fix that pageflag for page is calculated based on original values
storage/maria/ma_search.c:
Ensure that prev_length structure variable is properly reset when not used
storage/myisam/mi_search.c:
Ensure that prev_length structure variable is properly reset when not used
Don't write out states if they haven't changed
sql/sql_base.cc:
Call extra(HA_EXTRA_PREPARE_FOR_DROP) before doing a drop of a table
More DBUG
sql/sql_table.cc:
Call extra(HA_EXTRA_PREPARE_FOR_RENAME) before renaming a table
storage/maria/ha_maria.cc:
Ensure that file->trn is set when we call extra(HA_EXTRA_PREPARE_FOR_DROP/RENAME)
storage/maria/ma_close.c:
When doing close, assert if we have pointers in trn->table_list that points to the MARIA_SHARE
storage/maria/ma_extra.c:
Reset info->state_start in case of drop/rename. This fixes the problem of accessing freed memory in repair
Don't write state changed if they haven't changed
storage/maria/ma_open.c:
Reset share->changed after we have written out a state (speed optimization to not write states when they haven't changed)
storage/maria/ma_state.c:
Decrement share->in_trans properly in DBUG_BINARY to ensure that the DBUG_ASSERT() in maria_close() works
More DBUG
storage/maria/ma_search.c:
when we found a matching key on the node page and want to search in the left leaf
we must use only SEARCH_FIND flag, and never SEARCH_BIGGER, SEARCH_SMALLER, or SEARCH_LAST
typo fixed.
mysql-test/r/maria.result:
new test case
mysql-test/t/maria.test:
new test case
sql/sql_select.cc:
ctags friendly
storage/maria/ma_blockrec.c:
typo fixed
include/waiting_threads.h:
C_MODE_START/END
mysys/waiting_threads.c:
relax the checks - auto init thd in will_wait_for,
allow to destroy uninited thd (=noop),
allow a "release" an unexistent resource (=noop),
sql/sql_class.cc:
move wt* maintainance from maria to the server.
do THD::cleanup after ha_close_connection() and plugin_thdvar_cleanup().
storage/maria/unittest/trnman-t.c:
update to new prototype
storage/maria/ma_write.c:
select ... group by ... - take temporary tables into account, they have TRN->pins == 0
storage/maria/trnman.c:
one cannot modify TRN->trid, it's a key in the trid_to_trn
hash, if trid is modified, TRN won't be found (and deleted in
trnman_free_trn) from the hash.
include/my_pthread.h:
cleanup
include/waiting_threads.h:
header guard
mysys/waiting_threads.c:
bug - kill strategy were not applied to deadlocks of length 1.
cast timeout to ulonglong.
storage/maria/ma_static.c:
declare WT_RESOURCE_TYPE ma_rc_dup_unique
storage/maria/ma_write.c:
deadlock detection when waiting on unique key (useless until we can rollback)
storage/maria/maria_def.h:
deadlock detection when waiting on unique key (useless until we can rollback)
storage/maria/trnman.c:
use deadlock detector.
protect state transitions of a TRN with a mutex.
trnman_trid_to_trn() function.
storage/maria/trnman.h:
trnman_trid_to_trn() function
protect state transitions of a TRN with a mutex
use deadlock detector.
storage/maria/trnman_public.h:
trnman_trid_to_trn()
client/mysqltest.c:
compiler warnings
configure.in:
remove old tests for unused programs
disable the use of gcc built-ins if smp assembler atomics were selected explictily.
add waiting_threads.o to THREAD_LOBJECTS
include/lf.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
include/my_pthread.h:
shuffle set_timespec/set_timespec_nsec macros a bit to be able to fill
several timeout structures with only one my_getsystime() call
include/waiting_threads.h:
waiting threads - wait-for graph and deadlock detection
mysys/Makefile.am:
add waiting_threads.c
mysys/lf_alloc-pin.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
constructor/destructor in lf-alloc
mysys/lf_hash.c:
constructor/destructor in lf-alloc
mysys/my_thr_init.c:
remember end-of-stack pointer in the mysys_var
mysys/waiting_threads.c:
waiting threads - wait-for graph and deadlock detection
storage/maria/ha_maria.cc:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/ma_commit.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/trnman_public.h:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
storage/maria/unittest/trnman-t.c:
replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
scheduler.
unittest/mysys/Makefile.am:
add waiting_threads-t
unittest/mysys/lf-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/my_atomic-t.c:
factor out the common code for multi-threaded stress unit tests
move lf tests to a separate file
unittest/mysys/thr_template.c:
factor out the common code for multi-threaded stress unit tests
unittest/mysys/waiting_threads-t.c:
wt tests
Fixed prev_last_lsn assignment.
storage/maria/ma_loghandler.c:
Fix for BUG#37737:
- buffer flush finish now can be done only in order
- overlay processing fixed (no back direction bufferslocking now)
Fixed prev_last_lsn assignment (now only for new buffer and only under buffer lock protection).
Reset history when we reenable logging for transactional tables (safety fix)
mysql-test/r/maria2.result:
New results
mysql-test/t/maria2.test:
Added test case for alter table on locked maria table
mysql-test/valgrind.supp:
Added suppression rules for warnings in libc / libld
storage/maria/ma_extra.c:
Remove table from trnman list if we are going to drop or rename it; We don't want not existing shares in the list when we do commit!
storage/maria/ma_recovery.c:
Ensure that info->state don't point to history event when we disable logging for a table; This is needed as alter table will first do commit and then unlock, which would cause us to access a non existing object when we reenable logging.
Reset history when we reenable logging (safety fix)
storage/maria/ma_state.c:
Do less work when share->now_transactional is not set. (Safety fix)
Added function to remove shares to be deleted from trnman->used_tables
Added function to reset history to current context
storage/maria/ma_state.h:
Prototypes for new function
used TL_WRITE_CONCURRENT_INSERT though they may update/delete a row. This could cause concurrent SELECTs
to see a changing table while the SELECT happens, or if the query was made of a group of SELECTs,
some SELECTs would see different versions of the table. And anyway versioning in Maria was so far coded
to support only insertions. REPLACE SELECT, INSERT VALUES ON DUPLICATE KEY UPDATE, LOAD DATA REPLACE
were ok.
mysql-test/r/maria2.result:
result. Without the code fix, the assertion added to ha_maria::update_row() would fire twice.
mysql-test/t/maria2.test:
test when INSERT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE do update rows
storage/maria/ha_maria.cc:
Assert that update_row and delete_row never see TL_WRITE_CONCURRENT_INSERT.
INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE
must upgrade TL_WRITE_CONCURRENT_INSERT to TL_WRITE because they may update/delete a row.
this was true also for INSERT SELECT, UPDATE, DELETE. This fix will be removed when Maria supports COMMIT/ROLLBACK
("Maria 2.0"), because then Maria will trans_register_ha() and so participate in ha_commit_trans().
Without the fix, the assertion added to ha_maria::external_lock() fires many times in *maria*.test.
sql/sql_parse.cc:
Before sending OK to client, commit transaction in Maria.
storage/maria/ha_maria.cc:
Assertion added to external_lock() when committing: OK should not have been sent yet (ACI*D*).
In ha_maria::implicit_commit(), possibility to not create a new transaction, this is used
before net_end_statement(), when the next step is close_thread_tables();
in this use case, ha_maria::implicit_commit() should not commit if under LOCK TABLES.
storage/maria/ha_maria.h:
new prototype
- Fixes key corruption where pages wasn't marked that they contained transid.
- Fixed bug in block record that could create too small rows when transid was removed. This fixed some asserts() when testing block length
Added --abort-source-on-error to the mysql client. (Very helpfull when debugging wrong .sql files)
client/client_priv.h:
Added enum for new option to mysql
client/mysql.cc:
Added new option --abort-source-on-error to allow one to get 'source' to stop on error. This is 0 by default, to keep old behaviour.
Print file name and line number when getting an error when doing source filename
sql/field.cc:
Removed old dead code
sql/sql_class.cc:
Removed old dead code
storage/maria/ma_blockrec.c:
Added checking of min block length to check_directory()
When creating new directory entry, set length to 0; This ensures that the assert checks() on block lengths works properly.
Added more DBUG_ASSERT() and more calls to check_directory()
In get_head_or_tail_page(), send in correct min_block_length. This is now safe as the length of new blocks are now 0
storage/maria/ma_delete.c:
When moving key to parent page, mark page if key has transid
storage/maria/ma_write.c:
Fixed bug where _ma_find_last_pos() didn't set int_key->flag.
Simpilifed code by unrolling loop.
the table is empty.
- lifting another limit: versioning was disabled if table had more than one unique index
- correcting test of statement-based binlogging, when converting read locks to TL_READ_NO_INSERT
KNOWN_BUGS.txt:
removing mostly fixed limitation (see ha_maria.cc)
mysql-test/r/maria-mvcc.result:
result update
mysql-test/t/maria-mvcc.test:
now when table is empty it does not do versioning, so test hung; inserting one row at start of the test,
to enable versioning.
sql/sql_parse.cc:
Maria team wrongly removed this "break", thanks Davi for noticing
storage/maria/ha_maria.cc:
- We used to prevent versioning in INSERT/REPLACE SELECT and LOAD DATA, because the index rebuild done by
bulk insert sometimes, is unsafe when versioning is on. Here we change that: in store_lock(), if the table is empty
(which is required for index rebuild to be used), we disable versioning; in start_bulk_insert(), we don't do
index rebuild if versioning is enabled.
- Test for statement-based binlogging was incomplete: statement-based binlogging is on for this statement
if binlog is open and statement has binlogging enabled and statement is not doing row-based binlogging
storage/maria/ma_open.c:
Monty and I agreed that it's ok to have versioning on a table with more than one unique index: if an INSERT
hits a duplicate key when inserting the second index' key, no other thread should be able to touch the
first index' just-inserted key, because that key has an uncommitted transaction id, so the first thread
should have time to remove the first index' key.
- after auto-zerofill (ha_maria::check_and_repair()) kepts its state's LSNs unchanged, which could
be the same as the create_rename_lsn of another pre-existing table, which would break versioning as this LSN
serves as unique identifier in the versioning code (in maria_open()). Even the state pieces which
maria_zerofill() did change were lost (because they didn't go to disk).
- after this fix, if two tables were auto-zerofilled at the same time (by _ma_mark_changed())
they could receive the same create_rename_lsn, which would break versioning again. Fix is to write a log
record each time a table is imported.
- Print state's LSNs (create_rename_lsn, is_of_horizon, skip_redo_lsn) and UUID in maria_chk -dvv.
mysql-test/r/maria-autozerofill.result:
result
mysql-test/t/maria-autozerofill.test:
Test for auto-zerofilling
storage/maria/ha_maria.cc:
The state changes done by auto-zerofilling never reached disk.
storage/maria/ma_check.c:
When zerofilling a table, including its pages' LSNs, new state LSNs are needed next time the table
is imported into a Maria instance.
storage/maria/ma_create.c:
Write LOGREC_IMPORTED_TABLE when importing a table. This is informative and ensures
that the table gets a unique create_rename_lsn even though multiple tables
are imported by concurrent threads (it advances the log's end LSN).
storage/maria/ma_key_recover.c:
comment
storage/maria/ma_locking.c:
instead of using translog_get_horizon() for state's LSNs of imported table,
use the LSN of to-be-written LOGREC_IMPORTED_TABLE.
storage/maria/ma_loghandler.c:
New type of log record
storage/maria/ma_loghandler.h:
New type of log record
storage/maria/ma_loghandler_lsn.h:
New name for constant as can be used not only by maria_chk but auto-zerofill now too.
storage/maria/ma_open.c:
instead of using translog_get_horizon() for state's LSNs of imported table,
use the LSN of to-be-written LOGREC_IMPORTED_TABLE.
storage/maria/ma_recovery.c:
print content of LOGREC_IMPORTED_TABLE in maria_read_log.
storage/maria/maria_chk.c:
print info about LSNs of the table's state, and UUID, when maria_chk -dvv
storage/maria/maria_pack.c:
new name for constant
storage/maria/unittest/ma_test_recovery.pl:
Now that maria_chk -dvv shows state LSNs and UUID those need to be filtered out,
as maria_read_log -a does not use the same as at original run.
Fixed several (but not all) issues found by the test program:
- ASSERT on row_length in ma_blockrec.c::_ma_compact_block_page()
- Fixed bug when splitting node pages
- Fixed hang in 'closeing tables' (conflicting mutex order) by ensuring we first take trnman lock and then share->intern_lock
storage/maria/ma_blockrec.c:
When compacting a row page when allocating space for a new row, the min length of a the new block may be temporarly smaller than 'min_block_length'.
storage/maria/ma_check.c:
More DBUG output
storage/maria/ma_checkpoint.c:
Call new function _ma_remove_not_visible_states_with_lock() to ensure we first take lock on trnman and then on share->intern_lock
+
storage/maria/ma_close.c:
Added comment
storage/maria/ma_open.c:
Added comment
storage/maria/ma_search.c:
Copy also node data; Caused bug when splitting node pages
storage/maria/ma_state.c:
Added _ma_remove_not_visible_states_with_lock() to ensure we take locks in right order
storage/maria/ma_state.h:
Added new prototype
storage/maria/trnman.c:
Added trnman_lock() and trnman_unlock().
Needed by _ma_remove_not_visible_states_with_lock() to get mutex in right order
storage/maria/trnman_public.h:
Added new prototypes
What varies accross machine is maria_pagecache_read_requests, but maria_pagecache_reads doesn't and
is the most interesting (helps verify that disk wasn't touched after preloading), that's all we keep.
mysql-test/r/maria-preload.result:
unrepeatable variable removed
mysql-test/t/maria-preload.test:
unrepeatable variable removed
storage/maria/ma_test_force_start.pl:
portability fix for running under Windows
in the last days: substitution in tests has to work for absolute datadir (/dev/shm/...);
internal temp tables (like information_schema) can be Maria; Maria may not be compiled in; splitting
too long maria.test in two; mtr --embedded runs in mysql-test not mysql-test/var/master-data
so we need some absolute paths in tests; can't restart mysqld in --embedded; missing DBUG_VOID_RETURN in
mysqltest.c (fix from Serg); is_collation_character_set_applicability.test was too long name
which broke tar's 99-char limit.
storage/maria/ma_blockrec.c:
comment
storage/maria/ma_check.c:
When zerofilling the data file, _ma_compact_block_page() may increase free space in a
page so bitmap page needs to be corrected.