mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Added MARIA_PAGE structure to keep all information about a maria key page.
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 commit is contained in:
parent
dd406c1e7e
commit
d6bdf03375
19 changed files with 1483 additions and 1345 deletions
|
|
@ -49,8 +49,8 @@ my_bool _ma_write_clr(MARIA_HA *info, LSN undo_lsn,
|
|||
int _ma_write_undo_key_insert(MARIA_HA *info, const MARIA_KEY *key,
|
||||
my_off_t *root, my_off_t new_root,
|
||||
LSN *res_lsn);
|
||||
int _ma_write_undo_key_delete(MARIA_HA *info, const MARIA_KEY *key,
|
||||
my_off_t new_root, LSN *res_lsn);
|
||||
my_bool _ma_write_undo_key_delete(MARIA_HA *info, const MARIA_KEY *key,
|
||||
my_off_t new_root, LSN *res_lsn);
|
||||
my_bool write_hook_for_clr_end(enum translog_record_type type,
|
||||
TRN *trn, MARIA_HA *tbl_info, LSN *lsn,
|
||||
void *hook_arg);
|
||||
|
|
@ -65,23 +65,16 @@ extern my_bool write_hook_for_undo_key_delete(enum translog_record_type type,
|
|||
LSN *lsn, void *hook_arg);
|
||||
void _ma_unpin_all_pages(MARIA_HA *info, LSN undo_lsn);
|
||||
|
||||
my_bool _ma_log_prefix(MARIA_HA *info, my_off_t page,
|
||||
uchar *buff, uint changed_length,
|
||||
int move_length);
|
||||
my_bool _ma_log_suffix(MARIA_HA *info, my_off_t page,
|
||||
uchar *buff, uint org_length,
|
||||
my_bool _ma_log_prefix(MARIA_PAGE *page, uint changed_length, int move_length);
|
||||
my_bool _ma_log_suffix(MARIA_PAGE *page, uint org_length,
|
||||
uint new_length);
|
||||
my_bool _ma_log_add(MARIA_HA *info, my_off_t page, uchar *buff,
|
||||
uint buff_length, uchar *key_pos,
|
||||
my_bool _ma_log_add(MARIA_PAGE *page, uint buff_length, uchar *key_pos,
|
||||
uint changed_length, int move_length,
|
||||
my_bool handle_overflow);
|
||||
my_bool _ma_log_delete(MARIA_HA *info, my_off_t page, const uchar *buff,
|
||||
const uchar *key_pos, uint changed_length,
|
||||
uint move_length);
|
||||
my_bool _ma_log_change(MARIA_HA *info, my_off_t page, const uchar *buff,
|
||||
const uchar *key_pos, uint length);
|
||||
my_bool _ma_log_new(MARIA_HA *info, my_off_t page, const uchar *buff,
|
||||
uint page_length, uint key_nr, my_bool root_page);
|
||||
my_bool _ma_log_delete(MARIA_PAGE *page, const uchar *key_pos,
|
||||
uint changed_length, uint move_length);
|
||||
my_bool _ma_log_change(MARIA_PAGE *page, const uchar *key_pos, uint length);
|
||||
my_bool _ma_log_new(MARIA_PAGE *page, my_bool root_page);
|
||||
|
||||
uint _ma_apply_redo_index_new_page(MARIA_HA *info, LSN lsn,
|
||||
const uchar *header, uint length);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue