summaryrefslogtreecommitdiffstats
path: root/sql/handler.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sql/handler.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/sql/handler.h b/sql/handler.h
index a8484e2a..6958692e 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -451,12 +451,6 @@ enum chf_create_flags {
#define HA_FAST_CHANGE_PARTITION (1UL << 13)
#define HA_PARTITION_ONE_PHASE (1UL << 14)
-/* operations for disable/enable indexes */
-#define HA_KEY_SWITCH_NONUNIQ 0
-#define HA_KEY_SWITCH_ALL 1
-#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
-#define HA_KEY_SWITCH_ALL_SAVE 3
-
/*
Note: the following includes binlog and closing 0.
TODO remove the limit, use dynarrays
@@ -495,6 +489,12 @@ enum chf_create_flags {
#define HA_LEX_CREATE_SEQUENCE 16U
#define HA_VERSIONED_TABLE 32U
#define HA_SKIP_KEY_SORT 64U
+/*
+ A temporary table that can be used by different threads, eg. replication
+ threads. This flag ensure that memory is not allocated with THREAD_SPECIFIC,
+ as we do for other temporary tables.
+*/
+#define HA_LEX_CREATE_GLOBAL_TMP_TABLE 128U
#define HA_MAX_REC_LENGTH 65535
@@ -2673,6 +2673,7 @@ typedef struct st_ha_check_opt
st_ha_check_opt() = default; /* Remove gcc warning */
uint flags; /* isam layer flags (e.g. for myisamchk) */
uint sql_flags; /* sql layer flags - for something myisamchk cannot do */
+ uint handler_flags; /* Reserved for handler usage */
time_t start_time; /* When check/repair starts */
KEY_CACHE *key_cache; /* new key cache when changing key cache */
void init();
@@ -3360,6 +3361,7 @@ public:
("handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
F_UNLCK, F_RDLCK, F_WRLCK));
reset_statistics();
+ active_handler_stats.active= 0;
}
virtual ~handler(void)
{
@@ -3500,8 +3502,8 @@ public:
int ha_optimize(THD* thd, HA_CHECK_OPT* check_opt);
int ha_analyze(THD* thd, HA_CHECK_OPT* check_opt);
bool ha_check_and_repair(THD *thd);
- int ha_disable_indexes(uint mode);
- int ha_enable_indexes(uint mode);
+ int ha_disable_indexes(key_map map, bool persist);
+ int ha_enable_indexes(key_map map, bool persist);
int ha_discard_or_import_tablespace(my_bool discard);
int ha_rename_table(const char *from, const char *to);
void ha_drop_table(const char *name);
@@ -3525,6 +3527,7 @@ public:
virtual void print_error(int error, myf errflag);
virtual bool get_error_message(int error, String *buf);
uint get_dup_key(int error);
+ bool has_dup_ref() const;
/**
Retrieves the names of the table and the key for which there was a
duplicate entry in the case of HA_ERR_FOREIGN_DUPLICATE_KEY.
@@ -4092,7 +4095,6 @@ public:
}
virtual void update_create_info(HA_CREATE_INFO *create_info) {}
- int check_old_types();
virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt)
@@ -4783,9 +4785,12 @@ public:
}
inline void ha_handler_stats_disable()
{
- handler_stats= 0;
- active_handler_stats.active= 0;
- handler_stats_updated();
+ if (handler_stats)
+ {
+ handler_stats= 0;
+ active_handler_stats.active= 0;
+ handler_stats_updated();
+ }
}
private:
@@ -4800,6 +4805,7 @@ private:
}
private:
+ bool check_old_types() const;
void mark_trx_read_write_internal();
bool check_table_binlog_row_based_internal();
@@ -5039,8 +5045,8 @@ public:
virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt)
{ return HA_ADMIN_NOT_IMPLEMENTED; }
virtual bool check_and_repair(THD *thd) { return TRUE; }
- virtual int disable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
- virtual int enable_indexes(uint mode) { return HA_ERR_WRONG_COMMAND; }
+ virtual int disable_indexes(key_map map, bool persist) { return HA_ERR_WRONG_COMMAND; }
+ virtual int enable_indexes(key_map map, bool persist) { return HA_ERR_WRONG_COMMAND; }
virtual int discard_or_import_tablespace(my_bool discard)
{ return (my_errno=HA_ERR_WRONG_COMMAND); }
virtual void drop_table(const char *name);