~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/archive/ha_archive.h

Moved the last of the libdrizzleclient calls into Protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
  along with this program; if not, write to the Free Software
14
14
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#ifdef USE_PRAGMA_INTERFACE
17
 
#pragma interface                       /* gcc class implementation */
18
 
#endif
19
16
 
20
17
#include <inttypes.h>
21
18
#include <zlib.h>
22
19
#include "azio.h"
 
20
#include <mysys/thr_lock.h>
 
21
#include <mysys/hash.h>
 
22
#include <drizzled/handler.h>
23
23
 
24
24
/*
25
25
  Please read ha_archive.cc first. If you are looking for more general
62
62
{
63
63
  THR_LOCK_DATA lock;        /* MySQL lock */
64
64
  ARCHIVE_SHARE *share;      /* Shared lock info */
65
 
  
 
65
 
66
66
  azio_stream archive;            /* Archive file we are working with */
67
67
  my_off_t current_position;  /* The position of the row we just read */
68
68
  unsigned char byte_buffer[IO_SIZE]; /* Initial buffer for our string */
80
80
  void destroy_record_buffer(archive_record_buffer *r);
81
81
 
82
82
public:
83
 
  ha_archive(handlerton *hton, TABLE_SHARE *table_arg);
 
83
  ha_archive(StorageEngine *engine, TABLE_SHARE *table_arg);
84
84
  ~ha_archive()
85
85
  {
86
86
  }
87
87
  const char *table_type() const { return "ARCHIVE"; }
88
 
  const char *index_type(uint32_t inx __attribute__((unused)))
 
88
  const char *index_type(uint32_t)
89
89
  { return "NONE"; }
90
90
  const char **bas_ext() const;
91
91
  uint64_t table_flags() const
96
96
            HA_HAS_RECORDS |
97
97
            HA_FILE_BASED);
98
98
  }
99
 
  uint32_t index_flags(uint32_t idx __attribute__((unused)),
100
 
                       uint32_t part __attribute__((unused)),
101
 
                       bool all_parts __attribute__((unused))) const
 
99
  uint32_t index_flags(uint32_t, uint32_t, bool) const
102
100
  {
103
101
    return HA_ONLY_WHOLE_INDEX;
104
102
  }
105
 
  virtual void get_auto_increment(uint64_t offset, uint64_t increment,
106
 
                                  uint64_t nb_desired_values,
107
 
                                  uint64_t *first_value,
108
 
                                  uint64_t *nb_reserved_values);
 
103
  void get_auto_increment(uint64_t, uint64_t, uint64_t,
 
104
                          uint64_t *first_value, uint64_t *nb_reserved_values);
109
105
  uint32_t max_supported_keys()          const { return 1; }
110
106
  uint32_t max_supported_key_length()    const { return sizeof(uint64_t); }
111
107
  uint32_t max_supported_key_part_length() const { return sizeof(uint64_t); }
137
133
  int info(uint);
138
134
  void update_create_info(HA_CREATE_INFO *create_info);
139
135
  int create(const char *name, Table *form, HA_CREATE_INFO *create_info);
140
 
  int optimize(THD* thd, HA_CHECK_OPT* check_opt);
141
 
  int repair(THD* thd, HA_CHECK_OPT* check_opt);
 
136
  int optimize(Session* session, HA_CHECK_OPT* check_opt);
 
137
  int repair(Session* session, HA_CHECK_OPT* check_opt);
142
138
  void start_bulk_insert(ha_rows rows);
143
139
  int end_bulk_insert();
144
 
  enum row_type get_row_type() const 
145
 
  { 
 
140
  enum row_type get_row_type() const
 
141
  {
146
142
    return ROW_TYPE_COMPRESSED;
147
143
  }
148
 
  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
 
144
  THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
149
145
                             enum thr_lock_type lock_type);
150
146
  bool is_crashed() const;
151
 
  int check(THD* thd, HA_CHECK_OPT* check_opt);
152
 
  bool check_and_repair(THD *thd);
 
147
  int check(Session* session, HA_CHECK_OPT* check_opt);
 
148
  bool check_and_repair(Session *session);
153
149
  uint32_t max_row_length(const unsigned char *buf);
154
150
  bool fix_rec_buff(unsigned int length);
155
151
  int unpack_row(azio_stream *file_to_read, unsigned char *record);