summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/ha_innodb.h')
-rw-r--r--sql/ha_innodb.h74
1 files changed, 36 insertions, 38 deletions
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index 7bf20771680..d336811a1eb 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -21,7 +21,7 @@
Innodb
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
@@ -32,6 +32,7 @@ typedef struct st_innobase_share {
uint table_name_length,use_count;
} INNOBASE_SHARE;
+
/* The class defining a handle to an Innodb table */
class ha_innobase: public handler
{
@@ -60,20 +61,12 @@ class ha_innobase: public handler
ulong start_of_scan; /* this is set to 1 when we are
starting a table scan but have not
yet fetched any row, else 0 */
- uint active_index_before_scan;
- /* since a table scan in InnoDB is
- always done through an index, a table
- scan may change active_index; but
- MySQL may assume that active_index
- after a table scan is the same as
- before; we store the value here so
- that we can restore the value after
- a scan */
uint last_match_mode;/* match mode of the latest search:
ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX,
or undefined */
+ uint num_write_row; /* number of write_row() calls */
longlong auto_inc_counter_for_this_stat;
- ulong max_row_length(const byte *buf);
+ ulong max_supported_row_length(const byte *buf);
uint store_key_val_for_row(uint keynr, char* buff, uint buff_len,
const byte* record);
@@ -86,18 +79,15 @@ class ha_innobase: public handler
public:
ha_innobase(TABLE *table): handler(table),
int_table_flags(HA_REC_NOT_IN_SEQ |
- HA_KEYPOS_TO_RNDPOS |
- HA_LASTKEY_ORDER |
- HA_NULL_KEY |
- HA_BLOB_KEY |
+ HA_NULL_IN_KEY | HA_FAST_KEY_READ |
+ HA_CAN_INDEX_BLOBS |
HA_CAN_SQL_HANDLER |
HA_NOT_EXACT_COUNT |
- HA_NO_WRITE_DELAYED |
HA_PRIMARY_KEY_IN_READ_INDEX |
- HA_DROP_BEFORE_CREATE |
HA_TABLE_SCAN_ON_INDEX),
last_dup_key((uint) -1),
- start_of_scan(0)
+ start_of_scan(0),
+ num_write_row(0)
{
}
~ha_innobase() {}
@@ -106,14 +96,12 @@ class ha_innobase: public handler
const char *index_type(uint key_number) { return "BTREE"; }
const char** bas_ext() const;
ulong table_flags() const { return int_table_flags; }
- ulong index_flags(uint idx) const
+ ulong index_flags(uint idx, uint part, bool all_parts) const
{
- return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER |
- HA_KEY_READ_ONLY);
+ return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE |
+ HA_KEYREAD_ONLY);
}
- uint max_record_length() const { return HA_MAX_REC_LENGTH; }
- uint max_keys() const { return MAX_KEY; }
- uint max_key_parts() const { return MAX_REF_PARTS; }
+ uint max_supported_keys() const { return MAX_KEY; }
/* An InnoDB page must store >= 2 keys;
a secondary key record must also contain the
primary key value:
@@ -121,14 +109,12 @@ class ha_innobase: public handler
less than 1 / 4 of page size which is 16 kB;
but currently MySQL does not work with keys
whose size is > MAX_KEY_LENGTH */
- uint max_key_length() const { return((MAX_KEY_LENGTH <= 3500) ?
- MAX_KEY_LENGTH : 3500);}
- bool fast_key_read() { return 1;}
- key_map keys_to_use_for_scanning() { return ~(key_map) 0; }
+ uint max_supported_key_length() const { return 3500; }
+ uint max_supported_key_part_length() const { return 3500; }
+ const key_map *keys_to_use_for_scanning() { return &key_map_full; }
bool has_transactions() { return 1;}
int open(const char *name, int mode, uint test_if_locked);
- void initialize(void);
int close(void);
double scan_time();
double read_time(uint index, uint ranges, ha_rows rows);
@@ -150,7 +136,7 @@ class ha_innobase: public handler
int index_first(byte * buf);
int index_last(byte * buf);
- int rnd_init(bool scan=1);
+ int rnd_init(bool scan);
int rnd_end();
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
@@ -159,18 +145,14 @@ class ha_innobase: public handler
void info(uint);
int analyze(THD* thd,HA_CHECK_OPT* check_opt);
int optimize(THD* thd,HA_CHECK_OPT* check_opt);
+ int discard_or_import_tablespace(my_bool discard);
int extra(enum ha_extra_function operation);
- int reset(void);
int external_lock(THD *thd, int lock_type);
int start_stmt(THD *thd);
void position(byte *record);
- ha_rows records_in_range(int inx,
- const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
- ha_rows estimate_number_of_rows();
+ ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
+ ha_rows estimate_rows_upper_bound();
int create(const char *name, register TABLE *form,
HA_CREATE_INFO *create_info);
@@ -179,15 +161,19 @@ class ha_innobase: public handler
int check(THD* thd, HA_CHECK_OPT* check_opt);
char* update_table_comment(const char* comment);
char* get_foreign_key_create_info();
+ bool can_switch_engines();
uint referenced_by_foreign_key();
void free_foreign_key_create_info(char* str);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
void init_table_handle_for_HANDLER();
longlong get_auto_increment();
+ uint8 table_cache_type() { return HA_CACHE_TBL_ASKTRANSACT; }
+
+ static char *get_mysql_bin_log_name();
+ static ulonglong get_mysql_bin_log_pos();
};
-extern bool innodb_skip;
extern uint innobase_init_flags, innobase_lock_type;
extern uint innobase_flush_log_at_trx_commit;
extern ulong innobase_cache_size;
@@ -196,15 +182,23 @@ extern long innobase_lock_scan_time;
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
extern long innobase_log_file_size, innobase_log_buffer_size;
extern long innobase_buffer_pool_size, innobase_additional_mem_pool_size;
+extern long innobase_buffer_pool_awe_mem_mb;
extern long innobase_file_io_threads, innobase_lock_wait_timeout;
extern long innobase_force_recovery, innobase_thread_concurrency;
+extern long innobase_open_files;
extern char *innobase_data_home_dir, *innobase_data_file_path;
extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
extern char *innobase_unix_file_flush_method;
/* The following variables have to be my_bool for SHOW VARIABLES to work */
extern my_bool innobase_log_archive,
innobase_use_native_aio, innobase_fast_shutdown,
+ innobase_file_per_table, innobase_locks_unsafe_for_binlog,
innobase_create_status_file;
+extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
+ calling innobase_end() if you want
+ InnoDB to shut down without
+ flushing the buffer pool: this
+ is equivalent to a 'crash' */
extern "C" {
extern ulong srv_max_buf_pool_modified_pct;
extern ulong srv_max_purge_lag;
@@ -242,3 +236,7 @@ int innodb_show_status(THD* thd);
my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name,
uint full_name_len);
void innobase_release_temporary_latches(void* innobase_tid);
+
+void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
+
+int innobase_start_trx_and_assign_read_view(THD* thd);