~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/myisammrg.h

  • Committer: Brian Aker
  • Date: 2008-08-11 17:53:27 UTC
  • Revision ID: brian@tangent.org-20080811175327-ir0x82rmhubup1y3
Removing dead include file, external pack program.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2000 MySQL AB
2
 
 
3
 
   This program is free software; you can redistribute it and/or modify
4
 
   it under the terms of the GNU General Public License as published by
5
 
   the Free Software Foundation; version 2 of the License.
6
 
 
7
 
   This program is distributed in the hope that it will be useful,
8
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 
   GNU General Public License for more details.
11
 
 
12
 
   You should have received a copy of the GNU General Public License
13
 
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
 
 
16
 
/* This file should be included when using merge_isam_funktions */
17
 
 
18
 
#ifndef _myisammrg_h
19
 
#define _myisammrg_h
20
 
#ifdef  __cplusplus
21
 
extern "C" {
22
 
#endif
23
 
 
24
 
#include <drizzled/base.h>
25
 
#ifndef _myisam_h
26
 
#include <myisam.h>
27
 
#endif
28
 
 
29
 
#include <queues.h>
30
 
 
31
 
#define MYRG_NAME_EXT   ".MRG"
32
 
 
33
 
/* In which table to INSERT rows */
34
 
#define MERGE_INSERT_DISABLED   0
35
 
#define MERGE_INSERT_TO_FIRST   1
36
 
#define MERGE_INSERT_TO_LAST    2
37
 
 
38
 
extern TYPELIB merge_insert_method;
39
 
 
40
 
        /* Param to/from myrg_info */
41
 
 
42
 
typedef struct st_mymerge_info          /* Struct from h_info */
43
 
{
44
 
  uint64_t records;                     /* Records in database */
45
 
  uint64_t deleted;                     /* Deleted records in database */
46
 
  uint64_t recpos;                      /* Pos for last used record */
47
 
  uint64_t data_file_length;
48
 
  uint  reclength;                      /* Recordlength */
49
 
  int   errkey;                         /* With key was dupplicated on err */
50
 
  uint  options;                        /* HA_OPTION_... used */
51
 
  ulong *rec_per_key;                   /* for sql optimizing */
52
 
} MYMERGE_INFO;
53
 
 
54
 
typedef struct st_myrg_table_info
55
 
{
56
 
  struct st_myisam_info *table;
57
 
  uint64_t file_offset;
58
 
} MYRG_TABLE;
59
 
 
60
 
typedef struct st_myrg_info
61
 
{
62
 
  MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
63
 
  uint64_t records;                     /* records in tables */
64
 
  uint64_t del;                 /* Removed records */
65
 
  uint64_t data_file_length;
66
 
  ulong  cache_size;
67
 
  uint   merge_insert_method;
68
 
  uint   tables,options,reclength,keys;
69
 
  bool cache_in_use;
70
 
  /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */
71
 
  bool children_attached;
72
 
  LIST   open_list;
73
 
  QUEUE  by_key;
74
 
  ulong *rec_per_key_part;                      /* for sql optimizing */
75
 
  pthread_mutex_t mutex;
76
 
} MYRG_INFO;
77
 
 
78
 
 
79
 
        /* Prototypes for merge-functions */
80
 
 
81
 
extern int myrg_close(MYRG_INFO *file);
82
 
extern int myrg_delete(MYRG_INFO *file,const uchar *buff);
83
 
extern MYRG_INFO *myrg_open(const char *name,int mode,int wait_if_locked);
84
 
extern MYRG_INFO *myrg_parent_open(const char *parent_name,
85
 
                                   int (*callback)(void*, const char*),
86
 
                                   void *callback_param);
87
 
extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
88
 
                                MI_INFO *(*callback)(void*),
89
 
                                void *callback_param);
90
 
extern int myrg_detach_children(MYRG_INFO *m_info);
91
 
extern int myrg_panic(enum ha_panic_function function);
92
 
extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx);
93
 
extern int myrg_rlast(MYRG_INFO *file,uchar *buf,int inx);
94
 
extern int myrg_rnext(MYRG_INFO *file,uchar *buf,int inx);
95
 
extern int myrg_rprev(MYRG_INFO *file,uchar *buf,int inx);
96
 
extern int myrg_rnext_same(MYRG_INFO *file,uchar *buf);
97
 
extern int myrg_rkey(MYRG_INFO *info,uchar *buf,int inx, const uchar *key,
98
 
                     key_part_map keypart_map, enum ha_rkey_function search_flag);
99
 
extern int myrg_rrnd(MYRG_INFO *file,uchar *buf,uint64_t pos);
100
 
extern int myrg_rsame(MYRG_INFO *file,uchar *record,int inx);
101
 
extern int myrg_update(MYRG_INFO *file,const uchar *old,uchar *new_rec);
102
 
extern int myrg_write(MYRG_INFO *info,uchar *rec);
103
 
extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
104
 
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
105
 
extern int myrg_create(const char *name, const char **table_names,
106
 
                       uint insert_method, bool fix_names);
107
 
extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function,
108
 
                      void *extra_arg);
109
 
extern int myrg_reset(MYRG_INFO *info);
110
 
extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv);
111
 
extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx,
112
 
                                     key_range *min_key, key_range *max_key);
113
 
 
114
 
extern uint64_t myrg_position(MYRG_INFO *info);
115
 
#ifdef  __cplusplus
116
 
}
117
 
#endif
118
 
#endif