2009-09-23 23:32:31 +02:00
|
|
|
#ifndef SET_VAR_INCLUDED
|
|
|
|
#define SET_VAR_INCLUDED
|
2010-01-07 06:42:07 +01:00
|
|
|
/* Copyright (C) 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.
|
2009-09-23 23:32:31 +02:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
2005-11-06 01:36:40 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2008-11-28 15:25:16 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
2008-11-28 15:25:16 +01:00
|
|
|
|
2008-11-22 00:22:21 +01:00
|
|
|
/**
|
2009-12-22 10:35:56 +01:00
|
|
|
@file
|
|
|
|
"public" interface to sys_var - server configuration variables.
|
2008-11-22 00:22:21 +01:00
|
|
|
*/
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
|
|
|
#pragma interface /* gcc class implementation */
|
|
|
|
#endif
|
2004-12-29 18:30:37 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
#include <my_getopt.h>
|
2007-07-30 10:33:50 +02:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
class sys_var;
|
|
|
|
class set_var;
|
|
|
|
class sys_var_pluginvar;
|
|
|
|
class PolyLock;
|
2010-03-31 16:05:33 +02:00
|
|
|
class Item_func_set_user_var;
|
|
|
|
|
|
|
|
// This include needs to be here since item.h requires enum_var_type :-P
|
|
|
|
#include "item.h" /* Item */
|
2008-11-20 08:51:48 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
extern TYPELIB bool_typelib;
|
2008-11-20 08:51:48 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
struct sys_var_chain
|
2007-07-30 10:33:50 +02:00
|
|
|
{
|
2009-12-22 10:35:56 +01:00
|
|
|
sys_var *first;
|
|
|
|
sys_var *last;
|
2007-07-30 10:33:50 +02:00
|
|
|
};
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
int mysql_add_sys_var_chain(sys_var *chain);
|
|
|
|
int mysql_del_sys_var_chain(sys_var *chain);
|
2007-07-30 10:33:50 +02:00
|
|
|
|
2006-11-21 04:40:35 +01:00
|
|
|
/**
|
2009-12-22 10:35:56 +01:00
|
|
|
A class representing one system variable - that is something
|
|
|
|
that can be accessed as @@global.variable_name or @@session.variable_name,
|
|
|
|
visible in SHOW xxx VARIABLES and in INFORMATION_SCHEMA.xxx_VARIABLES,
|
|
|
|
optionally it can be assigned to, optionally it can have a command-line
|
|
|
|
counterpart with the same name.
|
2006-11-21 04:40:35 +01:00
|
|
|
*/
|
2009-12-22 10:35:56 +01:00
|
|
|
class sys_var
|
2006-11-21 04:40:35 +01:00
|
|
|
{
|
|
|
|
public:
|
2009-12-22 10:35:56 +01:00
|
|
|
sys_var *next;
|
|
|
|
LEX_CSTRING name;
|
|
|
|
enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023,
|
|
|
|
READONLY=1024, ALLOCATED=2048 };
|
2010-01-07 06:42:07 +01:00
|
|
|
static const int PARSE_EARLY= 1;
|
|
|
|
static const int PARSE_NORMAL= 2;
|
2009-12-22 10:35:56 +01:00
|
|
|
/**
|
|
|
|
Enumeration type to indicate for a system variable whether
|
|
|
|
it will be written to the binlog or not.
|
|
|
|
*/
|
|
|
|
enum binlog_status_enum { VARIABLE_NOT_IN_BINLOG,
|
|
|
|
SESSION_VARIABLE_IN_BINLOG } binlog_status;
|
2006-11-21 04:40:35 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
protected:
|
|
|
|
typedef bool (*on_check_function)(sys_var *self, THD *thd, set_var *var);
|
|
|
|
typedef bool (*on_update_function)(sys_var *self, THD *thd, enum_var_type type);
|
|
|
|
|
|
|
|
int flags; ///< or'ed flag_enum values
|
2010-01-07 06:42:07 +01:00
|
|
|
int m_parse_flag; ///< either PARSE_EARLY or PARSE_NORMAL.
|
2009-12-22 10:35:56 +01:00
|
|
|
const SHOW_TYPE show_val_type; ///< what value_ptr() returns for sql_show.cc
|
|
|
|
my_option option; ///< min, max, default values are stored here
|
|
|
|
PolyLock *guard; ///< *second* lock that protects the variable
|
|
|
|
ptrdiff_t offset; ///< offset to the value from global_system_variables
|
|
|
|
on_check_function on_check;
|
|
|
|
on_update_function on_update;
|
|
|
|
struct { uint version; const char *substitute; } deprecated;
|
|
|
|
bool is_os_charset; ///< true if the value is in character_set_filesystem
|
|
|
|
|
|
|
|
public:
|
|
|
|
sys_var(sys_var_chain *chain, const char *name_arg, const char *comment,
|
|
|
|
int flag_args, ptrdiff_t off, int getopt_id,
|
|
|
|
enum get_opt_arg_type getopt_arg_type, SHOW_TYPE show_val_type_arg,
|
|
|
|
longlong def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg,
|
|
|
|
on_check_function on_check_func, on_update_function on_update_func,
|
2010-01-07 06:42:07 +01:00
|
|
|
uint deprecated_version, const char *substitute, int parse_flag);
|
2010-09-09 14:37:09 +02:00
|
|
|
|
|
|
|
virtual ~sys_var() {}
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
/**
|
2010-09-02 20:37:04 +02:00
|
|
|
All the cleanup procedures should be performed here
|
2009-12-22 10:35:56 +01:00
|
|
|
*/
|
2010-09-02 20:37:04 +02:00
|
|
|
virtual void cleanup() {}
|
2009-12-22 10:35:56 +01:00
|
|
|
/**
|
|
|
|
downcast for sys_var_pluginvar. Returns this if it's an instance
|
|
|
|
of sys_var_pluginvar, and 0 otherwise.
|
|
|
|
*/
|
|
|
|
virtual sys_var_pluginvar *cast_pluginvar() { return 0; }
|
2009-10-15 14:23:43 +02:00
|
|
|
|
2006-07-04 14:40:40 +02:00
|
|
|
bool check(THD *thd, set_var *var);
|
WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:
- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t
Removed declaration of byte, gptr, my_string, my_size_t and size_s.
Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
as this requires fewer casts in the code and is more in line with how the
standard functions work.
- Added extra length argument to dirname_part() to return the length of the
created string.
- Changed (at least) following functions to take uchar* as argument:
- db_dump()
- my_net_write()
- net_write_command()
- net_store_data()
- DBUG_DUMP()
- decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
argument to my_uncompress() from a pointer to a value as we only return
one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.
Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
explicitely as this conflict was often hided by casting the function to
hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
size_t. This was needed to properly detect errors (which are
returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
(portability fix)
- Removed windows specific code to restore cursor position as this
causes slowdown on windows and we should not mix read() and pread()
calls anyway as this is not thread safe. Updated function comment to
reflect this. Changed function that depended on original behavior of
my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
m_size is the number of elements in the array, not a string/memory
length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
- Replaced some calls to alloc_root + memcpy to use
strmake_root()/strdup_root().
- Changed some calls from memdup() to strmake() (Safety fix)
- Simpler loops in client-simple.c
2007-05-10 11:59:39 +02:00
|
|
|
uchar *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
|
2009-12-22 10:35:56 +01:00
|
|
|
bool set_default(THD *thd, enum_var_type type);
|
2009-10-15 14:23:43 +02:00
|
|
|
bool update(THD *thd, set_var *var);
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
SHOW_TYPE show_type() { return show_val_type; }
|
|
|
|
int scope() const { return flags & SCOPE_MASK; }
|
|
|
|
CHARSET_INFO *charset(THD *thd);
|
|
|
|
bool is_readonly() const { return flags & READONLY; }
|
|
|
|
/**
|
|
|
|
the following is only true for keycache variables,
|
|
|
|
that support the syntax @@keycache_name.variable_name
|
|
|
|
*/
|
|
|
|
bool is_struct() { return option.var_type & GET_ASK_ADDR; }
|
|
|
|
bool is_written_to_binlog(enum_var_type type)
|
|
|
|
{ return type != OPT_GLOBAL && binlog_status == SESSION_VARIABLE_IN_BINLOG; }
|
|
|
|
virtual bool check_update_type(Item_result type) = 0;
|
|
|
|
bool check_type(enum_var_type type)
|
2006-09-01 13:08:44 +02:00
|
|
|
{
|
2009-12-22 10:35:56 +01:00
|
|
|
switch (scope())
|
|
|
|
{
|
|
|
|
case GLOBAL: return type != OPT_GLOBAL;
|
|
|
|
case SESSION: return false; // always ok
|
|
|
|
case ONLY_SESSION: return type == OPT_GLOBAL;
|
|
|
|
}
|
|
|
|
return true; // keep gcc happy
|
2006-09-01 13:08:44 +02:00
|
|
|
}
|
2010-01-07 06:42:07 +01:00
|
|
|
bool register_option(DYNAMIC_ARRAY *array, int parse_flags)
|
|
|
|
{
|
|
|
|
return (option.id != -1) && (m_parse_flag & parse_flags) &&
|
|
|
|
insert_dynamic(array, (uchar*)&option);
|
|
|
|
}
|
2005-12-06 16:15:29 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
private:
|
|
|
|
virtual bool do_check(THD *thd, set_var *var) = 0;
|
|
|
|
/**
|
|
|
|
save the session default value of the variable in var
|
|
|
|
*/
|
|
|
|
virtual void session_save_default(THD *thd, set_var *var) = 0;
|
|
|
|
/**
|
|
|
|
save the global default value of the variable in var
|
|
|
|
*/
|
|
|
|
virtual void global_save_default(THD *thd, set_var *var) = 0;
|
|
|
|
virtual bool session_update(THD *thd, set_var *var) = 0;
|
|
|
|
virtual bool global_update(THD *thd, set_var *var) = 0;
|
|
|
|
void do_deprecated_warning(THD *thd);
|
|
|
|
protected:
|
|
|
|
/**
|
|
|
|
A pointer to a value of the variable for SHOW.
|
|
|
|
It must be of show_val_type type (bool for SHOW_BOOL, int for SHOW_INT,
|
|
|
|
longlong for SHOW_LONGLONG, etc).
|
|
|
|
*/
|
|
|
|
virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base);
|
|
|
|
virtual uchar *global_value_ptr(THD *thd, LEX_STRING *base);
|
WL#2977 and WL#2712 global and session-level variable to set the binlog format (row/statement),
and new binlog format called "mixed" (which is statement-based except if only row-based is correct,
in this cset it means if UDF or UUID is used; more cases could be added in later 5.1 release):
SET GLOBAL|SESSION BINLOG_FORMAT=row|statement|mixed|default;
the global default is statement unless cluster is enabled (then it's row) as in 5.1-alpha.
It's not possible to use SET on this variable if a session is currently in row-based mode and has open temporary tables (because CREATE
TEMPORARY TABLE was not binlogged so temp table is not known on slave), or if NDB is enabled (because
NDB does not support such change on-the-fly, though it will later), of if in a stored function (see below).
The added tests test the possibility or impossibility to SET, their effects, and the mixed mode,
including in prepared statements and in stored procedures and functions.
Caveats:
a) The mixed mode will not work for stored functions: in mixed mode, a stored function will
always be binlogged as one call and in a statement-based way (e.g. INSERT VALUES(myfunc()) or SELECT myfunc()).
b) for the same reason, changing the thread's binlog format inside a stored function is
refused with an error message.
c) the same problems apply to triggers; implementing b) for triggers will be done later (will ask
Dmitri).
Additionally, as the binlog format is now changeable by each user for his session, I remove the implication
which was done at startup, where row-based automatically set log-bin-trust-routine-creators to 1
(not possible anymore as a user can now switch to stmt-based and do nasty things again), and automatically
set --innodb-locks-unsafe-for-binlog to 1 (was anyway theoretically incorrect as it disabled
phantom protection).
Plus fixes for compiler warnings.
2006-02-25 22:21:03 +01:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
/**
|
|
|
|
A pointer to a storage area of the variable, to the raw data.
|
|
|
|
Typically it's the same as session_value_ptr(), but it's different,
|
|
|
|
for example, for ENUM, that is printed as a string, but stored as a number.
|
|
|
|
*/
|
|
|
|
uchar *session_var_ptr(THD *thd)
|
|
|
|
{ return ((uchar*)&(thd->variables)) + offset; }
|
|
|
|
|
|
|
|
uchar *global_var_ptr()
|
|
|
|
{ return ((uchar*)&global_system_variables) + offset; }
|
WL#2977 and WL#2712 global and session-level variable to set the binlog format (row/statement),
and new binlog format called "mixed" (which is statement-based except if only row-based is correct,
in this cset it means if UDF or UUID is used; more cases could be added in later 5.1 release):
SET GLOBAL|SESSION BINLOG_FORMAT=row|statement|mixed|default;
the global default is statement unless cluster is enabled (then it's row) as in 5.1-alpha.
It's not possible to use SET on this variable if a session is currently in row-based mode and has open temporary tables (because CREATE
TEMPORARY TABLE was not binlogged so temp table is not known on slave), or if NDB is enabled (because
NDB does not support such change on-the-fly, though it will later), of if in a stored function (see below).
The added tests test the possibility or impossibility to SET, their effects, and the mixed mode,
including in prepared statements and in stored procedures and functions.
Caveats:
a) The mixed mode will not work for stored functions: in mixed mode, a stored function will
always be binlogged as one call and in a statement-based way (e.g. INSERT VALUES(myfunc()) or SELECT myfunc()).
b) for the same reason, changing the thread's binlog format inside a stored function is
refused with an error message.
c) the same problems apply to triggers; implementing b) for triggers will be done later (will ask
Dmitri).
Additionally, as the binlog format is now changeable by each user for his session, I remove the implication
which was done at startup, where row-based automatically set log-bin-trust-routine-creators to 1
(not possible anymore as a user can now switch to stmt-based and do nasty things again), and automatically
set --innodb-locks-unsafe-for-binlog to 1 (was anyway theoretically incorrect as it disabled
phantom protection).
Plus fixes for compiler warnings.
2006-02-25 22:21:03 +01:00
|
|
|
};
|
2005-12-06 16:15:29 +01:00
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
#include "sql_plugin.h" /* SHOW_HA_ROWS, SHOW_MY_BOOL */
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/****************************************************************************
|
|
|
|
Classes for parsing of the SET command
|
|
|
|
****************************************************************************/
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
/**
|
|
|
|
A base class for everything that can be set with SET command.
|
|
|
|
It's similar to Items, an instance of this is created by the parser
|
|
|
|
for every assigmnent in SET (or elsewhere, e.g. in SELECT).
|
|
|
|
*/
|
2002-07-23 17:31:22 +02:00
|
|
|
class set_var_base :public Sql_alloc
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
set_var_base() {}
|
|
|
|
virtual ~set_var_base() {}
|
2009-12-22 10:35:56 +01:00
|
|
|
virtual int check(THD *thd)=0; /* To check privileges etc. */
|
|
|
|
virtual int update(THD *thd)=0; /* To set the value */
|
|
|
|
virtual int light_check(THD *thd) { return check(thd); } /* for PS */
|
2002-07-23 17:31:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
/**
|
|
|
|
set_var_base descendant for assignments to the system variables.
|
|
|
|
*/
|
2002-07-23 17:31:22 +02:00
|
|
|
class set_var :public set_var_base
|
|
|
|
{
|
|
|
|
public:
|
2009-12-22 10:35:56 +01:00
|
|
|
sys_var *var; ///< system variable to be updated
|
|
|
|
Item *value; ///< the expression that provides the new value of the variable
|
2002-07-23 17:31:22 +02:00
|
|
|
enum_var_type type;
|
2009-12-22 10:35:56 +01:00
|
|
|
union ///< temp storage to hold a value between sys_var::check and ::update
|
|
|
|
{
|
|
|
|
ulonglong ulonglong_value; ///< for all integer, set, enum sysvars
|
|
|
|
double double_value; ///< for Sys_var_double
|
|
|
|
plugin_ref plugin; ///< for Sys_var_plugin
|
|
|
|
Time_zone *time_zone; ///< for Sys_var_tz
|
|
|
|
LEX_STRING string_value; ///< for Sys_var_charptr and others
|
|
|
|
void *ptr; ///< for Sys_var_struct
|
2002-07-23 17:31:22 +02:00
|
|
|
} save_result;
|
2009-12-22 10:35:56 +01:00
|
|
|
LEX_STRING base; /**< for structured variables, like keycache_name.variable_name */
|
2002-07-23 17:31:22 +02:00
|
|
|
|
2006-12-14 23:51:37 +01:00
|
|
|
set_var(enum_var_type type_arg, sys_var *var_arg,
|
|
|
|
const LEX_STRING *base_name_arg, Item *value_arg)
|
2003-08-18 23:08:08 +02:00
|
|
|
:var(var_arg), type(type_arg), base(*base_name_arg)
|
2002-07-23 17:31:22 +02:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
If the set value is a field, change it to a string to allow things like
|
|
|
|
SET table_type=MYISAM;
|
|
|
|
*/
|
|
|
|
if (value_arg && value_arg->type() == Item::FIELD_ITEM)
|
|
|
|
{
|
|
|
|
Item_field *item= (Item_field*) value_arg;
|
2009-12-22 10:35:56 +01:00
|
|
|
if (!(value=new Item_string(item->field_name,
|
2009-10-15 14:23:43 +02:00
|
|
|
(uint) strlen(item->field_name),
|
2009-12-22 10:35:56 +01:00
|
|
|
system_charset_info))) // names are utf8
|
|
|
|
value=value_arg; /* Give error message later */
|
2002-07-23 17:31:22 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
value=value_arg;
|
|
|
|
}
|
2002-09-22 17:02:39 +02:00
|
|
|
int check(THD *thd);
|
|
|
|
int update(THD *thd);
|
2004-04-07 23:16:17 +02:00
|
|
|
int light_check(THD *thd);
|
2002-07-23 17:31:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* User variables like @my_own_variable */
|
|
|
|
class set_var_user: public set_var_base
|
|
|
|
{
|
|
|
|
Item_func_set_user_var *user_var_item;
|
|
|
|
public:
|
|
|
|
set_var_user(Item_func_set_user_var *item)
|
|
|
|
:user_var_item(item)
|
|
|
|
{}
|
2002-09-22 17:02:39 +02:00
|
|
|
int check(THD *thd);
|
|
|
|
int update(THD *thd);
|
2004-04-07 23:16:17 +02:00
|
|
|
int light_check(THD *thd);
|
2002-07-23 17:31:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* For SET PASSWORD */
|
|
|
|
|
|
|
|
class set_var_password: public set_var_base
|
|
|
|
{
|
|
|
|
LEX_USER *user;
|
|
|
|
char *password;
|
|
|
|
public:
|
|
|
|
set_var_password(LEX_USER *user_arg,char *password_arg)
|
|
|
|
:user(user_arg), password(password_arg)
|
|
|
|
{}
|
2002-09-22 17:02:39 +02:00
|
|
|
int check(THD *thd);
|
|
|
|
int update(THD *thd);
|
2002-07-23 17:31:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-04-05 12:59:29 +02:00
|
|
|
/* For SET NAMES and SET CHARACTER SET */
|
|
|
|
|
2003-04-23 15:19:22 +02:00
|
|
|
class set_var_collation_client: public set_var_base
|
2003-04-05 12:59:29 +02:00
|
|
|
{
|
2003-05-21 14:44:12 +02:00
|
|
|
CHARSET_INFO *character_set_client;
|
|
|
|
CHARSET_INFO *character_set_results;
|
2003-04-23 15:19:22 +02:00
|
|
|
CHARSET_INFO *collation_connection;
|
2003-04-05 12:59:29 +02:00
|
|
|
public:
|
2003-04-23 15:19:22 +02:00
|
|
|
set_var_collation_client(CHARSET_INFO *client_coll_arg,
|
2009-12-22 10:35:56 +01:00
|
|
|
CHARSET_INFO *connection_coll_arg,
|
|
|
|
CHARSET_INFO *result_coll_arg)
|
2003-05-21 14:44:12 +02:00
|
|
|
:character_set_client(client_coll_arg),
|
|
|
|
character_set_results(result_coll_arg),
|
|
|
|
collation_connection(connection_coll_arg)
|
2003-04-05 12:59:29 +02:00
|
|
|
{}
|
|
|
|
int check(THD *thd);
|
|
|
|
int update(THD *thd);
|
|
|
|
};
|
|
|
|
|
2010-03-31 16:05:33 +02:00
|
|
|
|
|
|
|
/* optional things, have_* variables */
|
|
|
|
extern SHOW_COMP_OPTION have_csv, have_innodb;
|
|
|
|
extern SHOW_COMP_OPTION have_ndbcluster, have_partitioning;
|
|
|
|
extern SHOW_COMP_OPTION have_profiling;
|
|
|
|
|
|
|
|
extern SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen;
|
|
|
|
extern SHOW_COMP_OPTION have_query_cache;
|
|
|
|
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
|
|
|
|
extern SHOW_COMP_OPTION have_crypt;
|
|
|
|
extern SHOW_COMP_OPTION have_compress;
|
|
|
|
|
2002-07-23 17:31:22 +02:00
|
|
|
/*
|
|
|
|
Prototypes for helper functions
|
|
|
|
*/
|
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
SHOW_VAR* enumerate_sys_vars(THD *thd, bool sorted, enum enum_var_type type);
|
|
|
|
|
2007-03-02 17:43:45 +01:00
|
|
|
sys_var *find_sys_var(THD *thd, const char *str, uint length=0);
|
2002-09-22 17:02:39 +02:00
|
|
|
int sql_set_variables(THD *thd, List<set_var_base> *var_list);
|
2009-12-22 10:35:56 +01:00
|
|
|
|
|
|
|
bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type);
|
|
|
|
|
|
|
|
ulong expand_sql_mode(ulonglong sql_mode);
|
|
|
|
bool sql_mode_string_representation(THD *thd, ulong sql_mode, LEX_STRING *ls);
|
|
|
|
|
|
|
|
extern sys_var *Sys_autocommit_ptr;
|
|
|
|
|
2003-04-05 15:56:15 +02:00
|
|
|
CHARSET_INFO *get_old_charset_by_name(const char *old_name);
|
2003-07-06 18:09:57 +02:00
|
|
|
|
2010-01-07 06:42:07 +01:00
|
|
|
int sys_var_init();
|
|
|
|
int sys_var_add_options(DYNAMIC_ARRAY *long_options, int parse_flags);
|
2009-12-22 10:35:56 +01:00
|
|
|
void sys_var_end(void);
|
2006-06-19 15:30:55 +02:00
|
|
|
|
2009-12-22 10:35:56 +01:00
|
|
|
#endif
|
2009-09-23 23:32:31 +02:00
|
|
|
|