summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_myisam.h')
-rw-r--r--sql/ha_myisam.h65
1 files changed, 34 insertions, 31 deletions
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index 212850d8f28..b256d4777f9 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2000,2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
@@ -37,34 +37,34 @@ extern ulong myisam_recover_options;
class ha_myisam: public handler
{
MI_INFO *file;
- uint int_table_flags;
+ ulong int_table_flags;
char *data_file_name, *index_file_name;
- bool enable_activate_all_index;
+ bool can_enable_indexes;
int repair(THD *thd, MI_CHECK &param, bool optimize);
public:
ha_myisam(TABLE *table): handler(table), file(0),
- int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_NULL_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
- HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY |
- HA_FILE_BASED),
- enable_activate_all_index(1)
+ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
+ HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
+ HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME |
+ HA_CAN_INSERT_DELAYED),
+ can_enable_indexes(1)
{}
~ha_myisam() {}
const char *table_type() const { return "MyISAM"; }
const char *index_type(uint key_number);
const char **bas_ext() const;
ulong table_flags() const { return int_table_flags; }
- ulong index_flags(uint inx) const
+ ulong index_flags(uint inx, uint part, bool all_parts) const
{
- ulong flags=(HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER);
- return (flags | ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
- 0 : HA_KEY_READ_ONLY));
+ return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
+ 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
+ HA_READ_ORDER | HA_KEYREAD_ONLY);
}
- uint max_record_length() const { return HA_MAX_REC_LENGTH; }
- uint max_keys() const { return MI_MAX_KEY; }
- uint max_key_parts() const { return MAX_REF_PARTS; }
- uint max_key_length() const { return MI_MAX_KEY_LENGTH; }
+ uint max_supported_keys() const { return MI_MAX_KEY; }
+ uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; }
+ uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; }
+ uint checksum() const;
int open(const char *name, int mode, uint test_if_locked);
int close(void);
@@ -81,7 +81,6 @@ class ha_myisam: public handler
int index_first(byte * buf);
int index_last(byte * buf);
int index_next_same(byte *buf, const byte *key, uint keylen);
- int index_end() { ft_handler=NULL; return 0; }
int ft_init()
{
if (!ft_handler)
@@ -89,29 +88,29 @@ class ha_myisam: public handler
ft_handler->please->reinit_search(ft_handler);
return 0;
}
- FT_INFO *ft_init_ext(uint mode, uint inx,const byte *key, uint keylen,
- bool presort)
- { return ft_init_search(mode, file,inx,(byte*) key,keylen,presort); }
+ FT_INFO *ft_init_ext(uint flags, uint inx,String *key)
+ {
+ return ft_init_search(flags,file,inx,
+ (byte *)key->ptr(), key->length(), key->charset(),
+ table->record[0]);
+ }
int ft_read(byte *buf);
- int rnd_init(bool scan=1);
+ int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
int restart_rnd_next(byte *buf, byte *pos);
void position(const byte *record);
- my_off_t row_position() { return mi_position(file); }
void info(uint);
int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size);
- int reset(void);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
- void deactivate_non_unique_index(ha_rows rows);
- bool activate_all_index(THD *thd);
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ int disable_indexes(uint mode);
+ int enable_indexes(uint mode);
+ int indexes_are_disabled(void);
+ void start_bulk_insert(ha_rows rows);
+ int end_bulk_insert();
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
void update_create_info(HA_CREATE_INFO *create_info);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
@@ -128,6 +127,10 @@ class ha_myisam: public handler
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
int restore(THD* thd, HA_CHECK_OPT* check_opt);
int backup(THD* thd, HA_CHECK_OPT* check_opt);
+ int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt);
+ int preload_keys(THD* thd, HA_CHECK_OPT* check_opt);
+#ifdef HAVE_REPLICATION
int dump(THD* thd, int fd);
int net_read_dump(NET* net);
+#endif
};