The problem was that the code in maria_extra assumed that there could be
only one table open when doing maria_extra(MA_FORCE_REOPEN)
However in the case of triggers, there can be multiple copies of
the table open.
Fixed by removing assert.
This commit is based on the work of Michal Schorm, rebased on the
earliest MariaDB version.
Th command line used to generate this diff was:
find ./ -type f \
-exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
-exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \
-exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \
-exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \
-exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \
-exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
This was caused by a combination of factors:
* MyISAM/Aria temporary tables historically never saved the state
to disk (MYI/MAI), because the state never needed to persist
* certain ALTER TABLE operations modify the original TABLE structure
and if they fail, the original table has to be reopened to
revert all changes (m_needs_reopen=1)
as a result, when ALTER fails and MyISAM/Aria temp table gets reopened,
it reads the stale state from the disk.
As a fix, MyISAM/Aria tables now *always* write the state to disk
on close, *unless* HA_EXTRA_PREPARE_FOR_DROP was done first. And
the server now always does HA_EXTRA_PREPARE_FOR_DROP before dropping
a temporary table.
Part of MDEV-5336 Implement LOCK FOR BACKUP
The idea is that instead of waiting in close_cached_tables() for all
tables to be closed, we instead call flush_tables() that does:
- Flush not used objects in table cache to free memory
- Collect all tables that are open
- Call HA_EXTRA_FLUSH on the objects, to get them into "closed state"
- Added HA_EXTRA_FLUSH support to archive and CSV
- Added multi-user protection to HA_EXTRA_FLUSH in MyISAM and Aria
The benefit compared to old code is:
- FTWRL doesn't have to wait for long running read operations or
open HANDLER's
MDEV-10130 Assertion `share->in_trans == 0' failed in storage/maria/ma_close.c
MDEV-10378 Assertion `trn' failed in virtual int ha_maria::start_stmt
The problem was that maria_handler->trn was not properly reset
at commit/rollback and ha_maria::exernal_lock() could get confused
because.
There was some old code in ha_maria::implicit_commit() that tried
to take care of this, but it was not bullet proof.
Fixed by adding list of all tables that is part of the maria transaction to
TRN.
A nice side effect was of the fix is that loops in
ha_maria::implict_commit() got to be much simpler.
Other things:
- Fixed a bug in mysql_admin_table() where argument open_for_modify
was wrongly reset for the next table in the chain
- rollback admin command also in case of fatal error.
- Split _ma_set_trn_for_table() to three version to simplify code
and debugging.
- Several new asserts to detect the original problem (that file was
not properly removed from trn before calling ma_close())
Do not silence uncertain cases, or fix any bugs.
The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
Do not silence uncertain cases, or fix any bugs.
The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
.. share->last_version' failed in myisam/mi_open.c:67: test_if_reopen
During the RENAME operation since the renamed temporary table is also
opened and added to myisam_open_list/maria_open_list, resetting the
last_version at the end of operation (HA_EXTRA_PREPARE_FOR_RENAME)
will cause an assertion failure when a subsequent query tries to open
an additional temporary table instance and thus attempts to reuse it
from the open table list.
This commit fixes the issue by skipping flush/close operations executed
toward the end of ALTER for temporary tables. It also enables a shortcut
for simple ALTERs (like rename, disable/enable keys) on temporary
tables.
As safety checks, added some assertions at code points that should not
be hit for temporary tables.
This is port of fix for MySQL BUG#17647863.
revno: 5572
revision-id: jon.hauglid@oracle.com-20131030232243-b0pw98oy72uka2sj
committer: Jon Olav Hauglid <jon.hauglid@oracle.com>
timestamp: Thu 2013-10-31 00:22:43 +0100
message:
Bug#17647863: MYSQL DOES NOT COMPILE ON OSX 10.9 GM
Rename test() macro to MY_TEST() to avoid conflict with libc++.
Remove Aria state history for drop/rename
mysql-test/suite/maria/r/maria-recovery2.result:
Updated old (wrong) test result
sql/handler.cc:
Fixed wrong argument to implict_commit
storage/maria/ha_maria.cc:
Ensure that we don't use file->trn if THD_TRN is 0. (This means that implict_commit() has been called and the trn object is not ours anymore)
storage/maria/ma_extra.c:
Remove Aria state history for drop/rename
storage/maria/ma_rename.c:
Remove Aria state history for rename
storage/maria/ma_state.c:
More DBUG_PRINT
sql/sql_insert.cc:
CREATE ... IF NOT EXISTS may do nothing, but
it is still not a failure. don't forget to my_ok it.
******
CREATE ... IF NOT EXISTS may do nothing, but
it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
small cleanup
******
small cleanup
The bug was that when using bulk insert combined with lock table, we intitalized the io cache with the wrong file position.
This fixed a bug where MariaDB could not read in a table dump done with mysqldump.
mysql-test/suite/maria/r/locking.result:
Test case for locking + write cache bug
mysql-test/suite/maria/t/locking.test:
Test case for locking + write cache bug
storage/maria/ma_extra.c:
Initialize write cache used with bulk insert to correct file length.
(The old code didn't work if one was using LOCK TABLE for the given table).
storage/maria/ma_blockrec.c:
Unlock bitmaps earlier (no reason to have them unlocked over _ma_write_clr())
storage/maria/ma_extra.c:
Don't lock THR_LOCK_maria for HA_EXTRA_PREPARE_FOR_RENAME (upper level ensures that we are not opening the same table during this call)
We don't need to have share->intern_lock locked over _ma_flush_table_files()
storage/maria/ma_open.c:
Update comment
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
file is stored in the my_file_info struct, along with a flag for append mode
(because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.
Noteworthy benefit of this patch is that it removes limits from the table_cache size -
allowing for more simultaneus users
- In Maria/MyISAM: Release/re-acquire locks to give queries that wait on them a chance to make progress
- In Maria/MyISAM: Change from numeric constants to ICP_RES values.
- In Maria: Do check index condition in maria_rprev() (was lost in the merge/backport?)
- In Maria/MyISAM/XtraDB: Check if the query was killed, and return immediately if it was.
Added new storage engine error: HA_ERR_ABORTED_BY_USER, for handler to signal that it detected a kill of the query and aborted
Authors: Sergey Petrunia & Monty
include/my_base.h:
Added HA_ERR_ABORTED_BY_USER, for handler to signal that it detected a kill of the query and aborted
include/my_handler.h:
Added comment
mysql-test/r/myisam_icp.result:
Updated test
mysql-test/t/myisam_icp.test:
Drop used tables at start of test
Added test case that can help with manual testing of killing index condition pushdown query.
mysys/my_handler_errors.h:
Text for new storage engine error
sql/handler.cc:
If engine got HA_ERR_ABORTED_BY_USER, send kill message.
sql/multi_range_read.cc:
Return error code
storage/maria/ha_maria.cc:
Added ma_killed_in_mariadb() to detect kill.
Ensure that file->external_ref points to TABLE object.
storage/maria/ma_extra.c:
Dummy test-if-killed for standalone
storage/maria/ma_key.c:
If ma_check_index_cond() fails, set my_errno and info->cur_row.lastpos
storage/maria/ma_rkey.c:
Release/re-acquire locks to give queries that wait on them a chance to make progress
Check if the query was killed, and return immediately if it was
storage/maria/ma_rnext.c:
Check if the query was killed, and return immediately if it was
Added missing fast_ma_writeinfo(info)
storage/maria/ma_rnext_same.c:
Check if the query was killed, and return immediately if it was
Added missing fast_ma_writeinfo(info)
storage/maria/ma_rprev.c:
Check if the query was killed, and return immediately if it was
Added missing fast_ma_writeinfo(info) and ma_check_index_cond()
storage/maria/ma_search.c:
Give error message if we find a wrong key
storage/maria/ma_static.c:
Added pointer to test-if-killed function
storage/maria/maria_def.h:
New prototypes
storage/myisam/ha_myisam.cc:
Added mi_killed_in_mariadb()
Ensure that file->external_ref points to TABLE object.
storage/myisam/mi_extra.c:
Dummy test-if-killed for standalone
storage/myisam/mi_key.c:
If ma_check_index_cond() fails, set my_errno and info->lastpos
storage/myisam/mi_rkey.c:
Ensure that info->lastpos= HA_OFFSET_ERROR in case of error
Release/re-acquire locks to give queries that wait on them a chance to make progress
Check if the query was killed, and return immediately if it was
Reorder code to do less things in case of error.
Added missing fast_mi_writeinfo()
storage/myisam/mi_rnext.c:
Check if the query was killed, and return immediately if it was
Simplify old ICP code
Added missing fast_ma_writeinfo(info)
storage/myisam/mi_rnext_same.c:
Check if the query was killed, and return immediately if it was
Added missing fast_mi_writeinfo(info)
storage/myisam/mi_rprev.c:
Check if the query was killed, and return immediately if it was
Simplify error handling of ICP
Added missing fast_mi_writeinfo(info)
storage/myisam/mi_search.c:
Give error message if we find a wrong key
storage/myisam/mi_static.c:
Added pointer to test-if-killed function
storage/myisam/myisamdef.h:
New prototypes
storage/xtradb/handler/ha_innodb.cc:
Added DB_SEARCH_ABORTED_BY_USER and ha_innobase::is_thd_killed()
Check if the query was killed, and return immediately if it was
storage/xtradb/handler/ha_innodb.h:
Added prototype
storage/xtradb/include/db0err.h:
Added DB_SEARCH_ABORTED_BY_USER
storage/xtradb/include/row0mysql.h:
Added possible ICP errors
storage/xtradb/row/row0sel.c:
Use ICP errors instead of constants.
Detect if killed and return B_SEARCH_ABORTED_BY_USER
- Fixed bug lp:624099 ma_close.c:75: maria_close: Assertion `share->in_trans == 0' failed on UNLOCK TABLES
- Fixed bug that caused table to be marked as not closed (crashed) during recovery testing.
- Use maria_delete_table_files() instead of maria_delete_table() to delete tempoary tables (faster and safer)
- Added checks to ensure that bitmap and internal mutex are always taken in right order.
- For transactional tables, only mark the table as changed before page for table is to be written to disk (and thus the log is flushed).
This speeds up things a bit and fixes a problem where open_count was incremented on disk but there was no log entry to fix it during recovery -> table was crashed.
- Fixed a bug in repair() where table was not automaticly repaired.
- Ensure that state->global_changed, share->changed and share->state.open_count are set and reset properly.
- Added option --ignore-control-file to maria_chk to be able to run maria_chk even if the control file is locked.
mysql-test/suite/maria/r/maria-recover.result:
Test result changed as we now force checkpoint before copying table, which results in pagecache getting flushed and we have more rows to recover.
mysql-test/suite/maria/r/maria.result:
Added new tests
mysql-test/suite/maria/t/maria-recover.test:
Force checkpoint before copying table.
This is needed as now the open-count is increased first when first page is flushed.
mysql-test/suite/maria/t/maria.test:
Added tests to verify fix for lp:624099
storage/maria/ha_maria.cc:
Use table->in_use instead of current_thd (trivial optimization)
Use maria_delete_table_files() instead of maria_delete_table() to delete tempoary tables (faster and safer)
More DBUG_ASSERT()
Reset locked tables count after locked tables have been moved to new transaction. This fixed lp:624099
storage/maria/ma_bitmap.c:
Temporarly unlock bitmap mutex when calling _ma_mark_file_changed() and pagecache_delete_pages() to ensure right mutex lock order.
Call _ma_bitmap_unpin_all() when bitmap->non_flusable is set to 0. This fixed a case when bitmap was not proparly unpinned.
More comments
Added DBUG_ASSERT() for detecting wrong share->bitmap usage
storage/maria/ma_blockrec.c:
More DBUG_ASSERT()
Moved code around in _ma_apply_redo_insert_row_head_or_tail() to make things safer on error conditions.
storage/maria/ma_check.c:
Changed parameter for _ma_set_uuid()
Corrected test for detecting if we lost many rows. This fixed some cases where auto-recovery failed.
share->changed need to be set if state.open_count is changed.
Removed setting of share->changed= 0 as called function sets it.
storage/maria/ma_close.c:
- Added code to properly decrement open_count and have it written by _ma_state_info_write() for transactional tables.
(This is more correct and also saves us one extra write by _ma_decrement_open_count() at close.
- Added DBUG_ASSERT() to detect if open_count is wrong at maria_close().
storage/maria/ma_delete.c:
Updated argument to _ma_mark_file_changed()
storage/maria/ma_delete_all.c:
Updated argument to _ma_mark_file_changed()
For transactional tables, call _ma_mark_file_changed() after log entry has been written (to allow recover to fix open_count)
Reset more needed variables in _ma_reset_status()
storage/maria/ma_delete_table.c:
Moved deletion of Aria files to maria_delete_table_files().
Remove RAID usage (old not working code)
storage/maria/ma_extra.c:
Set share->changed=1 when state needs to be updated on disk.
Don't reset share->changed after call to _ma_state_info_write() as this calls sets share->changed.
Set share->state.open_count to 1 to force table to be auto repaired if drop fails.
Set share->global_changed before call to _ma_flush_table_files() to ensure that we don't try to mark the table changed during flush.
Added DBUG_ENTER
storage/maria/ma_locking.c:
Split _ma_mark_file_changed() into two functions to delay marking transactional tables as changed on disk until first disk write.
Added argument to _ma_decrement_open_count() to tell if we should call ma_lock_database() or not.
Don't decrement open count for transactional tables during _ma_decrement_open_count(). This will be done during close.
Changed parameter for _ma_set_uuid()
storage/maria/ma_open.c:
Set share->open_count_not_zero_on_open if state.open_count is not zero.
This is needed for DBUG_ASSERT() in maria_close() that is there to enforce that open_count is always 0 at close.
This test doesn't however work for tables that had open_count != 0 already on disk (ie, crashed tables).
Enforce right mutex order for share->intern_lock and share->bitmap.bitmap_lock
Don't set share->changed to 0 if share->state.open_count != 0, as state needs to be be written at close
storage/maria/ma_pagecache.c:
Moved a bit of code in find_block() to avoid one if.
More DBUG_ASSERT()
(I left a comment in the code for Sanja to look at; The code probably works but we need to check if it's optimal)
storage/maria/ma_pagecrc.c:
For transactional tables, just before first write to disk, but after log is flushed, mark the file changed.
This fixes some cases where recovery() did not detect that table was marked as changed and could thus not recover the marker.
storage/maria/ma_recovery.c:
Set share->changed when share->global_changed is set.
storage/maria/ma_update.c:
Updated parameter for _ma_mark_file_changed()
storage/maria/ma_write.c:
Updated parameter for _ma_mark_file_changed()
storage/maria/maria_chk.c:
Added option --ignore-control-file to be able to run maria_chk even if the control file is locked.
storage/maria/maria_def.h:
Updated function prototypes.
Added open_count_not_zero_on_open to MARIA_SHARE.
storage/myisam/ha_myisam.cc:
current_thd -> table->in_use
- Fix for LP#700623 "Aria recovery: ma_blockrec.c:3930: _ma_update_at_original_place: Assertion `block->org_bitmap_value == _ma_bitmap_get_page_bits(info, &info->s->bitmap, page)' failed"
- Issue was that when deleting a tail page where all index entries where full, the page was marked wrongly in the bitmap.
- If debug_assert_if_crashed_table is set, we now crash when we find Aria corrupted.
- Write more information if we find something wrong with the bitmap.
- Fixed that REPAIR also can fix wrong create_rename_lsn issues (a very unlikely event)
- Define STATE_CRASHED_FLAGS as set of all CRASHED flags (to simplify code)
storage/maria/ha_maria.cc:
Mark the normal page cache (not the page cache for the logs) so that we can request extra debugging for it.
Copy the value of debug_assert_if_crashed_table to maria_assert_if_crashed_table so that we can request a crash at exactly the point where we find Aria corrupted.
Use STATE_CRASHED_FLAGS
storage/maria/ma_bitmap.c:
Made bits_to_txt extern so that we can use this in maria_chk
Added extra information to the log files to be able to easier find bitmap failures in recovery. (When compiling with -DEXTRA_DEBUG_BITMAP)
Added _ma_get_bitmap_description() to request a clear text description of the bitmap.
Simplify _ma_check_bitmap_data(), as we know the bitmap pattern in the caller.
storage/maria/ma_blockrec.c:
In delete_head_or_tail(), fixed a bug where we sent wrong information to _ma_bitmap_set() if the directory was full for a page that should be freed.
This fixed LP#700623 (failure in bitmap found during recovery)
storage/maria/ma_blockrec.h:
Added definitions for _ma_get_bitmap_description() and bits_to_txt
storage/maria/ma_check.c:
Simplify call to _ma_check_bitmap_data().
Write more information if we find something wrong with the bitmap.
Moved getting clear text information about the bitmap to ma_bitmap.c::_ma_get_bitmap_description()
storage/maria/ma_checkpoint.c:
More asserts
storage/maria/ma_create.c:
Fix wrong create_rename_lsn during repair.
(Create_rename_lsn can be too big if someone restores an old maria_log_file after an Aria file was created)
storage/maria/ma_delete.c:
Call _ma_set_fatal_error() in case of crashed file
Remove not needed test of save_errno == HA_ERR_KEY_NOT_FOUND. (Handled by other code
storage/maria/ma_extra.c:
Call _ma_set_fatal_error() in case of crashed file
Reset share->bitmap.changed_not_flushed to not cause new ASSERTS to trigger.
Added _ma_file_callback_to_id() for writing share->id to log file in case of DEBUG logging.
storage/maria/ma_init.c:
Destroy also translog if it's readonly (as when called by maria_read_log -d)
storage/maria/ma_key.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/ma_key_recover.c:
STATE_CRASHED -> STATE_CRASHED_FLAGS
storage/maria/ma_keycache.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/ma_locking.c:
Call _ma_set_fatal_error() in case of crashed file.
Added _ma_set_fatal_error()
storage/maria/ma_open.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/ma_page.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/ma_pagecache.c:
Added extra information to log file to simply debugging of bitmap errors.
storage/maria/ma_pagecache.h:
Added extra_debug flag to allow marking of row and index cache for extra logging (for debugging).
storage/maria/ma_panic.c:
Flush both data and index blocks in case of HA_PANIC_CLOSE
Fixed wrong position of 'break'. (Not critical for MariaDB as MariaDB never uses this code)
storage/maria/ma_recovery_util.c:
Avoid writing extra not needed \n to DBUG log.
storage/maria/ma_rkey.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/ma_search.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/ma_static.c:
Define maria_assert_if_crashed_table
storage/maria/ma_update.c:
Call _ma_set_fatal_error() in case of crashed file.
The new code also avoids a problem where we before would print the error twice.
storage/maria/ma_write.c:
Call _ma_set_fatal_error() in case of crashed file
storage/maria/maria_chk.c:
STATE_CRASHED -> STATE_CRASHED_FLAGS
storage/maria/maria_def.h:
Added STATE_CRASHED_PRINTED to avoid giving error message about crash twice.
Added STATE_CRASHED_FLAGS to be able to easily detect and set all CRASHED related flags.
Added prototypes for new functions.
storage/myisam/mi_panic.c:
Fixed wrong position of 'break'. (Not critical for MariaDB as MariaDB never uses this code)
- Added test case for Aria
- Tested HANDLER with HEAP (changes to HEAP code will be pushed in 5.3)
- Moved all HANDLER test to suite/handler.
mysql-test/Makefile.am:
Added suite/handler
mysql-test/mysql-test-run.pl:
Added suite/handler
mysql-test/r/lock_multi.result:
Remove test that is already in handler test suite
mysql-test/suite/handler/aria.result:
Test for HANDLER with Aria storage engine
mysql-test/suite/handler/aria.test:
Test for HANDLER with Aria storage engine
mysql-test/suite/handler/handler.inc:
Extended the general handler test
Moved interface testing to 'interface.test'
mysql-test/suite/handler/init.inc:
Common init for handler tests.
mysql-test/suite/handler/innodb.result:
New results
mysql-test/suite/handler/innodb.test:
Update to use new include files
mysql-test/suite/handler/interface.result:
Test of HANDLER interface (not storage engine dependent parts)
mysql-test/suite/handler/interface.test:
Test of HANDLER interface (not storage engine dependent parts)
mysql-test/suite/handler/myisam.result:
New results
mysql-test/suite/handler/myisam.test:
Update to use new include files
mysql-test/t/lock_multi.test:
Remove test that is already in handler test suite
mysys/tree.c:
Added missing handling of read previous (showed up in HEAP testing)
sql/handler.cc:
Don't marka 'HA_ERR_RECORD_CHANGED' as fatal (can be used with HANDLER READ, especially with MEMORY ENGINE)
sql/handler.h:
Added prototype for can_continue_handler_scan()
sql/sql_handler.cc:
Re-initialize search if we switch from key to table search.
Check if handler can continue searching between calls (via can_continue_handler_scan())
Don't write common not fatal errors to log
storage/maria/ma_extra.c:
Don't set index 0 as default. This forces call to ma_check_index() to set up index variables.
storage/maria/ma_ft_boolean_search.c:
Ensure that info->last_key.keyinfo is set
storage/maria/ma_open.c:
Don't set index 0 as default. This forces call to ma_check_index() to set up index variables.
storage/maria/ma_rkey.c:
Trivial optimization
storage/maria/ma_rnext.c:
Added missing code from mi_rnext.c to ensure that handler next/prev works.
storage/maria/ma_rsame.c:
Simple optimizations
storage/maria/ma_search.c:
Initialize info->last_key once and for all when we change keys.
storage/maria/ma_unique.c:
Ensure that info->last_key.keyinfo is up to date.
myisam-recover options changed from OFF to 'DEFAULT' to get less change of data loss when using MyISAM.
(The disadvantage is that changed MyISAM tables will be checked at access time; Use --myisam-recover=OFF for old behavior)
Don't call extra(HA_EXTRA_FORCE_REOPEN) in ALTER TABLE if table is locked as this will mark table as crashed!
Added assert to detect if we accidently would use MyISAM versioning in MySQL
include/my_base.h:
Mark NOT_USED as USED, as we now use this as a flag to not call extra()
mysql-test/mysql-test-run.pl:
Don't write all options when there is something wrong with the arguments
mysql-test/r/sp-destruct.result:
Add missing flush of mysql.proc (as the test copied live tables)
mysql-test/r/variables.result:
myisam-recover options changed to 'default'
mysql-test/r/view.result:
Don't show create time in result
mysql-test/suite/maria/t/maria-recovery2-master.opt:
Don't run test with myisam-recover (as this produces extra warnings during simulated death)
mysql-test/t/sp-destruct.test:
Add missing flush of mysql.proc (as the test copied live tables)
mysql-test/t/view.test:
Don't show create time in result
sql/lock.cc:
Added marker if table was deleted to argument list
sql/mysql_priv.h:
Added marker if table was deleted to argument list
sql/mysqld.cc:
myisam-recover options changed from OFF to 'DEFAULT' to get less change of data loss when using MyISAM
Allow one to specify OFF as argument to myisam-recover (was default before but one couldn't specify it)
sql/sql_base.cc:
Mark if table is going to be deleted
sql/sql_delete.cc:
Mark if table is going to be deleted
sql/sql_table.cc:
Mark if table is going to be deleted
Don't call extra(HA_EXTRA_FORCE_REOPEN) in ALTER TABLE if table is locked as this will mark table as crashed!
sql/table.cc:
Signal to handler if table is getting deleted as part of getting droped from table cache.
sql/table.h:
Added marker if table is going to be deleted.
storage/maria/ha_maria.cc:
Don't search for transaction handler if file is not transactional or outside of transaction
(Fixed possible core dump)
storage/maria/ma_blockrec.c:
Don't write changed information if table is going to be deleted.
storage/maria/ma_close.c:
Don't write changed information if table is going to be deleted.
storage/maria/ma_extra.c:
Mark tables that are deleted as crased, to ensure good behavior on restart if we suddenly crash.
storage/maria/ma_locking.c:
Cleanup
storage/maria/ma_recovery.c:
We need trnman to be inited during redo phase (to be able to open tables checked with maria_chk)
storage/maria/maria_def.h:
Added marker if table is going to be deleted.
storage/myisam/mi_close.c:
Don't write changed information if table is going to be deleted.
storage/myisam/mi_extra.c:
Mark tables that are deleted as crased, to ensure good behavior on restart if we suddenly crash.
storage/myisam/mi_open.c:
Added assert to detect if we accidently would use MyISAM versioning in MySQL
storage/myisam/myisamdef.h:
Added marker if table is going to be deleted.
WL#2474 "Multi Range Read: Change the default MRR implementation to implement new MRR interface"
WL#2475 "Batched range read functions for MyISAM/InnoDb"
"Index condition pushdown for MyISAM/InnoDB"
Igor's fix from sp1r-igor@olga.mysql.com-20080330055902-07614:
There could be observed the following problems:
1. EXPLAIN did not mention pushdown conditions from on expressions in the
'extra' column. As a result if a query had no where conditions pushed
down to a table, but had on conditions pushed to this table the 'extra'
column in the EXPLAIN for the table missed 'using where'.
2. Conditions for ref access were not eliminated from on expressions
though such conditions were eliminated from the where condition.
Don't call _mi_decrement_open_count() for mi_extra(HA_EXTRA_PREPARE_FOR_DROP).
This ensures that if we empty the key cache and a drop table fails later, the index will be automaticly rebuilt
storage/maria/ma_extra.c:
Don't call _ma_decrement_open_count() for ma_extra(HA_EXTRA_PREPARE_FOR_DROP).
This ensures that if we empty the key cache and a drop table fails later, the index will be automaticly rebuilt
storage/maria/ma_locking.c:
Simple optimization: Don't call maria_lock_database() if locking is disabled
storage/myisam/mi_extra.c:
Don't call _mi_decrement_open_count() for mi_extra(HA_EXTRA_PREPARE_FOR_DROP).
Simplify code to remove if
mysql-test/t/variables.test:
Reset delay_key_write, otherwise maria.maria test may fail
sql/set_var.cc:
Reset ha_open_options if one resets the delay_key_write variable.
Before there was no way to reset it without restarting mysqld, which caused some tests to fail