summaryrefslogtreecommitdiff
path: root/mysql-test/t/variables-notembedded.test
diff options
context:
space:
mode:
authorIngo Struewing <ingo.struewing@sun.com>2008-11-22 00:22:21 +0100
committerIngo Struewing <ingo.struewing@sun.com>2008-11-22 00:22:21 +0100
commitf92c5731453fd73077bb4a8034a5c351d89f091f (patch)
treea8e411aa264d817a003cdcf4cbcd4eae74aab63b /mysql-test/t/variables-notembedded.test
parent75a6be98e06587190472106b582723944b76426b (diff)
downloadmariadb-git-f92c5731453fd73077bb4a8034a5c351d89f091f.tar.gz
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().
Diffstat (limited to 'mysql-test/t/variables-notembedded.test')
-rw-r--r--mysql-test/t/variables-notembedded.test80
1 files changed, 80 insertions, 0 deletions
diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test
index 79011a89b36..823fecb8791 100644
--- a/mysql-test/t/variables-notembedded.test
+++ b/mysql-test/t/variables-notembedded.test
@@ -28,3 +28,83 @@ set global slave_net_timeout=default;
# sql_slave_skip_counter is write-only, so we can't save previous
# value and restore it here. That's ok, because it's normally 0.
set global sql_slave_skip_counter= 0;
+
+#
+# Bug#28234 - global/session scope - documentation vs implementation
+#
+--echo
+#
+# Additional variables fixed from sql_repl.cc.
+#
+--echo #
+SHOW VARIABLES like 'log_slave_updates';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_slave_updates;
+SELECT @@global.log_slave_updates;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_slave_updates= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_slave_updates= true;
+#
+--echo #
+SHOW VARIABLES like 'relay_log';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log;
+SELECT @@global.relay_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log= 'x';
+#
+--echo #
+SHOW VARIABLES like 'relay_log_index';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_index;
+SELECT @@global.relay_log_index;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_index= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_index= 'x';
+#
+--echo #
+SHOW VARIABLES like 'relay_log_info_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_info_file;
+SELECT @@global.relay_log_info_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_info_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_info_file= 'x';
+#
+--echo #
+SHOW VARIABLES like 'relay_log_space_limit';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_space_limit;
+SELECT @@global.relay_log_space_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_space_limit= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_space_limit= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'slave_load_tmpdir';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.slave_load_tmpdir;
+--replace_column 1 #
+SELECT @@global.slave_load_tmpdir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.slave_load_tmpdir= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.slave_load_tmpdir= 'x';
+#
+--echo #
+SHOW VARIABLES like 'slave_skip_errors';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.slave_skip_errors;
+SELECT @@global.slave_skip_errors;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.slave_skip_errors= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.slave_skip_errors= 7;
+#