summaryrefslogtreecommitdiff
path: root/sql/set_var.h
diff options
context:
space:
mode:
authorunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-05-24 13:24:36 +0300
committerunknown <jani@a88-113-38-195.elisa-laajakaista.fi>2007-05-24 13:24:36 +0300
commit6e849907977dd503ad82b9aa5039d17b5db1d7b7 (patch)
tree94027c861a0c3fd6ad62c4bee7ae5f7b1088f056 /sql/set_var.h
parent2d95236b718002a48e31ded9449327da077200d8 (diff)
parentf252f9248ab31bbd53132db2c72267592c716c85 (diff)
downloadmariadb-git-6e849907977dd503ad82b9aa5039d17b5db1d7b7.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel BitKeeper/etc/ignore: auto-union client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged extra/comp_err.c: Auto merged include/decimal.h: Auto merged include/my_getopt.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged include/mysql.h: Auto merged mysys/array.c: Auto merged mysys/hash.c: Auto merged mysys/typelib.c: Auto merged sql/derror.cc: Auto merged sql/event_data_objects.cc: Auto merged sql/event_queue.cc: Auto merged sql/field.cc: Auto merged sql/filesort.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/ha_partition.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/my_decimal.cc: Auto merged sql/my_decimal.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/rpl_utility.h: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_connect.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_partition.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/table.h: Auto merged sql/tztime.cc: Auto merged sql/unireg.cc: Auto merged storage/example/ha_example.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/heap/ha_heap.cc: Auto merged storage/innobase/handler/ha_innodb.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/sort.c: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged strings/decimal.c: Auto merged strings/strtod.c: Auto merged include/hash.h: Manual merge with 5.1 main tree. mysys/my_getopt.c: Manual merge with 5.1 main tree. sql/field.h: Manual merge with 5.1 main tree. sql/ha_ndbcluster.cc: Manual merge with 5.1 main tree. sql/item_cmpfunc.h: Manual merge with 5.1 main tree. sql/item_create.cc: Manual merge with 5.1 main tree. sql/item_func.h: Manual merge with 5.1 main tree. sql/key.cc: Manual merge with 5.1 main tree. sql/lock.cc: Manual merge with 5.1 main tree. sql/mysqld.cc: Manual merge with 5.1 main tree. sql/set_var.cc: Manual merge with 5.1 main tree. sql/set_var.h: Manual merge with 5.1 main tree. sql/sql_base.cc: Manual merge with 5.1 main tree. sql/sql_handler.cc: Manual merge with 5.1 main tree. sql/sql_insert.cc: Manual merge with 5.1 main tree. sql/sql_plugin.cc: Manual merge with 5.1 main tree. sql/sql_table.cc: Manual merge with 5.1 main tree. sql/sql_yacc.yy: Manual merge with 5.1 main tree. sql/table.cc: Manual merge with 5.1 main tree. storage/innobase/handler/ha_innodb.cc: Manual merge with 5.1 main tree. storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Manual merge with 5.1 main tree. storage/ndb/tools/restore/restore_main.cpp: Manual merge with 5.1 main tree.
Diffstat (limited to 'sql/set_var.h')
-rw-r--r--sql/set_var.h113
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*));