27 #ifndef INNODB_HANDLER_HA_INNODB_H
28 #define INNODB_HANDLER_HA_INNODB_H
30 #include <drizzled/cursor.h>
31 #include <drizzled/thr_lock.h>
32 #include <drizzled/plugin/transactional_storage_engine.h>
34 using namespace drizzled;
51 char table_name[FN_REFLEN];
63 strncpy(table_name, arg, FN_REFLEN);
93 std::vector<unsigned char> key_val_buff;
96 ulong upd_and_key_val_buff_len;
103 uint last_match_mode;
108 UNIV_INTERN uint store_key_val_for_row(uint keynr,
char* buff,
109 uint buff_len,
const unsigned char* record);
110 UNIV_INTERN
void update_session(
Session* session);
111 UNIV_INTERN
int change_active_index(uint32_t keynr);
112 UNIV_INTERN
int general_fetch(
unsigned char* buf, uint32_t direction, uint32_t match_mode);
113 UNIV_INTERN ulint innobase_lock_autoinc();
114 UNIV_INTERN uint64_t innobase_peek_autoinc();
115 UNIV_INTERN ulint innobase_set_max_autoinc(uint64_t auto_inc);
116 UNIV_INTERN ulint innobase_reset_autoinc(uint64_t auto_inc);
117 UNIV_INTERN ulint innobase_get_autoinc(uint64_t* value);
118 ulint innobase_update_autoinc(uint64_t auto_inc);
119 UNIV_INTERN
void innobase_initialize_autoinc();
120 UNIV_INTERN
dict_index_t* innobase_get_index(uint keynr);
124 UNIV_INTERN
ha_innobase(plugin::StorageEngine &engine,
135 UNIV_INTERN plugin::TransactionalStorageEngine *getTransactionalEngine()
137 return static_cast<plugin::TransactionalStorageEngine *
>(getEngine());
140 UNIV_INTERN
const char* index_type(uint key_number);
141 UNIV_INTERN
const key_map* keys_to_use_for_scanning();
144 UNIV_INTERN
int close(
void);
145 UNIV_INTERN
double scan_time();
146 UNIV_INTERN
double read_time(uint index, uint ranges, ha_rows rows);
148 UNIV_INTERN
int doInsertRecord(
unsigned char * buf);
149 UNIV_INTERN
int doUpdateRecord(
const unsigned char * old_data,
unsigned char * new_data);
150 UNIV_INTERN
int doDeleteRecord(
const unsigned char * buf);
151 UNIV_INTERN
bool was_semi_consistent_read();
152 UNIV_INTERN
void try_semi_consistent_read(
bool yes);
153 UNIV_INTERN
void unlock_row();
155 UNIV_INTERN
int doStartIndexScan(uint index,
bool sorted);
156 UNIV_INTERN
int doEndIndexScan();
157 UNIV_INTERN
int index_read(
unsigned char * buf,
const unsigned char * key,
158 uint key_len,
enum ha_rkey_function find_flag);
159 UNIV_INTERN
int index_read_idx(
unsigned char * buf, uint index,
const unsigned char * key,
160 uint key_len,
enum ha_rkey_function find_flag);
161 UNIV_INTERN
int index_read_last(
unsigned char * buf,
const unsigned char * key, uint key_len);
162 UNIV_INTERN
int index_next(
unsigned char * buf);
163 UNIV_INTERN
int index_next_same(
unsigned char * buf,
const unsigned char *key, uint keylen);
164 UNIV_INTERN
int index_prev(
unsigned char * buf);
165 UNIV_INTERN
int index_first(
unsigned char * buf);
166 UNIV_INTERN
int index_last(
unsigned char * buf);
168 UNIV_INTERN
int doStartTableScan(
bool scan);
169 UNIV_INTERN
int doEndTableScan();
170 UNIV_INTERN
int rnd_next(
unsigned char *buf);
171 UNIV_INTERN
int rnd_pos(
unsigned char * buf,
unsigned char *pos);
173 UNIV_INTERN
void position(
const unsigned char *record);
174 UNIV_INTERN
int info(uint);
175 UNIV_INTERN
int analyze(
Session* session);
176 UNIV_INTERN
int discard_or_import_tablespace(
bool discard);
177 UNIV_INTERN
int extra(
enum ha_extra_function operation);
178 UNIV_INTERN
int reset();
179 UNIV_INTERN
int external_lock(
Session *session,
int lock_type);
180 void position(
unsigned char *record);
183 UNIV_INTERN ha_rows estimate_rows_upper_bound();
185 UNIV_INTERN
int delete_all_rows();
186 UNIV_INTERN
int check(
Session* session);
187 UNIV_INTERN
char* update_table_comment(
const char* comment);
188 UNIV_INTERN
char* get_foreign_key_create_info();
190 UNIV_INTERN
bool can_switch_engines();
191 UNIV_INTERN uint referenced_by_foreign_key();
192 UNIV_INTERN
void free_foreign_key_create_info(
char* str);
194 enum thr_lock_type lock_type);
195 UNIV_INTERN
virtual void get_auto_increment(uint64_t offset,
197 uint64_t nb_desired_values,
198 uint64_t *first_value,
199 uint64_t *nb_reserved_values);
200 UNIV_INTERN
int reset_auto_increment(uint64_t value);
202 UNIV_INTERN
bool primary_key_is_clustered();
203 UNIV_INTERN
int cmp_ref(
const unsigned char *ref1,
const unsigned char *ref2);
208 UNIV_INTERN
int add_index(
Session *session, TABLE *table_arg,
KeyInfo *key_info, uint num_of_keys);
209 UNIV_INTERN
int prepare_drop_index(
Session *session,
213 UNIV_INTERN
int final_drop_index(
Session *session, TABLE *table_arg);
218 bool eq_range_arg,
bool sorted);
219 int read_range_next();
226 const char* drizzle_bin_log_file_name(
void);
231 uint64_t drizzle_bin_log_file_pos(
void);
239 int session_slave_thread(
const Session *session);
270 innobase_index_name_is_reserved(