diff options
author | Michael Widenius <monty@mysql.com> | 2008-09-01 20:31:40 +0300 |
---|---|---|
committer | Michael Widenius <monty@mysql.com> | 2008-09-01 20:31:40 +0300 |
commit | d6bdf03375977d89bf66c64b5ce72b67ec35c36d (patch) | |
tree | 274ac5a763b422cba57c20a8bfd15e256183ab7c /include/maria.h | |
parent | dd406c1e7ebeede6506c3f8c1bc62c671ea880a1 (diff) | |
download | mariadb-git-d6bdf03375977d89bf66c64b5ce72b67ec35c36d.tar.gz |
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
Diffstat (limited to 'include/maria.h')
-rw-r--r-- | include/maria.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/maria.h b/include/maria.h index 92f363e673e..0f70e9ce28d 100644 --- a/include/maria.h +++ b/include/maria.h @@ -161,6 +161,7 @@ struct st_maria_handler; /* For referense */ typedef struct st_maria_handler MARIA_HA; struct st_maria_s_param; struct st_maria_keydef; +struct st_maria_page; typedef struct st_maria_key /* Internal info about a key */ { @@ -194,7 +195,7 @@ typedef struct st_maria_keydef /* Key definition with open & info */ HA_KEYSEG *seg, *end; struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */ - int (*bin_search)(const MARIA_KEY *key, uchar *page, + int (*bin_search)(const MARIA_KEY *key, const struct st_maria_page *page, uint32 comp_flag, uchar **ret_pos, uchar *buff, my_bool *was_last_key); uint (*get_key)(MARIA_KEY *key, uint page_flag, uint nod_flag, @@ -207,7 +208,7 @@ typedef struct st_maria_keydef /* Key definition with open & info */ void (*store_key)(struct st_maria_keydef *keyinfo, uchar *key_pos, struct st_maria_s_param *s_temp); my_bool (*ck_insert)(MARIA_HA *inf, MARIA_KEY *key); - int (*ck_delete)(MARIA_HA *inf, MARIA_KEY *klen); + my_bool (*ck_delete)(MARIA_HA *inf, MARIA_KEY *klen); MARIA_KEY *(*make_key)(MARIA_HA *info, MARIA_KEY *int_key, uint keynr, uchar *key, const uchar *record, MARIA_RECORD_POS filepos, ulonglong trid); |