~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/csv/ha_tina.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-21 01:02:23 UTC
  • mto: (960.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 961.
  • Revision ID: osullivan.padraig@gmail.com-20090321010223-j8cph7eeyt1u3xol
Fixed function object to ensure it correctly returns a boolean type since
memcmp returns an integer. Added some more comments.

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
#ifndef STORAGE_CSV_HA_TINA_H
 
17
#define STORAGE_CSV_HA_TINA_H
 
18
 
 
19
#include <drizzled/handler.h>
 
20
#include <mysys/thr_lock.h>
 
21
 
16
22
#include <sys/types.h>
17
23
#include <sys/stat.h>
18
24
#include "transparent_file.h"
94
100
      delete file_buff;
95
101
  }
96
102
  const char *table_type(void) const { return "CSV"; }
97
 
  const char *index_type(uint32_t inx __attribute__((unused)))
 
103
  const char *index_type(uint32_t)
98
104
  { return "NONE"; }
99
105
  const char **bas_ext() const;
100
106
  uint64_t table_flags() const
102
108
    return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT |
103
109
            HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE);
104
110
  }
105
 
  uint32_t index_flags(uint32_t idx __attribute__((unused)),
106
 
                       uint32_t part __attribute__((unused)),
107
 
                       bool all_parts __attribute__((unused))) const
 
111
  uint32_t index_flags(uint32_t, uint32_t, bool) const
108
112
  {
109
113
    /*
110
114
      We will never have indexes so this will never be called(AKA we return
122
126
  virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; }
123
127
  /* The next method will never be called */
124
128
  virtual bool fast_key_read() { return 1;}
125
 
  /* 
 
129
  /*
126
130
    TODO: return actual upper bound of number of records in the table.
127
131
    (e.g. save number of records seen on full table scan and/or use file size
128
132
    as upper bound)
137
141
  int rnd_init(bool scan=1);
138
142
  int rnd_next(unsigned char *buf);
139
143
  int rnd_pos(unsigned char * buf, unsigned char *pos);
140
 
  bool check_and_repair(THD *thd);
141
 
  int check(THD* thd, HA_CHECK_OPT* check_opt);
 
144
  bool check_and_repair(Session *session);
 
145
  int check(Session* session, HA_CHECK_OPT* check_opt);
142
146
  bool is_crashed() const;
143
147
  int rnd_end();
144
 
  int repair(THD* thd, HA_CHECK_OPT* check_opt);
 
148
  int repair(Session* session, HA_CHECK_OPT* check_opt);
145
149
  /* This is required for SQL layer to know that we support autorepair */
146
150
  bool auto_repair() const { return 1; }
147
151
  void position(const unsigned char *record);
151
155
  bool check_if_incompatible_data(HA_CREATE_INFO *info,
152
156
                                  uint32_t table_changes);
153
157
 
154
 
  THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
 
158
  THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
155
159
      enum thr_lock_type lock_type);
156
160
 
157
161
  /*
167
171
  int chain_append();
168
172
};
169
173
 
 
174
#endif /* STORAGE_CSV_HA_TINA_H */