summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorIngo Struewing <ingo.struewing@sun.com>2008-11-26 12:32:22 +0100
committerIngo Struewing <ingo.struewing@sun.com>2008-11-26 12:32:22 +0100
commit3fb68b5f94b8827526c71b82e0d7572cef960707 (patch)
tree13b7a7ccad66e32c1d77605e13e6e60a25a7b602 /mysql-test
parenta8d3f0325b6c0ae3a4cb47e3991c1a14e804e470 (diff)
parentcff0a6b65cf5f848e9a64d564fde785a6772dbae (diff)
downloadmariadb-git-3fb68b5f94b8827526c71b82e0d7572cef960707.tar.gz
merge
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/timestamp_func.result44
-rw-r--r--mysql-test/r/timestamp_sysdate_is_now_func.result25
-rw-r--r--mysql-test/r/variables-notembedded.result92
-rw-r--r--mysql-test/r/variables.result339
-rw-r--r--mysql-test/t/timestamp_func.test69
-rw-r--r--mysql-test/t/timestamp_sysdate_is_now_func-master.opt1
-rw-r--r--mysql-test/t/timestamp_sysdate_is_now_func.test47
-rw-r--r--mysql-test/t/variables-notembedded.test80
-rw-r--r--mysql-test/t/variables.test296
9 files changed, 918 insertions, 75 deletions
diff --git a/mysql-test/r/timestamp_func.result b/mysql-test/r/timestamp_func.result
index ed51cec4227..1b49331c069 100644
--- a/mysql-test/r/timestamp_func.result
+++ b/mysql-test/r/timestamp_func.result
@@ -1,33 +1,25 @@
-** Setup **
-
-** Connecting con0 using root **
** Connecting con1 using root **
-'#-----------------------------FN_DYNVARS_179_01------------------#'
-** Connection con0 **
-SET @ts_old = @@SESSION.timestamp;
-waiting 1 sec
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
-Timestamp Difference
+SELECT date(now()) = date(sysdate());
+date(now()) = date(sysdate())
+1
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+1
+** Connecting con0 using root **
+SELECT @@session.timestamp != 1100000000;
+@@session.timestamp != 1100000000
+1
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
1
-1 means >=1 expected is true
** Connection con1 **
-SET @ts_old = @@SESSION.timestamp;
-waiting 4 sec
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
-Timestamp Difference
+SELECT @@session.timestamp != 1000000000;
+@@session.timestamp != 1000000000
1
-1 means >=4 expected is true
-'#-----------------------------FN_DYNVARS_179_02---------------------#'
-SET @ts_old = @@SESSION.timestamp;
-Changing time zone
-SET time_zone = 'MET';
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
-Timestamp Difference
+SELECT @@session.timestamp = 1100000000;
+@@session.timestamp = 1100000000
1
-1 means >=1 expected is true
-** Cleanup **
** Connection default **
Disconnecting Connections con0, con1
diff --git a/mysql-test/r/timestamp_sysdate_is_now_func.result b/mysql-test/r/timestamp_sysdate_is_now_func.result
new file mode 100644
index 00000000000..e24ff2e962a
--- /dev/null
+++ b/mysql-test/r/timestamp_sysdate_is_now_func.result
@@ -0,0 +1,25 @@
+** Connecting con1 using root **
+SELECT date(now()) = date(sysdate());
+date(now()) = date(sysdate())
+1
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+0
+** Connecting con0 using root **
+SELECT @@session.timestamp != 1100000000;
+@@session.timestamp != 1100000000
+1
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+date(now()) != date(sysdate())
+0
+** Connection con1 **
+SELECT @@session.timestamp != 1000000000;
+@@session.timestamp != 1000000000
+1
+SELECT @@session.timestamp = 1100000000;
+@@session.timestamp = 1100000000
+1
+** Connection default **
+Disconnecting Connections con0, con1
diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result
index 48a1719e2c7..571b6605674 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -15,3 +15,95 @@ 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
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index c52f7f3578e..878416b4537 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -1011,3 +1011,342 @@ SET GLOBAL log_output = 0;
ERROR 42000: Variable 'log_output' can't be set to the value of '0'
# -- End of Bug#34820.
+
+#
+SHOW VARIABLES like 'ft_max_word_len';
+Variable_name Value
+ft_max_word_len 84
+SELECT @@session.ft_max_word_len;
+ERROR HY000: Variable 'ft_max_word_len' is a GLOBAL variable
+SELECT @@global.ft_max_word_len;
+@@global.ft_max_word_len
+84
+SET @@session.ft_max_word_len= 7;
+ERROR HY000: Variable 'ft_max_word_len' is a read only variable
+SET @@global.ft_max_word_len= 7;
+ERROR HY000: Variable 'ft_max_word_len' is a read only variable
+#
+SHOW VARIABLES like 'ft_min_word_len';
+Variable_name Value
+ft_min_word_len 4
+SELECT @@session.ft_min_word_len;
+ERROR HY000: Variable 'ft_min_word_len' is a GLOBAL variable
+SELECT @@global.ft_min_word_len;
+@@global.ft_min_word_len
+4
+SET @@session.ft_min_word_len= 7;
+ERROR HY000: Variable 'ft_min_word_len' is a read only variable
+SET @@global.ft_min_word_len= 7;
+ERROR HY000: Variable 'ft_min_word_len' is a read only variable
+#
+SHOW VARIABLES like 'ft_query_expansion_limit';
+Variable_name Value
+ft_query_expansion_limit 20
+SELECT @@session.ft_query_expansion_limit;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a GLOBAL variable
+SELECT @@global.ft_query_expansion_limit;
+@@global.ft_query_expansion_limit
+20
+SET @@session.ft_query_expansion_limit= 7;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
+SET @@global.ft_query_expansion_limit= 7;
+ERROR HY000: Variable 'ft_query_expansion_limit' is a read only variable
+#
+SHOW VARIABLES like 'ft_stopword_file';
+Variable_name Value
+ft_stopword_file (built-in)
+SELECT @@session.ft_stopword_file;
+ERROR HY000: Variable 'ft_stopword_file' is a GLOBAL variable
+SELECT @@global.ft_stopword_file;
+@@global.ft_stopword_file
+(built-in)
+SET @@session.ft_stopword_file= 'x';
+ERROR HY000: Variable 'ft_stopword_file' is a read only variable
+SET @@global.ft_stopword_file= 'x';
+ERROR HY000: Variable 'ft_stopword_file' is a read only variable
+#
+SHOW VARIABLES like 'back_log';
+Variable_name Value
+back_log 50
+SELECT @@session.back_log;
+ERROR HY000: Variable 'back_log' is a GLOBAL variable
+SELECT @@global.back_log;
+@@global.back_log
+50
+SET @@session.back_log= 7;
+ERROR HY000: Variable 'back_log' is a read only variable
+SET @@global.back_log= 7;
+ERROR HY000: Variable 'back_log' is a read only variable
+#
+SHOW VARIABLES like 'large_files_support';
+Variable_name Value
+large_files_support #
+SELECT @@session.large_files_support;
+ERROR HY000: Variable 'large_files_support' is a GLOBAL variable
+SELECT @@global.large_files_support;
+@@global.large_files_support
+#
+SET @@session.large_files_support= true;
+ERROR HY000: Variable 'large_files_support' is a read only variable
+SET @@global.large_files_support= true;
+ERROR HY000: Variable 'large_files_support' is a read only variable
+#
+SHOW VARIABLES like 'character_sets_dir';
+Variable_name Value
+character_sets_dir #
+SELECT @@session.character_sets_dir;
+ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable
+SELECT @@global.character_sets_dir;
+@@global.character_sets_dir
+#
+SET @@session.character_sets_dir= 'x';
+ERROR HY000: Variable 'character_sets_dir' is a read only variable
+SET @@global.character_sets_dir= 'x';
+ERROR HY000: Variable 'character_sets_dir' is a read only variable
+#
+SHOW VARIABLES like 'init_file';
+Variable_name Value
+init_file #
+SELECT @@session.init_file;
+ERROR HY000: Variable 'init_file' is a GLOBAL variable
+SELECT @@global.init_file;
+@@global.init_file
+#
+SET @@session.init_file= 'x';
+ERROR HY000: Variable 'init_file' is a read only variable
+SET @@global.init_file= 'x';
+ERROR HY000: Variable 'init_file' is a read only variable
+#
+SHOW VARIABLES like 'language';
+Variable_name Value
+language #
+SELECT @@session.language;
+ERROR HY000: Variable 'language' is a GLOBAL variable
+SELECT @@global.language;
+@@global.language
+#
+SET @@session.language= 'x';
+ERROR HY000: Variable 'language' is a read only variable
+SET @@global.language= 'x';
+ERROR HY000: Variable 'language' is a read only variable
+#
+SHOW VARIABLES like 'large_page_size';
+Variable_name Value
+large_page_size #
+SELECT @@session.large_page_size;
+ERROR HY000: Variable 'large_page_size' is a GLOBAL variable
+SELECT @@global.large_page_size;
+@@global.large_page_size
+#
+SET @@session.large_page_size= 7;
+ERROR HY000: Variable 'large_page_size' is a read only variable
+SET @@global.large_page_size= 7;
+ERROR HY000: Variable 'large_page_size' is a read only variable
+#
+SHOW VARIABLES like 'large_pages';
+Variable_name Value
+large_pages #
+SELECT @@session.large_pages;
+ERROR HY000: Variable 'large_pages' is a GLOBAL variable
+SELECT @@global.large_pages;
+@@global.large_pages
+#
+SET @@session.large_pages= true;
+ERROR HY000: Variable 'large_pages' is a read only variable
+SET @@global.large_pages= true;
+ERROR HY000: Variable 'large_pages' is a read only variable
+#
+SHOW VARIABLES like 'log_bin';
+Variable_name Value
+log_bin OFF
+SELECT @@session.log_bin;
+ERROR HY000: Variable 'log_bin' is a GLOBAL variable
+SELECT @@global.log_bin;
+@@global.log_bin
+0
+SET @@session.log_bin= true;
+ERROR HY000: Variable 'log_bin' is a read only variable
+SET @@global.log_bin= true;
+ERROR HY000: Variable 'log_bin' is a read only variable
+#
+SHOW VARIABLES like 'log_error';
+Variable_name Value
+log_error #
+SELECT @@session.log_error;
+ERROR HY000: Variable 'log_error' is a GLOBAL variable
+SELECT @@global.log_error;
+@@global.log_error
+#
+SET @@session.log_error= 'x';
+ERROR HY000: Variable 'log_error' is a read only variable
+SET @@global.log_error= 'x';
+ERROR HY000: Variable 'log_error' is a read only variable
+#
+SHOW VARIABLES like 'lower_case_file_system';
+Variable_name Value
+lower_case_file_system #
+SELECT @@session.lower_case_file_system;
+ERROR HY000: Variable 'lower_case_file_system' is a GLOBAL variable
+SELECT @@global.lower_case_file_system;
+@@global.lower_case_file_system
+#
+SET @@session.lower_case_file_system= true;
+ERROR HY000: Variable 'lower_case_file_system' is a read only variable
+SET @@global.lower_case_file_system= true;
+ERROR HY000: Variable 'lower_case_file_system' is a read only variable
+#
+SHOW VARIABLES like 'lower_case_table_names';
+Variable_name Value
+lower_case_table_names #
+SELECT @@session.lower_case_table_names;
+ERROR HY000: Variable 'lower_case_table_names' is a GLOBAL variable
+SELECT @@global.lower_case_table_names;
+@@global.lower_case_table_names
+#
+SET @@session.lower_case_table_names= 7;
+ERROR HY000: Variable 'lower_case_table_names' is a read only variable
+SET @@global.lower_case_table_names= 7;
+ERROR HY000: Variable 'lower_case_table_names' is a read only variable
+#
+SHOW VARIABLES like 'myisam_recover_options';
+Variable_name Value
+myisam_recover_options OFF
+SELECT @@session.myisam_recover_options;
+ERROR HY000: Variable 'myisam_recover_options' is a GLOBAL variable
+SELECT @@global.myisam_recover_options;
+@@global.myisam_recover_options
+OFF
+SET @@session.myisam_recover_options= 'x';
+ERROR HY000: Variable 'myisam_recover_options' is a read only variable
+SET @@global.myisam_recover_options= 'x';
+ERROR HY000: Variable 'myisam_recover_options' is a read only variable
+#
+SHOW VARIABLES like 'open_files_limit';
+Variable_name Value
+open_files_limit #
+SELECT @@session.open_files_limit;
+ERROR HY000: Variable 'open_files_limit' is a GLOBAL variable
+SELECT @@global.open_files_limit;
+@@global.open_files_limit
+#
+SET @@session.open_files_limit= 7;
+ERROR HY000: Variable 'open_files_limit' is a read only variable
+SET @@global.open_files_limit= 7;
+ERROR HY000: Variable 'open_files_limit' is a read only variable
+#
+SHOW VARIABLES like 'pid_file';
+Variable_name Value
+pid_file #
+SELECT @@session.pid_file;
+ERROR HY000: Variable 'pid_file' is a GLOBAL variable
+SELECT @@global.pid_file;
+@@global.pid_file
+#
+SET @@session.pid_file= 'x';
+ERROR HY000: Variable 'pid_file' is a read only variable
+SET @@global.pid_file= 'x';
+ERROR HY000: Variable 'pid_file' is a read only variable
+#
+SHOW VARIABLES like 'plugin_dir';
+Variable_name Value
+plugin_dir #
+SELECT @@session.plugin_dir;
+ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable
+SELECT @@global.plugin_dir;
+@@global.plugin_dir
+#
+SET @@session.plugin_dir= 'x';
+ERROR HY000: Variable 'plugin_dir' is a read only variable
+SET @@global.plugin_dir= 'x';
+ERROR HY000: Variable 'plugin_dir' is a read only variable
+#
+SHOW VARIABLES like 'port';
+Variable_name Value
+port #
+SELECT @@session.port;
+ERROR HY000: Variable 'port' is a GLOBAL variable
+SELECT @@global.port;
+@@global.port
+#
+SET @@session.port= 7;
+ERROR HY000: Variable 'port' is a read only variable
+SET @@global.port= 7;
+ERROR HY000: Variable 'port' is a read only variable
+#
+SHOW VARIABLES like 'protocol_version';
+Variable_name Value
+protocol_version 10
+SELECT @@session.protocol_version;
+ERROR HY000: Variable 'protocol_version' is a GLOBAL variable
+SELECT @@global.protocol_version;
+@@global.protocol_version
+10
+SET @@session.protocol_version= 7;
+ERROR HY000: Variable 'protocol_version' is a read only variable
+SET @@global.protocol_version= 7;
+ERROR HY000: Variable 'protocol_version' is a read only variable
+#
+SHOW VARIABLES like 'skip_external_locking';
+Variable_name Value
+skip_external_locking ON
+SELECT @@session.skip_external_locking;
+ERROR HY000: Variable 'skip_external_locking' is a GLOBAL variable
+SELECT @@global.skip_external_locking;
+@@global.skip_external_locking
+1
+SET @@session.skip_external_locking= true;
+ERROR HY000: Variable 'skip_external_locking' is a read only variable
+SET @@global.skip_external_locking= true;
+ERROR HY000: Variable 'skip_external_locking' is a read only variable
+#
+SHOW VARIABLES like 'skip_networking';
+Variable_name Value
+skip_networking OFF
+SELECT @@session.skip_networking;
+ERROR HY000: Variable 'skip_networking' is a GLOBAL variable
+SELECT @@global.skip_networking;
+@@global.skip_networking
+0
+SET @@session.skip_networking= true;
+ERROR HY000: Variable 'skip_networking' is a read only variable
+SET @@global.skip_networking= true;
+ERROR HY000: Variable 'skip_networking' is a read only variable
+#
+SHOW VARIABLES like 'skip_show_database';
+Variable_name Value
+skip_show_database OFF
+SELECT @@session.skip_show_database;
+ERROR HY000: Variable 'skip_show_database' is a GLOBAL variable
+SELECT @@global.skip_show_database;
+@@global.skip_show_database
+0
+SET @@session.skip_show_database= true;
+ERROR HY000: Variable 'skip_show_database' is a read only variable
+SET @@global.skip_show_database= true;
+ERROR HY000: Variable 'skip_show_database' is a read only variable
+#
+SHOW VARIABLES like 'socket';
+Variable_name Value
+socket #
+SELECT @@session.socket;
+ERROR HY000: Variable 'socket' is a GLOBAL variable
+SELECT @@global.socket;
+@@global.socket
+#
+SET @@session.socket= 'x';
+ERROR HY000: Variable 'socket' is a read only variable
+SET @@global.socket= 'x';
+ERROR HY000: Variable 'socket' is a read only variable
+#
+SHOW VARIABLES like 'thread_stack';
+Variable_name Value
+thread_stack #
+SELECT @@session.thread_stack;
+ERROR HY000: Variable 'thread_stack' is a GLOBAL variable
+SELECT @@global.thread_stack;
+@@global.thread_stack
+#
+SET @@session.thread_stack= 7;
+ERROR HY000: Variable 'thread_stack' is a read only variable
+SET @@global.thread_stack= 7;
+ERROR HY000: Variable 'thread_stack' is a read only variable
diff --git a/mysql-test/t/timestamp_func.test b/mysql-test/t/timestamp_func.test
index ecca3c7daeb..e119f1b6253 100644
--- a/mysql-test/t/timestamp_func.test
+++ b/mysql-test/t/timestamp_func.test
@@ -9,6 +9,8 @@
# Creation Date: 2008-02-25 #
# Author: Sharique Abdullah #
# #
+# Modified: HHunger 2008-08-28 Reimplemented the test completely. #
+# #
# Description: Test Cases of Dynamic System Variable "timestamp" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
@@ -17,63 +19,32 @@
# #
############################################################################
---echo ** Setup **
---echo
-#
-# Setup
-#
---echo ** Connecting con0 using root **
-connect (con0,localhost,root,,);
---echo ** Connecting con1 using root **
-connect (con1, localhost, root,,);
-
---echo '#-----------------------------FN_DYNVARS_179_01------------------#'
-#
-# Checking for connection 1
-#
+# Change timestamp which must have an effect on now(), but not on sysdate().
+# Use Unix epoch timestamp
+# All comparisons must deliver true(1)
+# Exception: --sysdate-is-now switches off this behaviour and must not be set.
---echo ** Connection con0 **
-connection con0;
-SET @ts_old = @@SESSION.timestamp;
---echo waiting 1 sec
---sleep 1
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
---echo 1 means >=1 expected is true
+--echo ** Connecting con1 using root **
+connect (con1,localhost,root,,);
+SELECT date(now()) = date(sysdate());
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+# Assure that setting of the variable has no effect on other session.
+--echo ** Connecting con0 using root **
+connect (con0,localhost,root,,);
+SELECT @@session.timestamp != 1100000000;
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
-#
-# Checking for connection 2
-#
--echo ** Connection con1 **
connection con1;
-SET @ts_old = @@SESSION.timestamp;
---echo waiting 4 sec
---sleep 4
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 4 AS 'Timestamp Difference';
---echo 1 means >=4 expected is true
-
---echo '#-----------------------------FN_DYNVARS_179_02---------------------#'
-#
-# Testing timezone change effect
-#
-
-SET @ts_old = @@SESSION.timestamp;
---sleep 1
---echo Changing time zone
-SET time_zone = 'MET';
-SET @ts_new = @@SESSION.timestamp;
-SELECT @ts_new - @ts_old >= 1 AS 'Timestamp Difference';
---echo 1 means >=1 expected is true
-
-#
-# Cleanup
-#
---echo ** Cleanup **
+SELECT @@session.timestamp != 1000000000;
+SELECT @@session.timestamp = 1100000000;
--echo ** Connection default **
connection default;
--echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
+
diff --git a/mysql-test/t/timestamp_sysdate_is_now_func-master.opt b/mysql-test/t/timestamp_sysdate_is_now_func-master.opt
new file mode 100644
index 00000000000..97a58d28032
--- /dev/null
+++ b/mysql-test/t/timestamp_sysdate_is_now_func-master.opt
@@ -0,0 +1 @@
+--sysdate-is-now
diff --git a/mysql-test/t/timestamp_sysdate_is_now_func.test b/mysql-test/t/timestamp_sysdate_is_now_func.test
new file mode 100644
index 00000000000..7ca3b4cddac
--- /dev/null
+++ b/mysql-test/t/timestamp_sysdate_is_now_func.test
@@ -0,0 +1,47 @@
+############################################################################
+# #
+# Variable Name: timestamp with sysdate-is-now #
+# Scope: GLOBAL #
+# Access Type: Dynamic #
+# Data Type: INTEGER #
+# #
+# #
+# Creation Date: 2008-11-25 #
+# Author: Horst Hunger #
+# #
+# Description: Test Cases of Dynamic System Variable "timestamp" #
+# that checks behavior of this variable in the following ways #
+# * Like timstamp_func, but with set "sysdate-is-now". #
+# #
+# Reference: http://dev.mysql.com/doc/refman/5.1/en/set-option.html #
+# #
+############################################################################
+
+# Use Unix epoch timestamp
+# Due to "--sysdate-is-now" timestamp must have an effect on both.
+# See also timestamp_func.test.
+
+--echo ** Connecting con1 using root **
+connect (con1,localhost,root,,);
+SELECT date(now()) = date(sysdate());
+SET @@session.timestamp = 1100000000;
+SELECT date(now()) != date(sysdate());
+
+# Assure that setting of the variable has no effect on other session.
+--echo ** Connecting con0 using root **
+connect (con0,localhost,root,,);
+SELECT @@session.timestamp != 1100000000;
+SET @@session.timestamp = 1000000000;
+SELECT date(now()) != date(sysdate());
+
+--echo ** Connection con1 **
+connection con1;
+SELECT @@session.timestamp != 1000000000;
+SELECT @@session.timestamp = 1100000000;
+
+--echo ** Connection default **
+connection default;
+--echo Disconnecting Connections con0, con1
+disconnect con0;
+disconnect con1;
+
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;
+#
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index e98436fa62c..1ef114b1a16 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -793,3 +793,299 @@ SET GLOBAL log_output = 0;
--echo
--echo # -- End of Bug#34820.
+#
+# Bug#28234 - global/session scope - documentation vs implementation
+#
+--echo
+--echo #
+SHOW VARIABLES like 'ft_max_word_len';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_max_word_len;
+SELECT @@global.ft_max_word_len;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_max_word_len= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_max_word_len= 7;
+#
+--echo #
+SHOW VARIABLES like 'ft_min_word_len';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_min_word_len;
+SELECT @@global.ft_min_word_len;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_min_word_len= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_min_word_len= 7;
+#
+--echo #
+SHOW VARIABLES like 'ft_query_expansion_limit';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_query_expansion_limit;
+SELECT @@global.ft_query_expansion_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_query_expansion_limit= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_query_expansion_limit= 7;
+#
+--echo #
+SHOW VARIABLES like 'ft_stopword_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.ft_stopword_file;
+SELECT @@global.ft_stopword_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.ft_stopword_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.ft_stopword_file= 'x';
+#
+# Additional variables fixed.
+#
+--echo #
+SHOW VARIABLES like 'back_log';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.back_log;
+SELECT @@global.back_log;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.back_log= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.back_log= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'large_files_support';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.large_files_support;
+--replace_column 1 #
+SELECT @@global.large_files_support;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.large_files_support= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.large_files_support= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'character_sets_dir';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.character_sets_dir;
+--replace_column 1 #
+SELECT @@global.character_sets_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.character_sets_dir= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.character_sets_dir= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'init_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.init_file;
+--replace_column 1 #
+SELECT @@global.init_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.init_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.init_file= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'language';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.language;
+--replace_column 1 #
+SELECT @@global.language;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.language= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.language= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'large_page_size';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.large_page_size;
+--replace_column 1 #
+SELECT @@global.large_page_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.large_page_size= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.large_page_size= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'large_pages';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.large_pages;
+--replace_column 1 #
+SELECT @@global.large_pages;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.large_pages= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.large_pages= true;
+#
+--echo #
+SHOW VARIABLES like 'log_bin';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_bin;
+SELECT @@global.log_bin;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_bin= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_bin= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'log_error';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_error;
+--replace_column 1 #
+SELECT @@global.log_error;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_error= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_error= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'lower_case_file_system';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.lower_case_file_system;
+--replace_column 1 #
+SELECT @@global.lower_case_file_system;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.lower_case_file_system= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.lower_case_file_system= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'lower_case_table_names';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.lower_case_table_names;
+--replace_column 1 #
+SELECT @@global.lower_case_table_names;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.lower_case_table_names= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.lower_case_table_names= 7;
+#
+--echo #
+SHOW VARIABLES like 'myisam_recover_options';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.myisam_recover_options;
+SELECT @@global.myisam_recover_options;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.myisam_recover_options= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.myisam_recover_options= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'open_files_limit';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.open_files_limit;
+--replace_column 1 #
+SELECT @@global.open_files_limit;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.open_files_limit= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.open_files_limit= 7;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'pid_file';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.pid_file;
+--replace_column 1 #
+SELECT @@global.pid_file;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.pid_file= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.pid_file= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'plugin_dir';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.plugin_dir;
+--replace_column 1 #
+SELECT @@global.plugin_dir;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.plugin_dir= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.plugin_dir= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'port';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.port;
+--replace_column 1 #
+SELECT @@global.port;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.port= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.port= 7;
+#
+--echo #
+SHOW VARIABLES like 'protocol_version';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.protocol_version;
+SELECT @@global.protocol_version;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.protocol_version= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.protocol_version= 7;
+#
+--echo #
+SHOW VARIABLES like 'skip_external_locking';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.skip_external_locking;
+SELECT @@global.skip_external_locking;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.skip_external_locking= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.skip_external_locking= true;
+#
+--echo #
+SHOW VARIABLES like 'skip_networking';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.skip_networking;
+SELECT @@global.skip_networking;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.skip_networking= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.skip_networking= true;
+#
+--echo #
+SHOW VARIABLES like 'skip_show_database';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.skip_show_database;
+SELECT @@global.skip_show_database;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.skip_show_database= true;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.skip_show_database= true;
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'socket';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.socket;
+--replace_column 1 #
+SELECT @@global.socket;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.socket= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.socket= 'x';
+#
+--echo #
+--replace_column 2 #
+SHOW VARIABLES like 'thread_stack';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.thread_stack;
+--replace_column 1 #
+SELECT @@global.thread_stack;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.thread_stack= 7;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.thread_stack= 7;
+#