00001 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 00018 #ifdef USE_PRAGMA_INTERFACE 00019 #pragma interface /* gcc class implementation */ 00020 #endif 00021 00022 /* class for the the myisam merge handler */ 00023 00024 #include <myisammrg.h> 00025 00026 class ha_myisammrg: public handler 00027 { 00028 MYRG_INFO *file; 00029 00030 public: 00031 ha_myisammrg(TABLE_SHARE *table_arg); 00032 ~ha_myisammrg() {} 00033 const char *table_type() const { return "MRG_MyISAM"; } 00034 const char **bas_ext() const; 00035 const char *index_type(uint key_number); 00036 ulonglong table_flags() const 00037 { 00038 return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS | 00039 HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED | 00040 HA_CAN_INSERT_DELAYED | HA_ANY_INDEX_MAY_BE_UNIQUE | 00041 HA_CAN_BIT_FIELD | HA_NO_COPY_ON_ALTER); 00042 } 00043 ulong index_flags(uint inx, uint part, bool all_parts) const 00044 { 00045 return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? 00046 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | 00047 HA_READ_ORDER | HA_KEYREAD_ONLY); 00048 } 00049 uint max_supported_keys() const { return MI_MAX_KEY; } 00050 uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; } 00051 uint max_supported_key_part_length() const { return MI_MAX_KEY_LENGTH; } 00052 double scan_time() 00053 { return ulonglong2double(stats.data_file_length) / IO_SIZE + file->tables; } 00054 00055 int open(const char *name, int mode, uint test_if_locked); 00056 int close(void); 00057 int write_row(byte * buf); 00058 int update_row(const byte * old_data, byte * new_data); 00059 int delete_row(const byte * buf); 00060 int index_read(byte * buf, const byte * key, 00061 uint key_len, enum ha_rkey_function find_flag); 00062 int index_read_idx(byte * buf, uint idx, const byte * key, 00063 uint key_len, enum ha_rkey_function find_flag); 00064 int index_read_last(byte * buf, const byte * key, uint key_len); 00065 int index_next(byte * buf); 00066 int index_prev(byte * buf); 00067 int index_first(byte * buf); 00068 int index_last(byte * buf); 00069 int index_next_same(byte *buf, const byte *key, uint keylen); 00070 int rnd_init(bool scan); 00071 int rnd_next(byte *buf); 00072 int rnd_pos(byte * buf, byte *pos); 00073 void position(const byte *record); 00074 ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); 00075 void info(uint); 00076 int reset(void); 00077 int extra(enum ha_extra_function operation); 00078 int extra_opt(enum ha_extra_function operation, ulong cache_size); 00079 int external_lock(THD *thd, int lock_type); 00080 uint lock_count(void) const; 00081 int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info); 00082 THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, 00083 enum thr_lock_type lock_type); 00084 void update_create_info(HA_CREATE_INFO *create_info); 00085 void append_create_info(String *packet); 00086 MYRG_INFO *myrg_info() { return file; } 00087 bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); 00088 };
1.4.7

