Skip to content

Commit

Permalink
after-merge fixes for test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Feb 6, 2015
1 parent 2a1470a commit 3b267eb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 50 deletions.
6 changes: 3 additions & 3 deletions mysql-test/suite/sys_vars/r/sysvars_wsrep.result
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT (DEPRECATED) Setting this variable is equivalent to setting wsrep_sync_wait READ flag
VARIABLE_COMMENT Setting this variable is equivalent to setting wsrep_sync_wait READ flag
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
Expand Down Expand Up @@ -87,9 +87,9 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME WSREP_DATA_HOME_DIR
SESSION_VALUE NULL
GLOBAL_VALUE
GLOBAL_VALUE DATADIR
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE
DEFAULT_VALUE DATADIR
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT home directory for wsrep provider
Expand Down
14 changes: 14 additions & 0 deletions mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,32 @@ SELECT @@session.wsrep_causal_reads;

# scope and valid values
SET @@global.wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SELECT @@global.wsrep_causal_reads;
@@global.wsrep_causal_reads
0
SET @@global.wsrep_causal_reads=ON;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SELECT @@global.wsrep_causal_reads;
@@global.wsrep_causal_reads
1
SET @@session.wsrep_causal_reads=OFF;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
0
SET @@session.wsrep_causal_reads=ON;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
1
SET @@session.wsrep_causal_reads=default;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
1
Expand All @@ -46,5 +56,9 @@ ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'

# restore the initial values
SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
Warnings:
Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
# End of test
30 changes: 3 additions & 27 deletions mysql-test/suite/sys_vars/r/wsrep_data_home_dir_basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,21 @@
# default
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir

DATADIR

# scope
SELECT @@session.wsrep_data_home_dir;
ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable
SET @@global.wsrep_data_home_dir='/tmp/data';
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir


# valid values
SET @@global.wsrep_data_home_dir='/tmp/data';
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir

SET @@global.wsrep_data_home_dir=junk-dir;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir

SET @@global.wsrep_data_home_dir=junk/dir;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir

SET @@global.wsrep_data_home_dir=OFF;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir

DATADIR
SET @@global.wsrep_data_home_dir=default;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir


# invalid values
SET @@global.wsrep_data_home_dir=NULL;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
DATADIR
# End of test
2 changes: 2 additions & 0 deletions mysql-test/suite/sys_vars/t/sysvars_wsrep.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
--source include/have_wsrep.inc
--source include/word_size.inc
--let $datadir = `SELECT @@datadir`

--replace_result $datadir DATADIR
--vertical_results
select * from information_schema.system_variables
where variable_name like 'wsrep%'
Expand Down
21 changes: 4 additions & 17 deletions mysql-test/suite/sys_vars/t/wsrep_data_home_dir_basic.test
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
--source include/have_wsrep.inc
--let $datadir = `SELECT @@datadir`

--echo #
--echo # wsrep_data_home_dir (readonly)
--echo #

--echo # default
--replace_result $datadir DATADIR
SELECT @@global.wsrep_data_home_dir;

--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir='/tmp/data';
SELECT @@global.wsrep_data_home_dir;

--echo
--echo # valid values
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir='/tmp/data';
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=junk-dir;
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=junk/dir;
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=OFF;
--replace_result $datadir DATADIR
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=default;
--replace_result $datadir DATADIR
SELECT @@global.wsrep_data_home_dir;

--echo
--echo # invalid values
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=NULL;

--echo # End of test
4 changes: 1 addition & 3 deletions sql/sys_vars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -984,10 +984,8 @@ static bool check_master_connection(sys_var *self, THD *thd, set_var *var)
tmp.str= var->save_result.string_value.str;
tmp.length= var->save_result.string_value.length;
if (!tmp.str || check_master_connection_name(&tmp))
{
my_error(ER_WRONG_ARGUMENTS, MYF(0), var->var->name.str);
return true;
}

return false;
}

Expand Down

0 comments on commit 3b267eb

Please sign in to comment.