Eneboo - Documentación para desarrolladores
|
00001 /* Copyright (C) 2000 MySQL 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 /* This file should be included when using merge_isam_funktions */ 00018 /* Author: Michael Widenius */ 00019 00020 #ifndef _merge_h 00021 #define _merge_h 00022 #ifdef __cplusplus 00023 extern "C" { 00024 #endif 00025 00026 #ifndef _my_base_h 00027 #include <my_base.h> 00028 #endif 00029 #ifndef _nisam_h 00030 #include <nisam.h> 00031 #endif 00032 00033 #define MRG_NAME_EXT ".MRG" 00034 00035 /* Param to/from mrg_info */ 00036 00037 typedef struct st_mrg_info /* Struct from h_info */ 00038 { 00039 ulonglong records; /* Records in database */ 00040 ulonglong deleted; /* Deleted records in database */ 00041 ulonglong recpos; /* Pos for last used record */ 00042 ulonglong data_file_length; 00043 uint reclength; /* Recordlength */ 00044 int errkey; /* With key was dupplicated on err */ 00045 uint options; /* HA_OPTION_... used */ 00046 } MERGE_INFO; 00047 00048 typedef struct st_mrg_table_info 00049 { 00050 N_INFO *table; 00051 ulonglong file_offset; 00052 } MRG_TABLE; 00053 00054 typedef struct st_merge 00055 { 00056 MRG_TABLE *open_tables,*current_table,*end_table,*last_used_table; 00057 ulonglong records; /* records in tables */ 00058 ulonglong del; /* Removed records */ 00059 ulonglong data_file_length; 00060 uint tables,options,reclength; 00061 my_bool cache_in_use; 00062 LIST open_list; 00063 } MRG_INFO; 00064 00065 typedef ulong mrg_off_t; 00066 00067 /* Prototypes for merge-functions */ 00068 00069 extern int mrg_close(MRG_INFO *file); 00070 extern int mrg_delete(MRG_INFO *file,const byte *buff); 00071 extern MRG_INFO *mrg_open(const char *name,int mode,int wait_if_locked); 00072 extern int mrg_panic(enum ha_panic_function function); 00073 extern int mrg_rfirst(MRG_INFO *file,byte *buf,int inx); 00074 extern int mrg_rkey(MRG_INFO *file,byte *buf,int inx,const byte *key, 00075 uint key_len, enum ha_rkey_function search_flag); 00076 extern int mrg_rrnd(MRG_INFO *file,byte *buf, mrg_off_t pos); 00077 extern int mrg_rsame(MRG_INFO *file,byte *record,int inx); 00078 extern int mrg_update(MRG_INFO *file,const byte *old,const byte *new_rec); 00079 extern int mrg_info(MRG_INFO *file,MERGE_INFO *x,int flag); 00080 extern int mrg_lock_database(MRG_INFO *file,int lock_type); 00081 extern int mrg_create(const char *name,const char **table_names); 00082 extern int mrg_extra(MRG_INFO *file,enum ha_extra_function function); 00083 extern ha_rows mrg_records_in_range(MRG_INFO *info,int inx, 00084 const byte *start_key,uint start_key_len, 00085 enum ha_rkey_function start_search_flag, 00086 const byte *end_key,uint end_key_len, 00087 enum ha_rkey_function end_search_flag); 00088 00089 extern mrg_off_t mrg_position(MRG_INFO *info); 00090 #ifdef __cplusplus 00091 } 00092 #endif 00093 #endif