78
78
uint num_write_row; /* number of write_row() calls */
80
uint store_key_val_for_row(uint keynr, char* buff, uint buff_len,
81
const unsigned char* record);
82
void update_session(Session* session);
83
void update_session();
84
int change_active_index(uint32_t keynr);
85
int general_fetch(unsigned char* buf, uint32_t direction, uint32_t match_mode);
86
ulint innobase_lock_autoinc();
87
uint64_t innobase_peek_autoinc();
80
UNIV_INTERN uint store_key_val_for_row(uint keynr, char* buff,
81
uint buff_len, const unsigned char* record);
82
UNIV_INTERN void update_session(Session* session);
83
UNIV_INTERN void update_session();
84
UNIV_INTERN int change_active_index(uint32_t keynr);
85
UNIV_INTERN int general_fetch(unsigned char* buf, uint32_t direction, uint32_t match_mode);
86
UNIV_INTERN ulint innobase_lock_autoinc();
87
UNIV_INTERN uint64_t innobase_peek_autoinc();
88
88
ulint innobase_set_max_autoinc(uint64_t auto_inc);
89
89
ulint innobase_reset_autoinc(uint64_t auto_inc);
90
ulint innobase_get_autoinc(uint64_t* value);
90
UNIV_INTERN ulint innobase_get_autoinc(uint64_t* value);
91
91
ulint innobase_update_autoinc(uint64_t auto_inc);
92
ulint innobase_initialize_autoinc();
93
dict_index_t* innobase_get_index(uint keynr);
94
uint64_t innobase_get_int_col_max_value(const Field* field);
92
UNIV_INTERN ulint innobase_initialize_autoinc();
93
UNIV_INTERN dict_index_t* innobase_get_index(uint keynr);
94
UNIV_INTERN uint64_t innobase_get_int_col_max_value(const Field* field);
96
96
/* Init values for the class: */
98
ha_innobase(StorageEngine *engine, TableShare *table_arg);
98
UNIV_INTERN ha_innobase(StorageEngine *engine, TableShare *table_arg);
99
UNIV_INTERN ~ha_innobase();
101
101
Get the row type from the storage engine. If this method returns
102
102
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
104
enum row_type get_row_type() const;
106
const char* index_type(uint key_number);
107
Table_flags table_flags() const;
108
uint32_t index_flags(uint idx, uint part, bool all_parts) const;
109
uint32_t max_supported_keys() const;
110
uint32_t max_supported_key_length() const;
111
uint32_t max_supported_key_part_length() const;
112
const key_map* keys_to_use_for_scanning();
114
int open(const char *name, int mode, uint test_if_locked);
117
double read_time(uint index, uint ranges, ha_rows rows);
119
int write_row(unsigned char * buf);
120
int update_row(const unsigned char * old_data, unsigned char * new_data);
121
int delete_row(const unsigned char * buf);
122
bool was_semi_consistent_read();
123
void try_semi_consistent_read(bool yes);
104
UNIV_INTERN enum row_type get_row_type() const;
106
UNIV_INTERN const char* index_type(uint key_number);
107
UNIV_INTERN Table_flags table_flags() const;
108
UNIV_INTERN uint32_t index_flags(uint idx, uint part, bool all_parts) const;
109
UNIV_INTERN uint32_t max_supported_keys() const;
110
UNIV_INTERN uint32_t max_supported_key_length() const;
111
UNIV_INTERN uint32_t max_supported_key_part_length() const;
112
UNIV_INTERN const key_map* keys_to_use_for_scanning();
114
UNIV_INTERN int open(const char *name, int mode, uint test_if_locked);
115
UNIV_INTERN int close(void);
116
UNIV_INTERN double scan_time();
117
UNIV_INTERN double read_time(uint index, uint ranges, ha_rows rows);
119
UNIV_INTERN int write_row(unsigned char * buf);
120
UNIV_INTERN int update_row(const unsigned char * old_data, unsigned char * new_data);
121
UNIV_INTERN int delete_row(const unsigned char * buf);
122
UNIV_INTERN bool was_semi_consistent_read();
123
UNIV_INTERN void try_semi_consistent_read(bool yes);
124
UNIV_INTERN void unlock_row();
126
126
#ifdef ROW_MERGE_IS_INDEX_USABLE
127
127
/** Check if an index can be used by this transaction.
131
131
* in the read view of this transaction */
132
132
bool is_index_available(uint keynr);
133
133
#endif /* ROW_MERGE_IS_INDEX_USABLE */
134
int index_init(uint index, bool sorted);
136
int index_read(unsigned char * buf, const unsigned char * key,
137
uint key_len, enum ha_rkey_function find_flag);
138
int index_read_idx(unsigned char * buf, uint index, const unsigned char * key,
134
UNIV_INTERN int index_init(uint index, bool sorted);
135
UNIV_INTERN int index_end();
136
UNIV_INTERN int index_read(unsigned char * buf,
137
const unsigned char * key, uint key_len,
138
enum ha_rkey_function find_flag);
139
UNIV_INTERN int index_read_idx(unsigned char * buf, uint index, const unsigned char * key,
139
140
uint key_len, enum ha_rkey_function find_flag);
140
int index_read_last(unsigned char * buf, const unsigned char * key, uint key_len);
141
int index_next(unsigned char * buf);
142
int index_next_same(unsigned char * buf, const unsigned char *key, uint keylen);
143
int index_prev(unsigned char * buf);
144
int index_first(unsigned char * buf);
145
int index_last(unsigned char * buf);
147
int rnd_init(bool scan);
149
int rnd_next(unsigned char *buf);
150
int rnd_pos(unsigned char * buf, unsigned char *pos);
152
void position(const unsigned char *record);
154
int analyze(Session* session,HA_CHECK_OPT* check_opt);
155
int optimize(Session* session,HA_CHECK_OPT* check_opt);
156
int discard_or_import_tablespace(bool discard);
157
int extra(enum ha_extra_function operation);
159
int external_lock(Session *session, int lock_type);
160
int start_stmt(Session *session, thr_lock_type lock_type);
141
UNIV_INTERN int index_read_last(unsigned char * buf, const unsigned char * key, uint key_len);
142
UNIV_INTERN int index_next(unsigned char * buf);
143
UNIV_INTERN int index_next_same(unsigned char * buf, const unsigned char *key, uint keylen);
144
UNIV_INTERN int index_prev(unsigned char * buf);
145
UNIV_INTERN int index_first(unsigned char * buf);
146
UNIV_INTERN int index_last(unsigned char * buf);
148
UNIV_INTERN int rnd_init(bool scan);
149
UNIV_INTERN int rnd_end();
150
UNIV_INTERN int rnd_next(unsigned char *buf);
151
UNIV_INTERN int rnd_pos(unsigned char * buf, unsigned char *pos);
153
UNIV_INTERN void position(const unsigned char *record);
154
UNIV_INTERN int info(uint);
155
UNIV_INTERN int analyze(Session* session,HA_CHECK_OPT* check_opt);
156
UNIV_INTERN int optimize(Session* session,HA_CHECK_OPT* check_opt);
157
UNIV_INTERN int discard_or_import_tablespace(bool discard);
158
UNIV_INTERN int extra(enum ha_extra_function operation);
159
UNIV_INTERN int reset();
160
UNIV_INTERN int external_lock(Session *session, int lock_type);
161
UNIV_INTERN int start_stmt(Session *session, thr_lock_type lock_type);
161
162
void position(unsigned char *record);
162
ha_rows records_in_range(uint inx, key_range *min_key, key_range
163
UNIV_INTERN ha_rows records_in_range(uint inx, key_range *min_key, key_range
164
ha_rows estimate_rows_upper_bound();
165
UNIV_INTERN ha_rows estimate_rows_upper_bound();
166
void update_create_info(HA_CREATE_INFO* create_info);
167
int delete_all_rows();
168
int check(Session* session, HA_CHECK_OPT* check_opt);
169
char* update_table_comment(const char* comment);
170
char* get_foreign_key_create_info();
171
int get_foreign_key_list(Session *session, List<FOREIGN_KEY_INFO> *f_key_list);
172
bool can_switch_engines();
173
uint referenced_by_foreign_key();
174
void free_foreign_key_create_info(char* str);
175
THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
167
UNIV_INTERN void update_create_info(HA_CREATE_INFO* create_info);
168
UNIV_INTERN int delete_all_rows();
169
UNIV_INTERN int check(Session* session, HA_CHECK_OPT* check_opt);
170
UNIV_INTERN char* update_table_comment(const char* comment);
171
UNIV_INTERN char* get_foreign_key_create_info();
172
UNIV_INTERN int get_foreign_key_list(Session *session, List<FOREIGN_KEY_INFO> *f_key_list);
173
UNIV_INTERN bool can_switch_engines();
174
UNIV_INTERN uint referenced_by_foreign_key();
175
UNIV_INTERN void free_foreign_key_create_info(char* str);
176
UNIV_INTERN THR_LOCK_DATA **store_lock(Session *session, THR_LOCK_DATA **to,
176
177
enum thr_lock_type lock_type);
177
void init_table_handle_for_HANDLER();
178
virtual void get_auto_increment(uint64_t offset, uint64_t increment,
179
uint64_t nb_desired_values,
180
uint64_t *first_value,
181
uint64_t *nb_reserved_values);
182
int reset_auto_increment(uint64_t value);
184
virtual bool get_error_message(int error, String *buf);
186
bool primary_key_is_clustered();
187
int cmp_ref(const unsigned char *ref1, const unsigned char *ref2);
178
UNIV_INTERN void init_table_handle_for_HANDLER();
179
UNIV_INTERN virtual void get_auto_increment(uint64_t offset,
181
uint64_t nb_desired_values,
182
uint64_t *first_value,
183
uint64_t *nb_reserved_values);
184
UNIV_INTERN int reset_auto_increment(uint64_t value);
186
UNIV_INTERN virtual bool get_error_message(int error, String *buf);
188
UNIV_INTERN bool primary_key_is_clustered();
189
UNIV_INTERN int cmp_ref(const unsigned char *ref1, const unsigned char *ref2);
188
190
/** Fast index creation (smart ALTER TABLE) @see handler0alter.cc @{ */
189
int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
190
int prepare_drop_index(TABLE *table_arg, uint *key_num,
192
int final_drop_index(TABLE *table_arg);
191
UNIV_INTERN int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
192
UNIV_INTERN int prepare_drop_index(TABLE *table_arg, uint *key_num,
194
UNIV_INTERN int final_drop_index(TABLE *table_arg);