summaryrefslogtreecommitdiff
path: root/include/maria.h
diff options
context:
space:
mode:
authorunknown <monty@mysql.com/narttu.mysql.fi>2007-10-09 21:09:50 +0300
committerunknown <monty@mysql.com/narttu.mysql.fi>2007-10-09 21:09:50 +0300
commit496741d5761f14dba39c7cfd01c31bcc0fe810b1 (patch)
tree4d91944237ccddf915e51bf77eac8aad2cf2353f /include/maria.h
parentd097806323618aef56bcfb1968b036be2aa8491a (diff)
downloadmariadb-git-496741d5761f14dba39c7cfd01c31bcc0fe810b1.tar.gz
Moved randomize and my_rnd under mysys
Added my_uuid Added pre-support for PAGE_CHECKSUM Added syntax for CREATE ... PAGE_CHECKSUM=# TABLE_CHECKSUM=# Reserved place for page checksums on index, bitmap and block pages Added index number to header of index pages Added linked list for free directory entries (speeds up inserts with BLOCK format) Calculate checksums in original column order (fixes bug with checksum on rows with BLOCK format) Cleaned up all index handling to use 'info->s->keypage_header' (variable size) as the header for index pages (before this was '2') Added 0xffffffff to end of index and block data bases and 0xfffffffe at end of bitmap pages when page checksums are not enabled Added _ma_get_page_used() and _ma_get_used_and_node() to simplify index page header handling rec_per_key_part is now in double precision Reserved place in index file for my_guid and nulls_per_key_part Give error HA_ERR_NEW_FILE if trying to open a Maria file with new, not yet supported extensions Lots of renames to increase readability: randomize() -> my_rnd_init() st_maria_info -> st_maria_handler st_maria_info -> MARIA_HA st_maria_isaminfo -> st_maria_info rand_struct -> my_rand_struct rec_per_key_rows -> records_at_analyze client/mysqladmin.cc: rand_struct -> my_rrnd_struct include/maria.h: st_maria_info -> MARIA_HA st_maria_isaminfo -> st_maria_info Changed analyze statistics to be of double precission Changed offset to field to be 32bits instead of 64 (safe as a record without blobs can't be that big) include/my_base.h: Added HA_OPTION_PAGE_CHECKSUM & HA_CREATE_PAGE_CHECKSUM Fixed comments Added HA_ERR_NEW_FILE include/my_sys.h: Added prototypes and structures for my_uuid() and my_rnd() include/myisamchk.h: Changed some buffers to size_t Added possibility to have key statistics with double precission include/mysql_com.h: Move rand functions to mysys libmysql/Makefile.shared: Added my_rnd mysql-test/r/maria.result: Updated results mysql-test/t/maria.test: More tests for checksum mysys/Makefile.am: Added my_rnd.c and my_uuid.c server-tools/instance-manager/listener.cc: Fixed include order (my_global.h should always be first) server-tools/instance-manager/mysql_connection.cc: Fixed include order (my_global.h should always be first) Use my_rnd_init() server-tools/instance-manager/mysql_connection.h: rand_struct -> my_rand_struct sql/handler.h: Added flag for page checksums sql/item_func.cc: Use new my_rnd() interface sql/item_func.h: Use new my_rnd() interface sql/item_strfunc.cc: Use new my_rnd() interface sql/lex.h: Added PAGE_CHECKSUM and TABLE_CHECKSUM sql/mysql_priv.h: Use new my_rnd() interface sql/mysqld.cc: Use new my_rnd() interface sql/password.c: Move my_rnd() to mysys Use new my_rnd() interface sql/sql_class.cc: Use new my_rnd() interface sql/sql_class.h: Use new my_rnd() interface sql/sql_crypt.cc: Use new my_rnd() interface sql/sql_crypt.h: Use new my_rnd() interface sql/sql_show.cc: Simpler handling of ha_choice_values Added PAGE_CHECKSUM sql/sql_table.cc: Enable correct checksum handling (for now) if not running in compatible mode sql/sql_yacc.yy: Added table option PAGE_CHECKSUM Added future compatible table option TABLE_CHECKSUM (alias for CHECKSUM) Added 'choice' target to simplify code sql/table.cc: Store flag for PAGE_CHECKSUM sql/table.h: Added support for PAGE_CHECKSUM storage/maria/ha_maria.cc: Remove protection for incompatbile frm and MAI (Slow, not needed test) Rec_per_key is now in double Remember row type for table Give warning if one Maria uses another row type than requested Removed some old ASK_MONTY entries (added comments instead) Added handling of PAGE_CHECKSUM flags storage/maria/ma_bitmap.c: Added page checksums to bitmap pages Added special bitmap marker for bitmap pages (Used to find bugs when running without page checksums) storage/maria/ma_blockrec.c: Added a free-link list over directory entries. This makes insert of small rows faster as we don't have to scan the whole directory to find a not used entry. Moved SANITY_CHECKS to maria_def.h Simplify code by introducing dir_entry_pos() Added support for PAGE_CHECKSUM storage/maria/ma_blockrec.h: Added DIR_FREE_SIZE (linked list of free directory entries) Added PAGE_CHECKSUM Added 'dir_entry_pos()' storage/maria/ma_check.c: Check that index pages has correct index number Calculate rec_per_key with double precission Simplify code by using '_ma_get_used_and_node()' Check free directory list Remove wrong end \n from messages maria_data_on_page() -> _ma_get_page_used() maria_putint() -> _ma_store_page_used() rec_per_key_rows -> records_at_analyze storage/maria/ma_checksum.c: Calculate checksum in original column order storage/maria/ma_create.c: Store original column order in index file Reserve place for nulls_per_key_part (future) Added support for PAGE_CHECKSUM storage/maria/ma_dbug.c: Fixed wrong debug output of key of type 'ulong' storage/maria/ma_delete.c: maria_data_on_page() -> _ma_get_used_and_node() maria_data_on_page() -> _ma_get_page_used() maria_putint() -> _ma_store_page_used() Added page header (index key number) to all index pages Reserved page for checksum on index pages Use keypage_header storage/maria/ma_ft_update.c: maria_putint() -> _ma_store_page_used() Store key number at start of page storage/maria/ma_loghandler.h: st_maria_info -> MARIA_HA storage/maria/ma_open.c: rec_per_key is now in double precission Added 'nulls_per_key_part' Added 'extra_options' (flags for future) Added support for PAGE_CHECKSUM Give error HA_ERR_NEW_FILE when using unsupported maria extensions Added comments Add maria_uuid to index file Added functions to store and read column_nr map. Changed some functions to return my_bool instead of uint storage/maria/ma_page.c: Added checks that pages has correct key nr Store 0xffffffff in checksum position if page checksums are not enabled Moved key-page-delete link to take into account keypage header storage/maria/ma_preload.c: Remove old MyISAM dependent code When scanning pages, only add pages to page cache for the requested index storage/maria/ma_range.c: maria_data_on_page() -> _ma_get_used_and_node() Use keypage_header storage/maria/ma_rt_index.c: Fixed indentation storage/maria/ma_rt_index.h: Added support for dynamic index page header Reserved place for PAGE_CHECKSUM storage/maria/ma_rt_key.c: Fixed indentation maria_data_on_page() -> _ma_get_page_used() maria_putint() -> maria_store_page_used() storage/maria/ma_rt_mbr.c: Fixed indentation storage/maria/ma_rt_split.c: Fixed indentation maria_data_on_page () -> _ma_get_page_used() storage/maria/ma_rt_test.c: Fixed indentation storage/maria/ma_search.c: Remove support of using -1 as 'last used index' to _ma_check_index() maria_data_on_page() -> _ma_get_page_used() maria_data_on_page() -> _ma_get_used_and_node() Use keypage_header storage/maria/ma_sort.c: Changed some buffers to size_t Changed rec_per_key_part to double storage/maria/ma_static.c: Removed NEAR Added maria_uuid storage/maria/ma_test2.c: Moevd testflag == 2 to correct place Remove test of reading with index number -1 (not supported anymore) storage/maria/ma_test_recovery.expected: Updated results storage/maria/ma_test_recovery: Changed tmp table names so that one can run maria_chk on them storage/maria/ma_write.c: Fixed indentation Use keypage_header Store index number on index pages maria_putint() -> _ma_store_page_used() maria_data_on_page() -> ma_get_used_and_node() maria_data_on_page() -> _ma_get_page_used() Added PAGE_CHECKSUM Added Maria handler to some functions Removed some not needed casts storage/maria/maria_chk.c: Added error handling for HA_ERR_NEW_FILE Added information about page checksums rec_per_key_part changed to double maria_data_on_page() -> _ma_get_page_used() Use keypage_header storage/maria/maria_def.h: Added IDENTICAL_PAGES_AFTER_RECOVERY and SANITY_CHECKS Changed rec_per_key_part to double Added nulls_per_key_part rec_per_key_rows -> records_at_analyze st_maria_info -> MARIA_HA Reserve place for new statistics variables, uuid, checksums per page etc. Removed NEAR tags Changed some prototypes to use my_bool and size_t storage/maria/maria_pack.c: st_maria_info -> MARIA_HA Fixed indentation storage/myisam/mi_dbug.c: Fix wrong debug output for ULONG mysys/my_rnd.c: New BitKeeper file ``mysys/my_rnd.c'' mysys/my_uuid.c: New BitKeeper file ``mysys/my_uuid.c''
Diffstat (limited to 'include/maria.h')
-rw-r--r--include/maria.h75
1 files changed, 38 insertions, 37 deletions
diff --git a/include/maria.h b/include/maria.h
index 1d7778f7c3d..49259915d16 100644
--- a/include/maria.h
+++ b/include/maria.h
@@ -110,7 +110,7 @@ extern "C" {
typedef ulonglong MARIA_RECORD_POS;
-typedef struct st_maria_isaminfo /* Struct from h_info */
+typedef struct st_maria_info
{
ha_rows records; /* Records in database */
ha_rows deleted; /* Deleted records in database */
@@ -126,7 +126,7 @@ typedef struct st_maria_isaminfo /* Struct from h_info */
time_t check_time;
time_t update_time;
ulong record_offset;
- ulong *rec_per_key; /* for sql optimizing */
+ double *rec_per_key; /* for sql optimizing */
ulong reclength; /* Recordlength */
ulong mean_reclength; /* Mean recordlength (if packed) */
char *data_file_name, *index_file_name;
@@ -156,9 +156,9 @@ typedef struct st_maria_create_info
my_bool with_auto_increment, transactional;
} MARIA_CREATE_INFO;
-struct st_maria_info; /* For referense */
struct st_maria_share;
-typedef struct st_maria_info MARIA_HA;
+struct st_maria_handler; /* For referense */
+typedef struct st_maria_handler MARIA_HA;
struct st_maria_s_param;
typedef struct st_maria_keydef /* Key definition with open & info */
@@ -178,7 +178,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)(struct st_maria_info *info,
+ int (*bin_search)(MARIA_HA *info,
struct st_maria_keydef *keyinfo, uchar *page, uchar *key,
uint key_len, uint comp_flag, uchar **ret_pos,
uchar *buff, my_bool *was_last_key);
@@ -189,8 +189,8 @@ typedef struct st_maria_keydef /* Key definition with open & info */
const uchar *key, struct st_maria_s_param *s_temp);
void (*store_key)(struct st_maria_keydef *keyinfo, uchar *key_pos,
struct st_maria_s_param *s_temp);
- int (*ck_insert)(struct st_maria_info *inf, uint k_nr, uchar *k, uint klen);
- int (*ck_delete)(struct st_maria_info *inf, uint k_nr, uchar *k, uint klen);
+ int (*ck_insert)(MARIA_HA *inf, uint k_nr, uchar *k, uint klen);
+ int (*ck_delete)(MARIA_HA *inf, uint k_nr, uchar *k, uint klen);
} MARIA_KEYDEF;
@@ -222,9 +222,10 @@ struct st_maria_bit_buff;
typedef struct st_maria_columndef /* column information */
{
- uint64 offset; /* Offset to position in row */
enum en_fieldtype type;
+ uint32 offset; /* Offset to position in row */
uint16 length; /* length of field */
+ uint16 column_nr;
/* Intern variable (size of total storage area for the row) */
uint16 fill_length;
uint16 null_pos; /* Position for null marker */
@@ -257,34 +258,34 @@ extern PAGECACHE maria_pagecache_var, *maria_pagecache;
extern int maria_init(void);
extern void maria_end(void);
-extern int maria_close(struct st_maria_info *file);
-extern int maria_delete(struct st_maria_info *file, const uchar *buff);
-extern struct st_maria_info *maria_open(const char *name, int mode,
+extern int maria_close(MARIA_HA *file);
+extern int maria_delete(MARIA_HA *file, const uchar *buff);
+extern MARIA_HA *maria_open(const char *name, int mode,
uint wait_if_locked);
-extern struct st_maria_info *maria_clone(struct st_maria_share *share, int mode);
+extern MARIA_HA *maria_clone(struct st_maria_share *share, int mode);
extern int maria_panic(enum ha_panic_function function);
-extern int maria_rfirst(struct st_maria_info *file, uchar *buf, int inx);
-extern int maria_rkey(struct st_maria_info *file, uchar *buf, int inx,
+extern int maria_rfirst(MARIA_HA *file, uchar *buf, int inx);
+extern int maria_rkey(MARIA_HA *file, uchar *buf, int inx,
const uchar *key, key_part_map keypart_map,
enum ha_rkey_function search_flag);
-extern int maria_rlast(struct st_maria_info *file, uchar *buf, int inx);
-extern int maria_rnext(struct st_maria_info *file, uchar *buf, int inx);
-extern int maria_rnext_same(struct st_maria_info *info, uchar *buf);
-extern int maria_rprev(struct st_maria_info *file, uchar *buf, int inx);
-extern int maria_rrnd(struct st_maria_info *file, uchar *buf,
+extern int maria_rlast(MARIA_HA *file, uchar *buf, int inx);
+extern int maria_rnext(MARIA_HA *file, uchar *buf, int inx);
+extern int maria_rnext_same(MARIA_HA *info, uchar *buf);
+extern int maria_rprev(MARIA_HA *file, uchar *buf, int inx);
+extern int maria_rrnd(MARIA_HA *file, uchar *buf,
MARIA_RECORD_POS pos);
-extern int maria_scan_init(struct st_maria_info *file);
-extern int maria_scan(struct st_maria_info *file, uchar *buf);
-extern void maria_scan_end(struct st_maria_info *file);
-extern int maria_rsame(struct st_maria_info *file, uchar *record, int inx);
-extern int maria_rsame_with_pos(struct st_maria_info *file, uchar *record,
+extern int maria_scan_init(MARIA_HA *file);
+extern int maria_scan(MARIA_HA *file, uchar *buf);
+extern void maria_scan_end(MARIA_HA *file);
+extern int maria_rsame(MARIA_HA *file, uchar *record, int inx);
+extern int maria_rsame_with_pos(MARIA_HA *file, uchar *record,
int inx, MARIA_RECORD_POS pos);
-extern int maria_update(struct st_maria_info *file, const uchar *old,
+extern int maria_update(MARIA_HA *file, const uchar *old,
uchar *new_record);
-extern int maria_write(struct st_maria_info *file, uchar *buff);
-extern MARIA_RECORD_POS maria_position(struct st_maria_info *file);
-extern int maria_status(struct st_maria_info *info, MARIA_INFO *x, uint flag);
-extern int maria_lock_database(struct st_maria_info *file, int lock_type);
+extern int maria_write(MARIA_HA *file, uchar *buff);
+extern MARIA_RECORD_POS maria_position(MARIA_HA *file);
+extern int maria_status(MARIA_HA *info, MARIA_INFO *x, uint flag);
+extern int maria_lock_database(MARIA_HA *file, int lock_type);
extern int maria_create(const char *name, enum data_file_type record_type,
uint keys, MARIA_KEYDEF *keydef,
uint columns, MARIA_COLUMNDEF *columndef,
@@ -292,16 +293,16 @@ extern int maria_create(const char *name, enum data_file_type record_type,
MARIA_CREATE_INFO *create_info, uint flags);
extern int maria_delete_table(const char *name);
extern int maria_rename(const char *from, const char *to);
-extern int maria_extra(struct st_maria_info *file,
+extern int maria_extra(MARIA_HA *file,
enum ha_extra_function function, void *extra_arg);
-extern int maria_reset(struct st_maria_info *file);
-extern ha_rows maria_records_in_range(struct st_maria_info *info, int inx,
+extern int maria_reset(MARIA_HA *file);
+extern ha_rows maria_records_in_range(MARIA_HA *info, int inx,
key_range *min_key, key_range *max_key);
-extern int maria_is_changed(struct st_maria_info *info);
-extern int maria_delete_all_rows(struct st_maria_info *info);
+extern int maria_is_changed(MARIA_HA *info);
+extern int maria_delete_all_rows(MARIA_HA *info);
extern uint maria_get_pointer_length(ulonglong file_length, uint def);
-extern int maria_commit(struct st_maria_info *info);
-extern int maria_begin(struct st_maria_info *info);
+extern int maria_commit(MARIA_HA *info);
+extern int maria_begin(MARIA_HA *info);
/* this is used to pass to mysql_mariachk_table */
@@ -402,7 +403,7 @@ int maria_change_to_newfile(const char *filename, const char *old_ext,
const char *new_ext, myf myflags);
void maria_lock_memory(HA_CHECK *param);
int maria_update_state_info(HA_CHECK *param, MARIA_HA *info, uint update);
-void maria_update_key_parts(MARIA_KEYDEF *keyinfo, ulong *rec_per_key_part,
+void maria_update_key_parts(MARIA_KEYDEF *keyinfo, double *rec_per_key_part,
ulonglong *unique, ulonglong *notnull,
ulonglong records);
int maria_filecopy(HA_CHECK *param, File to, File from, my_off_t start,