mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed several bugs found by running *.test with maria engine
Renamed HA_EXTRA_PREAPRE_FOR_DELETE to HA_EXTRA_PERPARE_FOR_DROP Added HA_EXTRA_PREPARE_FOR_RENAME (as we in the code before used HA_EXTRA_PREPARE_FOR_DELETE also for renames which confused things) Allow multiple write locks for same page by same file handle Don't write table state if table is not changed include/my_base.h: Renamed HA_EXTRA_PREAPRE_FOR_DELETE to HA_EXTRA_PERPARE_FOR_DROP Added HA_EXTRA_PREPARE_FOR_RENAME (as we in the code before used HA_EXTRA_PREPARE_FOR_DELETE also for renames which confused things) mysql-test/r/maria.result: More tests of things that failed in other tests mysql-test/t/maria.test: More tests of things that failed in other tests sql/ha_partition.cc: HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP Use HA_EXTRA_PREPARE_FOR_RENAME for renames sql/ha_partition.h: HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP Use HA_EXTRA_PREPARE_FOR_RENAME for renames sql/lock.cc: Fixed comment sql/sql_table.cc: Fixed wrong usage of HA_EXTRA_PREAPRE_FOR_DELETE storage/maria/ha_maria.cc: Added missing _ma_renable_logging_for_table() (When using with ALTER TABLE + repair index) Enabled fast generation of index storage/maria/ma_bitmap.c: Fixed bug when resetting full pages when page was a tail page storage/maria/ma_blockrec.c: Fixed several bugs found by running *.test with maria engine: During update we keep old changed pages locked with a write lock to be able to reuse them. - Fixed bug with allocated but not used tail part - Fixed bug with blob that only had tail part - Fixed bug when update reused a page (needed multiple write locks for same page) - Fixed bug when first extent was a tail block storage/maria/ma_check.c: Better error message when bitmap is destroyed storage/maria/ma_close.c: Only write status if file was changed. Fixed bug when maria_chk -e file_name changed the file. storage/maria/ma_dynrec.c: Removed not used argument to _ma_state_info_read_dsk storage/maria/ma_extra.c: HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP Use HA_EXTRA_PREPARE_FOR_RENAME for renames Only ignore flushing of pages for DROP (not rename) storage/maria/ma_locking.c: Removed not used argument to _ma_state_info_read_dsk storage/maria/ma_open.c: Removed not used argument to _ma_state_info_read_dsk storage/maria/ma_pagecache.c: Allow multiple write locks for same page by same file handle (Not yet complete, Sanja will fix) storage/maria/ma_recovery.c: HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP storage/maria/maria_def.h: Removed not used argument to _ma_state_info_read_dsk storage/myisam/mi_extra.c: HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP Use HA_EXTRA_PREPARE_FOR_RENAME for renames Only ignore flushing of pages for DROP (not rename) storage/myisammrg/ha_myisammrg.cc: HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP Use HA_EXTRA_PREPARE_FOR_RENAME for renames
This commit is contained in:
@ -3694,8 +3694,9 @@ mysql_rename_table(handlerton *base, const char *old_db,
|
||||
wait_while_table_is_used()
|
||||
thd Thread handler
|
||||
table Table to remove from cache
|
||||
function HA_EXTRA_PREPARE_FOR_DELETE if table is to be deleted
|
||||
function HA_EXTRA_PREPARE_FOR_DROP if table is to be deleted
|
||||
HA_EXTRA_FORCE_REOPEN if table is not be used
|
||||
HA_EXTRA_PREPARE_FOR_REANME if table is to be renamed
|
||||
NOTES
|
||||
When returning, the table will be unusable for other threads until
|
||||
the table is closed.
|
||||
@ -3745,7 +3746,7 @@ void close_cached_table(THD *thd, TABLE *table)
|
||||
{
|
||||
DBUG_ENTER("close_cached_table");
|
||||
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_DELETE);
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
|
||||
/* Close lock if this is not got with LOCK TABLES */
|
||||
if (thd->lock)
|
||||
{
|
||||
@ -6532,7 +6533,7 @@ view_err:
|
||||
if (lower_case_table_names)
|
||||
my_casedn_str(files_charset_info, old_name);
|
||||
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_DELETE);
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME);
|
||||
close_data_files_and_morph_locks(thd, db, table_name);
|
||||
|
||||
error=0;
|
||||
|
Reference in New Issue
Block a user