mariadb/mysql-test/r/variables-notembedded.result
Ingo Struewing f92c573145 Bug#28234 - global/session scope - documentation vs implementation
Several system variables did not behave like system variables should do.
When trying to SET them or use them in SELECT, they were reported as
"unknown system variable". But they appeared in SHOW VARIABLES.

This has been fixed by removing the "fixed_vars" array of variables
and integrating the variables into the normal system variables chain.
All of these variables do now behave as read-only global-only
variables. Trying to SET them tells they are read-only, trying to
SELECT the session value tells they are global only. Selecting the
global value works. It delivers the same value as SHOW VARIABLES.


mysql-test/r/variables-notembedded.result:
  Bug#28234 - global/session scope - documentation vs implementation
  New test result.
mysql-test/r/variables.result:
  Bug#28234 - global/session scope - documentation vs implementation
  New test result.
mysql-test/t/variables-notembedded.test:
  Bug#28234 - global/session scope - documentation vs implementation
  Added a test for each moved variable that is not present in an
  embedded server.
mysql-test/t/variables.test:
  Bug#28234 - global/session scope - documentation vs implementation
  Added a test for each moved variable that is also present in an
  embedded server.
sql/item_func.cc:
  Bug#28234 - global/session scope - documentation vs implementation
  Added SHOW_BOOL to some Item_func_get_system_var methods.
sql/set_var.cc:
  Bug#28234 - global/session scope - documentation vs implementation
  Moved all variables from the "fixed_vars" array into the normal
  system variables chain by using the new variable class sys_var_const.
  Removed the fixed_show_vars array and its initialization in
  enumerate_sys_vars().
  Removed mysql_append_static_vars(), which added fixed_vars arrays
  to the fixed_show_vars array.
sql/set_var.h:
  Bug#28234 - global/session scope - documentation vs implementation
  Added the new system variable class sys_var_const.
  Removed declaration of mysql_append_static_vars().
sql/slave.cc:
  Bug#28234 - global/session scope - documentation vs implementation
  Moved the definition of show_slave_skip_errors() from sql_repl.cc
  to here and renamed it to print_slave_skip_errors().
  Changed print_slave_skip_errors() to create a static buffer with
  a printable version of the error numbers set.
  Added a call of print_slave_skip_errors() to init_slave_skip_errors().
sql/slave.h:
  Bug#28234 - global/session scope - documentation vs implementation
  Added declaration of slave_skip_error_names.
sql/sql_repl.cc:
  Bug#28234 - global/session scope - documentation vs implementation
  Moved all variables from the "fixed_vars" array into the normal
  system variables chain by using the new variable class sys_var_const.
  Moved the definition of show_slave_skip_errors() to slave.cc and
  modified it to compute the string once at server initialization only.
  Removed the call to mysql_append_static_vars().
2008-11-22 00:22:21 +01:00

109 lines
3.7 KiB
Text

---- Init ----
set @my_slave_net_timeout =@@global.slave_net_timeout;
---- Test ----
set global slave_net_timeout=100;
set global sql_slave_skip_counter=100;
show variables like 'slave_compressed_protocol';
Variable_name Value
slave_compressed_protocol OFF
show variables like 'slave_load_tmpdir';
Variable_name Value
slave_load_tmpdir SLAVE_LOAD_TMPDIR
show variables like 'slave_skip_errors';
Variable_name Value
slave_skip_errors 3,100,137,643,1752
---- Clean Up ----
set global slave_net_timeout=default;
set global sql_slave_skip_counter= 0;
#
SHOW VARIABLES like 'log_slave_updates';
Variable_name Value
log_slave_updates OFF
SELECT @@session.log_slave_updates;
ERROR HY000: Variable 'log_slave_updates' is a GLOBAL variable
SELECT @@global.log_slave_updates;
@@global.log_slave_updates
0
SET @@session.log_slave_updates= true;
ERROR HY000: Variable 'log_slave_updates' is a read only variable
SET @@global.log_slave_updates= true;
ERROR HY000: Variable 'log_slave_updates' is a read only variable
#
SHOW VARIABLES like 'relay_log';
Variable_name Value
relay_log
SELECT @@session.relay_log;
ERROR HY000: Variable 'relay_log' is a GLOBAL variable
SELECT @@global.relay_log;
@@global.relay_log
NULL
SET @@session.relay_log= 'x';
ERROR HY000: Variable 'relay_log' is a read only variable
SET @@global.relay_log= 'x';
ERROR HY000: Variable 'relay_log' is a read only variable
#
SHOW VARIABLES like 'relay_log_index';
Variable_name Value
relay_log_index
SELECT @@session.relay_log_index;
ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
SELECT @@global.relay_log_index;
@@global.relay_log_index
NULL
SET @@session.relay_log_index= 'x';
ERROR HY000: Variable 'relay_log_index' is a read only variable
SET @@global.relay_log_index= 'x';
ERROR HY000: Variable 'relay_log_index' is a read only variable
#
SHOW VARIABLES like 'relay_log_info_file';
Variable_name Value
relay_log_info_file relay-log.info
SELECT @@session.relay_log_info_file;
ERROR HY000: Variable 'relay_log_info_file' is a GLOBAL variable
SELECT @@global.relay_log_info_file;
@@global.relay_log_info_file
relay-log.info
SET @@session.relay_log_info_file= 'x';
ERROR HY000: Variable 'relay_log_info_file' is a read only variable
SET @@global.relay_log_info_file= 'x';
ERROR HY000: Variable 'relay_log_info_file' is a read only variable
#
SHOW VARIABLES like 'relay_log_space_limit';
Variable_name Value
relay_log_space_limit 0
SELECT @@session.relay_log_space_limit;
ERROR HY000: Variable 'relay_log_space_limit' is a GLOBAL variable
SELECT @@global.relay_log_space_limit;
@@global.relay_log_space_limit
0
SET @@session.relay_log_space_limit= 7;
ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
SET @@global.relay_log_space_limit= 7;
ERROR HY000: Variable 'relay_log_space_limit' is a read only variable
#
SHOW VARIABLES like 'slave_load_tmpdir';
Variable_name Value
slave_load_tmpdir #
SELECT @@session.slave_load_tmpdir;
ERROR HY000: Variable 'slave_load_tmpdir' is a GLOBAL variable
SELECT @@global.slave_load_tmpdir;
@@global.slave_load_tmpdir
#
SET @@session.slave_load_tmpdir= 'x';
ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
SET @@global.slave_load_tmpdir= 'x';
ERROR HY000: Variable 'slave_load_tmpdir' is a read only variable
#
SHOW VARIABLES like 'slave_skip_errors';
Variable_name Value
slave_skip_errors 3,100,137,643,1752
SELECT @@session.slave_skip_errors;
ERROR HY000: Variable 'slave_skip_errors' is a GLOBAL variable
SELECT @@global.slave_skip_errors;
@@global.slave_skip_errors
3,100,137,643,1752
SET @@session.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable
SET @@global.slave_skip_errors= 7;
ERROR HY000: Variable 'slave_skip_errors' is a read only variable