• Michael Widenius's avatar
    Added MARIA_PAGE structure to keep all information about a maria key page. · d6bdf033
    Michael Widenius authored
    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
    d6bdf033
ma_check.c 223 KB