diff options
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 113 |
1 files changed, 56 insertions, 57 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index 5556e9c9587..4d58d64a725 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -36,7 +36,7 @@ typedef int (*sys_check_func)(THD *, set_var *); typedef bool (*sys_update_func)(THD *, set_var *); typedef void (*sys_after_update_func)(THD *,enum_var_type); typedef void (*sys_set_default_func)(THD *, enum_var_type); -typedef byte *(*sys_value_ptr_func)(THD *thd); +typedef uchar *(*sys_value_ptr_func)(THD *thd); struct sys_var_chain { @@ -73,7 +73,7 @@ public: virtual bool update(THD *thd, set_var *var)=0; virtual void set_default(THD *thd_arg, enum_var_type type) {} virtual SHOW_TYPE show_type() { return SHOW_UNDEF; } - virtual byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + virtual uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { return 0; } virtual bool check_type(enum_var_type type) { return type != OPT_GLOBAL; } /* Error if not GLOBAL */ @@ -123,8 +123,8 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_LONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (byte*) value; } + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + { return (uchar*) value; } }; @@ -154,8 +154,8 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_LONGLONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (byte*) value; } + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + { return (uchar*) value; } }; @@ -173,8 +173,8 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_MY_BOOL; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (byte*) value; } + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + { return (uchar*) value; } bool check_update_type(Item_result type) { return 0; } }; @@ -216,8 +216,8 @@ public: (*set_default_func)(thd, type); } SHOW_TYPE show_type() { return SHOW_CHAR; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) - { return (byte*) value; } + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + { return (uchar*) value; } bool check_update_type(Item_result type) { return type != STRING_RESULT; /* Only accept strings */ @@ -242,9 +242,9 @@ public: return 1; } SHOW_TYPE show_type() { return SHOW_CHAR; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { - return (byte*) value; + return (uchar*) value; } bool check_update_type(Item_result type) { @@ -271,9 +271,9 @@ public: return 1; } SHOW_TYPE show_type() { return SHOW_CHAR; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { - return (byte*) *value; + return (uchar*) *value; } bool check_update_type(Item_result type) { @@ -299,7 +299,7 @@ public: } bool update(THD *thd, set_var *var); SHOW_TYPE show_type() { return SHOW_CHAR; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check_update_type(Item_result type) { return 0; } }; @@ -335,7 +335,7 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_LONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; @@ -355,7 +355,7 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_HA_ROWS; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; @@ -377,7 +377,7 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_LONGLONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check_default(enum_var_type type) { return type == OPT_GLOBAL && !option_limits; @@ -403,7 +403,7 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_MY_BOOL; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check(THD *thd, set_var *var) { return check_enum(thd, var, &bool_typelib); @@ -446,7 +446,7 @@ public: bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_CHAR; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check_update_type(Item_result type) { return 0; } }; @@ -466,7 +466,7 @@ public: return check_set(thd, var, enum_names); } void set_default(THD *thd, enum_var_type type); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); static bool symbolic_mode_representation(THD *thd, ulonglong sql_mode, LEX_STRING *rep); }; @@ -489,7 +489,7 @@ public: } void set_default(THD *thd, enum_var_type type); bool update(THD *thd, set_var *var); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; class sys_var_thd_table_type :public sys_var_thd_storage_engine @@ -522,7 +522,7 @@ public: bool check_update_type(Item_result type) { return 0; } bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } SHOW_TYPE show_type() { return SHOW_MY_BOOL; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; class sys_var_thd_dbug :public sys_var_thd @@ -536,7 +536,7 @@ public: SHOW_TYPE show_type() { return SHOW_CHAR; } bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type) { DBUG_POP(); } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *b); }; @@ -554,7 +554,7 @@ public: bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } bool check_default(enum_var_type type) { return 0; } SHOW_TYPE show_type() { return SHOW_LONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; @@ -567,7 +567,7 @@ public: bool update(THD *thd, set_var *var); bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } SHOW_TYPE show_type() { return SHOW_LONGLONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; @@ -580,7 +580,7 @@ public: bool update(THD *thd, set_var *var); bool check_type(enum_var_type type) { return type == OPT_GLOBAL; } SHOW_TYPE show_type() { return SHOW_LONGLONG; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; @@ -644,23 +644,22 @@ public: } bool check_default(enum_var_type type) { return 0; } bool update(THD *thd, set_var *var); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); virtual void set_default(THD *thd, enum_var_type type)= 0; virtual CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type)= 0; }; - class sys_var_character_set_sv :public sys_var_character_set { CHARSET_INFO *SV::*offset; CHARSET_INFO **global_default; public: sys_var_character_set_sv(sys_var_chain *chain, const char *name_arg, - CHARSET_INFO *SV::*offset_arg, - CHARSET_INFO **global_default_arg, - bool is_nullable= 0) + CHARSET_INFO *SV::*offset_arg, + CHARSET_INFO **global_default_arg, + bool is_nullable= 0) : sys_var_character_set(name_arg, is_nullable), - offset(offset_arg), global_default(global_default_arg) + offset(offset_arg), global_default(global_default_arg) { chain_sys_var(chain); } void set_default(THD *thd, enum_var_type type); CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type); @@ -683,16 +682,16 @@ class sys_var_collation_sv :public sys_var_collation CHARSET_INFO **global_default; public: sys_var_collation_sv(sys_var_chain *chain, const char *name_arg, - CHARSET_INFO *SV::*offset_arg, - CHARSET_INFO **global_default_arg) + CHARSET_INFO *SV::*offset_arg, + CHARSET_INFO **global_default_arg) :sys_var_collation(name_arg), - offset(offset_arg), global_default(global_default_arg) + offset(offset_arg), global_default(global_default_arg) { chain_sys_var(chain); } bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; @@ -705,7 +704,7 @@ public: size_t offset_arg) :sys_var(name_arg), offset(offset_arg) { chain_sys_var(chain); } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check_default(enum_var_type type) { return 1; } bool is_struct() { return 1; } }; @@ -754,7 +753,7 @@ public: bool check(THD *thd, set_var *var); bool update(THD *thd, set_var *var); void update2(THD *thd, enum_var_type type, DATE_TIME_FORMAT *new_value); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); void set_default(THD *thd, enum_var_type type); }; @@ -785,7 +784,7 @@ public: return check_set(thd, var, enum_names); } bool update(THD *thd, set_var *var); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); bool check_update_type(Item_result type) { return 0; } void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_CHAR; } @@ -810,7 +809,7 @@ public: bool check_default(enum_var_type type) { return 1; } bool check_type(enum_var_type type) { return type != var_type; } bool check_update_type(Item_result type) { return 1; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { return (*value_ptr_func)(thd); } @@ -827,9 +826,9 @@ public: sys_var_have_option(sys_var_chain *chain, const char *variable_name): sys_var(variable_name) { chain_sys_var(chain); } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { - return (byte*) show_comp_option_name[get_option()]; + return (uchar*) show_comp_option_name[get_option()]; } bool update(THD *thd, set_var *var) { return 1; } bool check_default(enum_var_type type) { return 1; } @@ -890,7 +889,7 @@ public: } bool check_default(enum_var_type type) { return 0; } bool update(THD *thd, set_var *var); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); virtual void set_default(THD *thd, enum_var_type type); }; @@ -909,15 +908,15 @@ public: } void set_default(THD *thd, enum_var_type type); SHOW_TYPE show_type() { return SHOW_INT; } - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); }; class sys_var_trust_routine_creators :public sys_var_bool_ptr { /* We need a derived class only to have a warn_deprecated() */ public: - sys_var_trust_routine_creators(sys_var_chain *chain, const char *name_arg, - my_bool *value_arg) : + sys_var_event_scheduler(sys_var_chain *chain, const char *name_arg) : + sys_var_long_ptr(chain, name_arg, NULL, NULL) {}; sys_var_bool_ptr(chain, name_arg, value_arg) {}; void warn_deprecated(THD *thd); void set_default(THD *thd, enum_var_type type); @@ -959,7 +958,7 @@ public: } bool check_default(enum_var_type type) { return 0; } bool update(THD *thd, set_var *var); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); virtual void set_default(THD *thd, enum_var_type type); }; @@ -968,10 +967,10 @@ class sys_var_event_scheduler :public sys_var_long_ptr { /* We need a derived class only to have a warn_deprecated() */ public: - sys_var_event_scheduler(sys_var_chain *chain, const char *name_arg) : - sys_var_long_ptr(chain, name_arg, NULL, NULL) {}; + sys_var_event_scheduler(const char *name_arg) : + sys_var_long_ptr(name_arg, NULL, NULL) {}; bool update(THD *thd, set_var *var); - byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); + uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); SHOW_TYPE show_type() { return SHOW_CHAR; } bool check(THD *thd, set_var *var); bool check_update_type(Item_result type) @@ -1114,10 +1113,10 @@ class NAMED_LIST :public ilink const char *name; uint name_length; public: - gptr data; + uchar* data; NAMED_LIST(I_List<NAMED_LIST> *links, const char *name_arg, - uint name_length_arg, gptr data_arg) + uint name_length_arg, uchar* data_arg) :name_length(name_length_arg), data(data_arg) { name= my_strndup(name_arg, name_length, MYF(MY_WME)); @@ -1129,12 +1128,12 @@ public: } ~NAMED_LIST() { - my_free((char*) name, MYF(0)); + my_free((uchar*) name, MYF(0)); } friend bool process_key_caches(int (* func) (const char *name, KEY_CACHE *)); friend void delete_elements(I_List<NAMED_LIST> *list, - void (*free_element)(const char*, gptr)); + void (*free_element)(const char*, uchar*)); }; /* updated in sql_acl.cc */ @@ -1171,7 +1170,7 @@ extern sys_var_str sys_init_slave; extern sys_var_thd_time_zone sys_time_zone; extern sys_var_thd_bit sys_autocommit; CHARSET_INFO *get_old_charset_by_name(const char *old_name); -gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length, +uchar* find_named(I_List<NAMED_LIST> *list, const char *name, uint length, NAMED_LIST **found); extern sys_var_str sys_var_general_log_path, sys_var_slow_log_path; @@ -1182,4 +1181,4 @@ KEY_CACHE *get_or_create_key_cache(const char *name, uint length); void free_key_cache(const char *name, KEY_CACHE *key_cache); bool process_key_caches(int (* func) (const char *name, KEY_CACHE *)); void delete_elements(I_List<NAMED_LIST> *list, - void (*free_element)(const char*, gptr)); + void (*free_element)(const char*, uchar*)); |