summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/flush2.result22
-rw-r--r--mysql-test/r/variables-notembedded.result43
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_log_bin.result9
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result9
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_relay_log.result15
-rw-r--r--mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result15
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt2
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt2
-rw-r--r--mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test4
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result28
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test24
-rw-r--r--mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc55
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_basename_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_index_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_basename_basic.result24
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_index_basic.result34
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result50
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_basename_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_index_basic.test13
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_basename_basic.test16
-rw-r--r--mysql-test/suite/sys_vars/t/relay_log_index_basic.test14
-rw-r--r--mysql-test/t/flush2.test7
-rw-r--r--mysql-test/t/variables-notembedded.test34
29 files changed, 480 insertions, 12 deletions
diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result
index 13bcc371ef6..ff5d8755f01 100644
--- a/mysql-test/r/flush2.result
+++ b/mysql-test/r/flush2.result
@@ -3,10 +3,32 @@ set global expire_logs_days = 3;
show variables like 'log_bin%';
Variable_name Value
log_bin OFF
+log_bin_basename
+log_bin_index
log_bin_trust_function_creators ON
+show variables like 'relay_log%';
+Variable_name Value
+relay_log mysqld-relay-bin
+relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
+relay_log_info_file relay-log.info
+relay_log_purge ON
+relay_log_recovery OFF
+relay_log_space_limit 0
flush logs;
show variables like 'log_bin%';
Variable_name Value
log_bin OFF
+log_bin_basename
+log_bin_index
log_bin_trust_function_creators ON
+show variables like 'relay_log%';
+Variable_name Value
+relay_log mysqld-relay-bin
+relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
+relay_log_info_file relay-log.info
+relay_log_purge ON
+relay_log_recovery OFF
+relay_log_space_limit 0
set global expire_logs_days = 0;
diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result
index 75fd2430e4b..f8191345219 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -44,19 +44,58 @@ 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_basename';
+Variable_name Value
+relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+SELECT @@session.relay_log_basename;
+ERROR HY000: Variable 'relay_log_basename' is a GLOBAL variable
+SELECT @@global.relay_log_basename;
+@@global.relay_log_basename
+MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin
+SET @@session.relay_log_basename= 'x';
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+SET @@global.relay_log_basename= 'x';
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+#
+SHOW VARIABLES like 'log_bin_basename';
+Variable_name Value
+log_bin_basename
+SELECT @@session.log_bin_basename;
+ERROR HY000: Variable 'log_bin_basename' is a GLOBAL variable
+SELECT @@global.log_bin_basename;
+@@global.log_bin_basename
+NULL
+SET @@session.log_bin_basename= 'x';
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
+SET @@global.log_bin_basename= 'x';
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
+#
SHOW VARIABLES like 'relay_log_index';
Variable_name Value
-relay_log_index mysqld-relay-bin.index
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.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
-mysqld-relay-bin.index
+MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
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 'log_bin_index';
+Variable_name Value
+log_bin_index
+SELECT @@session.log_bin_index;
+ERROR HY000: Variable 'log_bin_index' is a GLOBAL variable
+SELECT @@global.log_bin_index;
+@@global.log_bin_index
+NULL
+SET @@session.log_bin_index= 'x';
+ERROR HY000: Variable 'log_bin_index' is a read only variable
+SET @@global.log_bin_index= 'x';
+ERROR HY000: Variable 'log_bin_index' is a read only variable
+#
SHOW VARIABLES like 'relay_log_info_file';
Variable_name Value
relay_log_info_file relay-log.info
diff --git a/mysql-test/suite/binlog/r/binlog_variables_log_bin.result b/mysql-test/suite/binlog/r/binlog_variables_log_bin.result
new file mode 100644
index 00000000000..215e14f97df
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_log_bin.result
@@ -0,0 +1,9 @@
+SHOW VARIABLES LIKE 'log_bin%';
+Variable_name log_bin
+Value ON
+Variable_name log_bin_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other
+Variable_name log_bin_index
+Value MYSQLTEST_VARDIR/mysqld.1/data/mysqld-bin.index
+Variable_name log_bin_trust_function_creators
+Value ON
diff --git a/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result b/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result
new file mode 100644
index 00000000000..fb7324ced34
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result
@@ -0,0 +1,9 @@
+SHOW VARIABLES LIKE 'log_bin%';
+Variable_name log_bin
+Value ON
+Variable_name log_bin_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other
+Variable_name log_bin_index
+Value MYSQLTEST_VARDIR/tmp/something.index
+Variable_name log_bin_trust_function_creators
+Value ON
diff --git a/mysql-test/suite/binlog/r/binlog_variables_relay_log.result b/mysql-test/suite/binlog/r/binlog_variables_relay_log.result
new file mode 100644
index 00000000000..59135837c29
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_relay_log.result
@@ -0,0 +1,15 @@
+SHOW VARIABLES LIKE 'relay_log%';
+Variable_name relay_log
+Value other-relay
+Variable_name relay_log_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other-relay
+Variable_name relay_log_index
+Value MYSQLTEST_VARDIR/mysqld.1/data/mysqld-relay-bin.index
+Variable_name relay_log_info_file
+Value relay-log.info
+Variable_name relay_log_purge
+Value ON
+Variable_name relay_log_recovery
+Value OFF
+Variable_name relay_log_space_limit
+Value 0
diff --git a/mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result b/mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result
new file mode 100644
index 00000000000..1b18b89d298
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_variables_relay_log_index.result
@@ -0,0 +1,15 @@
+SHOW VARIABLES LIKE 'relay_log%';
+Variable_name relay_log
+Value other-relay
+Variable_name relay_log_basename
+Value MYSQLTEST_VARDIR/mysqld.1/data/other-relay
+Variable_name relay_log_index
+Value MYSQLTEST_VARDIR/tmp/something-relay.index
+Variable_name relay_log_info_file
+Value relay-log.info
+Variable_name relay_log_purge
+Value ON
+Variable_name relay_log_recovery
+Value OFF
+Variable_name relay_log_space_limit
+Value 0
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt b/mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt
new file mode 100644
index 00000000000..85d14ea7af9
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin-master.opt
@@ -0,0 +1 @@
+--log-bin=other
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin.test b/mysql-test/suite/binlog/t/binlog_variables_log_bin.test
new file mode 100644
index 00000000000..d94d565d004
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'log_bin%'
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt
new file mode 100644
index 00000000000..68e580bd205
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index-master.opt
@@ -0,0 +1,2 @@
+--log-bin=other
+--log-bin-index=$MYSQLTEST_VARDIR/tmp/something.index
diff --git a/mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test
new file mode 100644
index 00000000000..d94d565d004
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_log_bin_index.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'log_bin%'
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt b/mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt
new file mode 100644
index 00000000000..a01432d7a17
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log-master.opt
@@ -0,0 +1 @@
+--relay-log=other-relay
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log.test b/mysql-test/suite/binlog/t/binlog_variables_relay_log.test
new file mode 100644
index 00000000000..1e987901986
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'relay_log%'
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt
new file mode 100644
index 00000000000..eeabaca11a0
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index-master.opt
@@ -0,0 +1,2 @@
+--relay-log=other-relay
+--relay-log-index=$MYSQLTEST_VARDIR/tmp/something-relay.index
diff --git a/mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test
new file mode 100644
index 00000000000..1e987901986
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_variables_relay_log_index.test
@@ -0,0 +1,4 @@
+--source include/not_embedded.inc
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--query_vertical SHOW VARIABLES LIKE 'relay_log%'
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index 7b93a221953..a5bf73cdbfa 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -2,7 +2,8 @@ include/rpl_init.inc [topology=1->2->1]
show variables like 'relay_log%';
Variable_name Value
relay_log master-relay-bin
-relay_log_index master-relay-bin.index
+relay_log_basename MYSQLD_DATADIR/master-relay-bin
+relay_log_index MYSQLD_DATADIR/master-relay-bin.index
relay_log_info_file relay-log.info
relay_log_purge ON
relay_log_recovery OFF
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index 8711dce4ab6..f91cdad6e47 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -38,6 +38,34 @@ include/stop_slave.inc
include/start_slave.inc
SET @@global.init_slave = 'SELECT 1';
[on master]
+SELECT @@pid_file, @@datadir;
+@@pid_file MYSQLTEST_VARDIR/run/mysqld.1.pid
+@@datadir MYSQLTEST_VARDIR/mysqld.1/data/
+**** Relay log variables
+SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+@@relay_log master-relay-bin
+@@relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
+@@relay_log_basename MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin
+**** Binary log variables
+SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+@@log_bin 1
+@@log_bin_index MYSQLTEST_VARDIR/mysqld.1/data/master-bin.index
+@@log_bin_basename MYSQLTEST_VARDIR/mysqld.1/data/master-bin
+[on slave]
+SELECT @@pid_file, @@datadir;
+@@pid_file MYSQLTEST_VARDIR/run/mysqld.2.pid
+@@datadir MYSQLTEST_VARDIR/mysqld.2/data/
+**** Relay log variables
+SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+@@relay_log slave-relay-bin
+@@relay_log_index MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.index
+@@relay_log_basename MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin
+**** Binary log variables
+SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+@@log_bin 1
+@@log_bin_index MYSQLTEST_VARDIR/mysqld.2/data/slave-bin.index
+@@log_bin_basename MYSQLTEST_VARDIR/mysqld.2/data/slave-bin
+[on master]
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
truth BOOLEAN,
num INT,
diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index ca90054da2a..246e595d265 100644
--- a/mysql-test/suite/rpl/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
@@ -119,6 +119,30 @@ SET @@global.init_slave = 'SELECT 1';
--echo [on master]
connection master;
+# checking values of read-only variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@pid_file, @@datadir;
+--echo **** Relay log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+--echo **** Binary log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+
+--echo [on slave]
+connection slave;
+# checking values of read-only variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@pid_file, @@datadir;
+--echo **** Relay log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
+--echo **** Binary log variables
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+query_vertical SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
+
+--echo [on master]
+connection master;
# Tables where everything happens.
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
diff --git a/mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc b/mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc
new file mode 100644
index 00000000000..58d6ce2deb2
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc
@@ -0,0 +1,55 @@
+# ==== Usage ====
+# [--let $rpl_debug=1]
+# --let $rpl_log_var_name= log_bin_basename|relay_log_basename|...
+# --source suite/sys_vars/inc/bin_relay_log_basename_index.inc
+#
+# $rpl_log_var_name
+# The name of the variable to test, i.e., one of:
+# - log_bin_basename
+# - relay_log_basename
+# - log_bin_index
+# - relay_log_index
+#
+# $rpl_debug
+# See include/rpl_init.inc
+
+if ($rpl_debug)
+{
+ --echo Testing variable named: $rpl_log_var_name
+}
+
+--let $basename= `SELECT @@global.$rpl_log_var_name`
+
+#
+# Assert that the variable is indeed only global
+#
+--replace_result $basename REPLACED
+--eval select @@global.$rpl_log_var_name
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+--eval select @@session.$rpl_log_var_name
+
+#
+# Assert that it is retrievable
+#
+--replace_result $basename REPLACED
+--eval show global variables like '$rpl_log_var_name'
+
+--replace_result $basename REPLACED
+--eval show session variables like '$rpl_log_var_name'
+
+--replace_result $basename REPLACED
+--eval select * from information_schema.global_variables where variable_name='$rpl_log_var_name'
+
+--replace_result $basename REPLACED
+--eval select * from information_schema.session_variables where variable_name='$rpl_log_var_name'
+
+#
+# Assert it is read-only
+#
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+--eval set global $rpl_log_var_name=1
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+--eval set session $rpl_log_var_name=1
+
diff --git a/mysql-test/suite/sys_vars/r/log_bin_basename_basic.result b/mysql-test/suite/sys_vars/r/log_bin_basename_basic.result
new file mode 100644
index 00000000000..696e384ac6e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_bin_basename_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_bin_basename;
+@@global.log_bin_basename
+REPLACED
+select @@session.log_bin_basename;
+ERROR HY000: Variable 'log_bin_basename' is a GLOBAL variable
+show global variables like 'log_bin_basename';
+Variable_name Value
+log_bin_basename REPLACED
+show session variables like 'log_bin_basename';
+Variable_name Value
+log_bin_basename REPLACED
+select * from information_schema.global_variables where variable_name='log_bin_basename';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_BASENAME REPLACED
+select * from information_schema.session_variables where variable_name='log_bin_basename';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_BASENAME REPLACED
+set global log_bin_basename=1;
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
+set session log_bin_basename=1;
+ERROR HY000: Variable 'log_bin_basename' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/log_bin_index_basic.result b/mysql-test/suite/sys_vars/r/log_bin_index_basic.result
new file mode 100644
index 00000000000..6b28f5fd3e3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/log_bin_index_basic.result
@@ -0,0 +1,21 @@
+select @@global.log_bin_index;
+@@global.log_bin_index
+REPLACED
+select @@session.log_bin_index;
+ERROR HY000: Variable 'log_bin_index' is a GLOBAL variable
+show global variables like 'log_bin_index';
+Variable_name Value
+log_bin_index REPLACED
+show session variables like 'log_bin_index';
+Variable_name Value
+log_bin_index REPLACED
+select * from information_schema.global_variables where variable_name='log_bin_index';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_INDEX REPLACED
+select * from information_schema.session_variables where variable_name='log_bin_index';
+VARIABLE_NAME VARIABLE_VALUE
+LOG_BIN_INDEX REPLACED
+set global log_bin_index=1;
+ERROR HY000: Variable 'log_bin_index' is a read only variable
+set session log_bin_index=1;
+ERROR HY000: Variable 'log_bin_index' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result b/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
new file mode 100644
index 00000000000..10ad3711949
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
@@ -0,0 +1,24 @@
+include/master-slave.inc
+[connection master]
+select @@global.relay_log_basename;
+@@global.relay_log_basename
+REPLACED
+select @@session.relay_log_basename;
+ERROR HY000: Variable 'relay_log_basename' is a GLOBAL variable
+show global variables like 'relay_log_basename';
+Variable_name Value
+relay_log_basename REPLACED
+show session variables like 'relay_log_basename';
+Variable_name Value
+relay_log_basename REPLACED
+select * from information_schema.global_variables where variable_name='relay_log_basename';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_BASENAME REPLACED
+select * from information_schema.session_variables where variable_name='relay_log_basename';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_BASENAME REPLACED
+set global relay_log_basename=1;
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+set session relay_log_basename=1;
+ERROR HY000: Variable 'relay_log_basename' is a read only variable
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
index d0ceddc96fe..6d8eec9eb30 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
@@ -1,21 +1,45 @@
+include/master-slave.inc
+[connection master]
select @@global.relay_log_index;
@@global.relay_log_index
-mysqld-relay-bin.index
+MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
select @@session.relay_log_index;
ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
show global variables like 'relay_log_index';
Variable_name Value
-relay_log_index mysqld-relay-bin.index
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
show session variables like 'relay_log_index';
Variable_name Value
-relay_log_index mysqld-relay-bin.index
+relay_log_index MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
select * from information_schema.global_variables where variable_name='relay_log_index';
VARIABLE_NAME VARIABLE_VALUE
-RELAY_LOG_INDEX mysqld-relay-bin.index
+RELAY_LOG_INDEX MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
select * from information_schema.session_variables where variable_name='relay_log_index';
VARIABLE_NAME VARIABLE_VALUE
-RELAY_LOG_INDEX mysqld-relay-bin.index
+RELAY_LOG_INDEX MYSQLTEST_VARDIR/mysqld.1/data/master-relay-bin.index
set global relay_log_index=1;
ERROR HY000: Variable 'relay_log_index' is a read only variable
set session relay_log_index=1;
ERROR HY000: Variable 'relay_log_index' is a read only variable
+select @@global.relay_log_index;
+@@global.relay_log_index
+REPLACED
+select @@session.relay_log_index;
+ERROR HY000: Variable 'relay_log_index' is a GLOBAL variable
+show global variables like 'relay_log_index';
+Variable_name Value
+relay_log_index REPLACED
+show session variables like 'relay_log_index';
+Variable_name Value
+relay_log_index REPLACED
+select * from information_schema.global_variables where variable_name='relay_log_index';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INDEX REPLACED
+select * from information_schema.session_variables where variable_name='relay_log_index';
+VARIABLE_NAME VARIABLE_VALUE
+RELAY_LOG_INDEX REPLACED
+set global relay_log_index=1;
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+set session relay_log_index=1;
+ERROR HY000: Variable 'relay_log_index' is a read only variable
+include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 10b3b12dabb..547d9b1f79e 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -1689,6 +1689,34 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOG_BIN_BASENAME
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The full path of the binary log file names, excluding the extension.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME LOG_BIN_INDEX
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT File that holds the names for last binary log files.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME LOG_BIN_TRUST_FUNCTION_CREATORS
SESSION_VALUE NULL
GLOBAL_VALUE ON
@@ -3355,11 +3383,25 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME RELAY_LOG_BASENAME
+SESSION_VALUE NULL
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT The full path of the relay log file names, excluding the extension.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME RELAY_LOG_INDEX
SESSION_VALUE NULL
-GLOBAL_VALUE mysqld-relay-bin.index
-GLOBAL_VALUE_ORIGIN AUTO
-DEFAULT_VALUE
+GLOBAL_VALUE PATH
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT The location and name to use for the file that keeps a list of the last relay logs
@@ -3368,7 +3410,7 @@ NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME RELAY_LOG_INFO_FILE
SESSION_VALUE NULL
GLOBAL_VALUE relay-log.info
diff --git a/mysql-test/suite/sys_vars/t/log_bin_basename_basic.test b/mysql-test/suite/sys_vars/t/log_bin_basename_basic.test
new file mode 100644
index 00000000000..8ad5bd22bb6
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_bin_basename_basic.test
@@ -0,0 +1,13 @@
+#
+# WL#5465: System variables: paths to relay log and binary log files
+#
+# Test for variable:
+# Variable Name: log_bin_basename
+# Variable Scope: Global
+# Dynamic Variable: No
+
+--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+--let $rpl_log_var_name=log_bin_basename
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
diff --git a/mysql-test/suite/sys_vars/t/log_bin_index_basic.test b/mysql-test/suite/sys_vars/t/log_bin_index_basic.test
new file mode 100644
index 00000000000..c99df79f36f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/log_bin_index_basic.test
@@ -0,0 +1,13 @@
+#
+# WL#5465: System variables: paths to relay log and binary log files
+#
+# Test for variable:
+# Variable Name: log_bin_index
+# Variable Scope: Global
+# Dynamic Variable: No
+
+--source include/not_embedded.inc
+--source include/have_log_bin.inc
+
+--let $rpl_log_var_name=log_bin_index
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
diff --git a/mysql-test/suite/sys_vars/t/relay_log_basename_basic.test b/mysql-test/suite/sys_vars/t/relay_log_basename_basic.test
new file mode 100644
index 00000000000..29b70e6cd47
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/relay_log_basename_basic.test
@@ -0,0 +1,16 @@
+#
+# WL#5465: System variables: paths to relay log and binary log files
+#
+# Test for variable:
+# Variable Name: relay_log_basename
+# Variable Scope: Global
+# Dynamic Variable: No
+
+--source include/not_embedded.inc
+--source include/master-slave.inc
+
+--connection slave
+--let $rpl_log_var_name=relay_log_basename
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/sys_vars/t/relay_log_index_basic.test b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
index fa69d978016..5a585ac289f 100644
--- a/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
+++ b/mysql-test/suite/sys_vars/t/relay_log_index_basic.test
@@ -1,13 +1,20 @@
--source include/not_embedded.inc
+--source include/master-slave.inc
+
#
# only global
#
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
select @@global.relay_log_index;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.relay_log_index;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show global variables like 'relay_log_index';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show session variables like 'relay_log_index';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
select * from information_schema.global_variables where variable_name='relay_log_index';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
select * from information_schema.session_variables where variable_name='relay_log_index';
#
@@ -17,3 +24,10 @@ select * from information_schema.session_variables where variable_name='relay_lo
set global relay_log_index=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session relay_log_index=1;
+
+--connection slave
+--let $rpl_log_var_name=relay_log_index
+--source suite/sys_vars/inc/bin_relay_log_basename_index.inc
+
+--source include/rpl_end.inc
+
diff --git a/mysql-test/t/flush2.test b/mysql-test/t/flush2.test
index 7582ab8426b..496b57ccea4 100644
--- a/mysql-test/t/flush2.test
+++ b/mysql-test/t/flush2.test
@@ -1,9 +1,16 @@
#
# Bug#17733 Flushing logs causes daily server crash
#
+
+--source include/not_embedded.inc
+
flush logs;
set global expire_logs_days = 3;
show variables like 'log_bin%';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like 'relay_log%';
flush logs;
show variables like 'log_bin%';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like 'relay_log%';
set global expire_logs_days = 0;
diff --git a/mysql-test/t/variables-notembedded.test b/mysql-test/t/variables-notembedded.test
index 471212bf38f..2aa77e1e254 100644
--- a/mysql-test/t/variables-notembedded.test
+++ b/mysql-test/t/variables-notembedded.test
@@ -58,9 +58,33 @@ SET @@session.relay_log= 'x';
SET @@global.relay_log= 'x';
#
--echo #
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SHOW VARIABLES like 'relay_log_basename';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.relay_log_basename;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT @@global.relay_log_basename;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.relay_log_basename= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.relay_log_basename= 'x';
+#
+--echo #
+SHOW VARIABLES like 'log_bin_basename';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_bin_basename;
+SELECT @@global.log_bin_basename;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_bin_basename= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_bin_basename= 'x';
+#
+--echo #
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SHOW VARIABLES like 'relay_log_index';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_index;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SELECT @@global.relay_log_index;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@session.relay_log_index= 'x';
@@ -68,6 +92,16 @@ SET @@session.relay_log_index= 'x';
SET @@global.relay_log_index= 'x';
#
--echo #
+SHOW VARIABLES like 'log_bin_index';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.log_bin_index;
+SELECT @@global.log_bin_index;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@session.log_bin_index= 'x';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@global.log_bin_index= 'x';
+#
+--echo #
SHOW VARIABLES like 'relay_log_info_file';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.relay_log_info_file;