diff options
Diffstat (limited to 'sql/handler.h')
-rw-r--r-- | sql/handler.h | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/sql/handler.h b/sql/handler.h index 560420a480d..98358c3b3e4 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -21,11 +21,13 @@ #pragma interface /* gcc class implementation */ #endif +#include <ft_global.h> + #ifndef NO_HASH #define NO_HASH /* Not yet implemented */ #endif -#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || defined(HAVE_GEMINI_DB) +#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) #define USING_TRANSACTIONS #endif @@ -93,7 +95,7 @@ /* Error on write which is recoverable (Key exist) */ -#define HA_WRITE_SKIPP 121 /* Duplicate key on write */ +#define HA_WRITE_SKIP 121 /* Duplicate key on write */ #define HA_READ_CHECK 123 /* Update with is recoverable */ #define HA_CANT_DO_THAT 131 /* Databasehandler can't do it */ @@ -111,23 +113,27 @@ enum db_type { DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1, DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM, DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM, DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM, - DB_TYPE_BERKELEY_DB, DB_TYPE_INNOBASE, DB_TYPE_GEMINI, + DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, DB_TYPE_GEMINI, DB_TYPE_DEFAULT }; -enum row_type { ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, ROW_TYPE_DYNAMIC, - ROW_TYPE_COMPRESSED }; +enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED, + ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED}; /* struct to hold information about the table that should be created */ /* Bits in used_fields */ -#define HA_CREATE_USED_AUTO 1 -#define HA_CREATE_USED_RAID 2 -#define HA_CREATE_USED_UNION 4 +#define HA_CREATE_USED_AUTO 1 +#define HA_CREATE_USED_RAID 2 +#define HA_CREATE_USED_UNION 4 +#define HA_CREATE_USED_INSERT_METHOD 8 +#define HA_CREATE_USED_MIN_ROWS 16 +#define HA_CREATE_USED_MAX_ROWS 32 +#define HA_CREATE_USED_AVG_ROW_LENGTH 64 +#define HA_CREATE_USED_PACK_KEYS 128 typedef struct st_thd_trans { void *bdb_tid; void *innobase_tid; - void *gemini_tid; bool innodb_active_trans; } THD_TRANS; @@ -143,6 +149,7 @@ typedef struct st_ha_create_information ulonglong max_rows,min_rows; ulonglong auto_increment_value; char *comment,*password; + char *data_file_name, *index_file_name; char *create_statement; uint options; /* OR of HA_CREATE_ options */ uint raid_type,raid_chunks; @@ -150,6 +157,7 @@ typedef struct st_ha_create_information bool if_not_exists; ulong used_fields; SQL_LIST merge_list; + uint merge_insert_method; } HA_CREATE_INFO; @@ -201,7 +209,7 @@ public: time_t check_time; time_t update_time; ulong mean_rec_length; /* physical reclength */ - void *ft_handler; + FT_INFO *ft_handler; bool auto_increment_column_changed; handler(TABLE *table_arg) : table(table_arg),active_index(MAX_REF_PARTS), @@ -238,7 +246,7 @@ public: virtual int update_row(const byte * old_data, byte * new_data)=0; virtual int delete_row(const byte * buf)=0; virtual int index_read(byte * buf, const byte * key, - uint key_len, enum ha_rkey_function find_flag)=0; + uint key_len, enum ha_rkey_function find_flag)=0; virtual int index_read_idx(byte * buf, uint index, const byte * key, uint key_len, enum ha_rkey_function find_flag)=0; virtual int index_next(byte * buf)=0; @@ -248,9 +256,9 @@ public: virtual int index_next_same(byte *buf, const byte *key, uint keylen); virtual int ft_init() { return -1; } - virtual void *ft_init_ext(uint inx,const byte *key, uint keylen, + virtual FT_INFO *ft_init_ext(uint mode,uint inx,const byte *key, uint keylen, bool presort) - { return (void *)NULL; } + { return NULL; } virtual int ft_read(byte *buf) { return -1; } virtual int rnd_init(bool scan=1)=0; virtual int rnd_end() { return 0; } @@ -318,17 +326,6 @@ public: enum thr_lock_type lock_type)=0; }; -#ifdef HAVE_GEMINI_DB -struct st_gemini -{ - void *context; - unsigned long savepoint; - bool needSavepoint; - uint tx_isolation; - uint lock_count; -}; -#endif - /* Some extern variables used with handlers */ extern const char *ha_row_type[]; @@ -340,6 +337,8 @@ extern TYPELIB ha_table_typelib, tx_isolation_typelib; #define ha_commit(thd) (ha_commit_trans((thd), &((thd)->transaction.all))) #define ha_rollback(thd) (ha_rollback_trans((thd), &((thd)->transaction.all))) +#define ha_supports_generate(T) (T != DB_TYPE_INNODB) + handler *get_new_handler(TABLE *table, enum db_type db_type); my_off_t ha_get_ptr(byte *ptr, uint pack_length); void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos); @@ -358,5 +357,4 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans); int ha_autocommit_or_rollback(THD *thd, int error); void ha_set_spin_retries(uint retries); bool ha_flush_logs(void); -int ha_commit_rename(THD *thd); int ha_recovery_logging(THD *thd, bool on); |