mariadb/storage/myisam
Michael Widenius 6db663d614 Fixes for Aria storage engine:
- 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
2011-02-10 20:33:51 +02:00
..
ftbench
.cvsignore
ChangeLog
CMakeLists.txt Bug#473914: mysql_client_test fail with in debug compilaton on windows x64 2010-12-06 12:52:06 +01:00
ft_boolean_search.c Merge MySQL 5.1.46 into MariaDB. 2010-04-28 14:52:24 +02:00
ft_eval.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
ft_eval.h
ft_myisam.c Fixed some compiler warnings and errors in test suite found by buildbot 2010-01-27 23:53:08 +02:00
ft_nlq_search.c Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
ft_parser.c Fixed compiler warnings & failing test cases 2010-01-28 16:49:14 +02:00
ft_static.c Merge mysql.com:/home/my/mysql-5.1 2008-04-28 19:24:05 +03:00
ft_stem.c
ft_stopwords.c Fixed compiler warnings and sporadic failures in test cases 2010-03-28 21:10:00 +03:00
ft_test1.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
ft_test1.h
ft_update.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
ftdefs.h Fixed some compiler warnings and errors in test suite found by buildbot 2010-01-27 23:53:08 +02:00
fulltext.h Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
ha_myisam.cc Fixes for Aria storage engine: 2011-02-10 20:33:51 +02:00
ha_myisam.h Added option BACKUP_ALL to mysqld --myisam-recover to also get a backup of the index file before it's repaired. 2010-11-07 14:25:29 +02:00
make-ccc
Makefile.am Fixed compiler and gmake warnings 2010-11-29 11:27:52 +02:00
mi_cache.c Added error HA_ERR_FILE_TOO_SHORT to be used when files are shorter than expected (by my_read/my_pread) 2007-12-04 23:23:42 +02:00
mi_changed.c
mi_check.c Added option BACKUP_ALL to mysqld --myisam-recover to also get a backup of the index file before it's repaired. 2010-11-07 14:25:29 +02:00
mi_checksum.c First part of redo/undo for key pages 2007-11-14 19:08:06 +02:00
mi_close.c Fix myisam_crash_before_flush_keys on Windows 2010-12-07 00:10:09 +01:00
mi_create.c Fix myisam checksum patch to check for HA_OPTION_CHECKSUM after it was set, not before 2010-03-12 20:03:37 +01:00
mi_dbug.c #endif fixed. 2010-11-02 21:01:25 +02:00
mi_delete.c Merge MySQL 5.1.39 into MariaDB 5.1. 2009-10-15 23:38:29 +02:00
mi_delete_all.c BUG#51868 - crash with myisam_use_mmap and partitioned 2010-03-22 16:30:27 +04:00
mi_delete_table.c BUG#40980 - Drop table can remove another MyISAM table's 2010-04-01 18:49:02 +04:00
mi_dynrec.c Merge with MySQL 5.1.50 2010-08-27 17:12:44 +03:00
mi_extra.c Fix for: LP #634955: Assert in _ma_update_at_original_place() 2010-11-02 17:22:57 +02:00
mi_info.c
mi_key.c Merge hynda.mysql.fi:/home/my/mysql-5.1-main 2007-09-27 17:05:07 +03:00
mi_keycache.c
mi_locking.c Fixed compiler & valgrind warnings from my previous push. 2010-11-03 14:14:02 +02:00
mi_log.c Merge hynda.mysql.fi:/home/my/mysql-5.1-main 2007-09-27 17:05:07 +03:00
mi_open.c Fix LP Bug#686184 - merge_debug test fails. 2010-12-06 22:34:50 +01:00
mi_packrec.c Merge MySQL 5.1.44 into MariaDB. 2010-03-04 09:03:07 +01:00
mi_page.c Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
mi_panic.c Aria issues: 2011-01-24 15:19:40 +02:00
mi_preload.c
mi_range.c Merge with MySQL 5.1.52 2010-11-23 23:39:59 +02:00
mi_rename.c
mi_rfirst.c
mi_rkey.c Merge hynda.mysql.fi:/home/my/mysql-5.1-main 2007-09-27 17:05:07 +03:00
mi_rlast.c
mi_rnext.c BUG#51877 - HANDLER interface causes invalid memory read 2010-03-25 15:49:01 +04:00
mi_rnext_same.c
mi_rprev.c
mi_rrnd.c
mi_rsame.c
mi_rsamepos.c
mi_scan.c
mi_search.c Merge with MySQL 5.1.52 2010-11-23 23:39:59 +02:00
mi_static.c merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-12-24 12:04:31 +05:30
mi_statrec.c
mi_test1.c Merge with MySQL 5.1.49 2010-08-02 12:01:24 +03:00
mi_test2.c Merge with MySQL 5.1.50 2010-08-27 17:12:44 +03:00
mi_test3.c Removed compiler warnings 2010-01-06 23:27:53 +02:00
mi_test_all.res
mi_test_all.sh
mi_unique.c Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
mi_update.c Merge MySQL 5.1.39 into MariaDB 5.1. 2009-10-15 23:38:29 +02:00
mi_write.c Merge MySQL 5.1.46 into MariaDB. 2010-04-28 14:52:24 +02:00
myisam_ftdump.c Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
myisamchk.c Added option BACKUP_ALL to mysqld --myisam-recover to also get a backup of the index file before it's repaired. 2010-11-07 14:25:29 +02:00
myisamdef.h Fix for: LP #634955: Assert in _ma_update_at_original_place() 2010-11-02 17:22:57 +02:00
myisamlog.c Merge with MySQL 5.1.49 2010-08-02 12:01:24 +03:00
myisampack.c Added option BACKUP_ALL to mysqld --myisam-recover to also get a backup of the index file before it's repaired. 2010-11-07 14:25:29 +02:00
NEWS
plug.in MWL#74: Shared libmysqld.so library. 2010-11-17 13:24:20 +01:00
rt_index.c Merge with MySQL 5.1.52 2010-11-23 23:39:59 +02:00
rt_index.h
rt_key.c
rt_key.h
rt_mbr.c Merge mysql.com:/home/hf/work/30286/my50-30286 2007-10-05 15:43:15 +05:00
rt_mbr.h
rt_split.c Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-09-24 19:13:51 -03:00
rt_test.c Fix for Valgrind errors when running rt_test and ma_rt_test, and segmentation fault 2008-06-10 15:44:41 +02:00
sort.c Merge MySQL 5.1.46 into MariaDB. 2010-04-28 14:52:24 +02:00
sp_defs.h
sp_key.c
sp_test.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
test_pack
TODO