Commit b52ab3bd authored by unknown's avatar unknown

Merge polly.(none):/home/kaa/src/opt/bug29131/my50-bug29131

into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
parents 55680848 6eced1b8
......@@ -796,6 +796,22 @@ ERROR HY000: Variable 'hostname' is a read only variable
show variables like 'hostname';
Variable_name Value
hostname #
SHOW VARIABLES LIKE 'log';
Variable_name Value
log ON
SELECT @@log;
@@log
1
SET GLOBAL log=0;
ERROR HY000: Variable 'log' is a read only variable
SHOW VARIABLES LIKE 'log_slow_queries';
Variable_name Value
log_slow_queries ON
SELECT @@log_slow_queries;
@@log_slow_queries
1
SET GLOBAL log_slow_queries=0;
ERROR HY000: Variable 'log_slow_queries' is a read only variable
End of 5.0 tests
set global binlog_cache_size =@my_binlog_cache_size;
set global connect_timeout =@my_connect_timeout;
......
......@@ -682,6 +682,20 @@ set @@hostname= "anothername";
--replace_column 2 #
show variables like 'hostname';
#
# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
#
SHOW VARIABLES LIKE 'log';
SELECT @@log;
--error 1238
SET GLOBAL log=0;
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@log_slow_queries;
--error 1238
SET GLOBAL log_slow_queries=0;
--echo End of 5.0 tests
# This is at the very after the versioned tests, since it involves doing
......
......@@ -1310,8 +1310,8 @@ extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
extern bool opt_using_transactions, mysqld_embedded;
extern bool using_update_log, opt_large_files, server_id_supplied;
extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log;
extern my_bool opt_log_queries_not_using_indexes;
extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log, opt_log_queries_not_using_indexes;
extern bool opt_disable_networking, opt_skip_show_db;
extern my_bool opt_character_set_client_handshake;
extern bool volatile abort_loop, shutdown_in_progress, grant_option;
......
......@@ -339,8 +339,8 @@ static my_bool opt_sync_bdb_logs;
/* Global variables */
bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
my_bool opt_log_queries_not_using_indexes= 0;
bool opt_update_log, opt_bin_log;
my_bool opt_log, opt_slow_log, opt_log_queries_not_using_indexes= 0;
bool opt_error_log= IF_WIN(1,0);
bool opt_disable_networking=0, opt_skip_show_db=0;
my_bool opt_character_set_client_handshake= 1;
......
......@@ -201,6 +201,7 @@ sys_var_key_cache_long sys_key_cache_age_threshold("key_cache_age_threshold",
param_age_threshold));
sys_var_bool_ptr sys_local_infile("local_infile",
&opt_local_infile);
sys_var_bool_const_ptr sys_log("log", &opt_log);
sys_var_trust_routine_creators
sys_trust_routine_creators("log_bin_trust_routine_creators",
&trust_function_creators);
......@@ -213,6 +214,7 @@ sys_var_bool_ptr
sys_var_thd_ulong sys_log_warnings("log_warnings", &SV::log_warnings);
sys_var_thd_ulong sys_long_query_time("long_query_time",
&SV::long_query_time);
sys_var_bool_const_ptr sys_log_slow("log_slow_queries", &opt_slow_log);
sys_var_thd_bool sys_low_priority_updates("low_priority_updates",
&SV::low_priority_updates,
fix_low_priority_updates);
......@@ -665,9 +667,11 @@ sys_var *sys_variables[]=
&sys_lc_time_names,
&sys_license,
&sys_local_infile,
&sys_log,
&sys_log_binlog,
&sys_log_off,
&sys_log_queries_not_using_indexes,
&sys_log_slow,
&sys_log_update,
&sys_log_warnings,
&sys_long_query_time,
......@@ -946,7 +950,7 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_MLOCKALL
{"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL},
#endif
{"log", (char*) &opt_log, SHOW_BOOL},
{sys_log.name, (char*) &sys_log, SHOW_SYS},
{"log_bin", (char*) &opt_bin_log, SHOW_BOOL},
{sys_trust_function_creators.name,(char*) &sys_trust_function_creators, SHOW_SYS},
{"log_error", (char*) log_error_file, SHOW_CHAR},
......@@ -955,7 +959,7 @@ struct show_var_st init_vars[]= {
#ifdef HAVE_REPLICATION
{"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL},
#endif
{"log_slow_queries", (char*) &opt_slow_log, SHOW_BOOL},
{sys_log_slow.name, (char*) &sys_log_slow, SHOW_SYS},
{sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS},
{sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS},
{sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS},
......
......@@ -160,6 +160,28 @@ public:
};
class sys_var_bool_const_ptr : public sys_var
{
public:
my_bool *value;
sys_var_bool_const_ptr(const char *name_arg, my_bool *value_arg)
:sys_var(name_arg),value(value_arg)
{}
bool check(THD *thd, set_var *var)
{
return 1;
}
bool update(THD *thd, set_var *var)
{
return 1;
}
SHOW_TYPE show_type() { return SHOW_MY_BOOL; }
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
{ return (byte*) value; }
bool check_update_type(Item_result type) { return 0; }
bool is_readonly() const { return 1; }
};
class sys_var_str :public sys_var
{
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment