diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 4aa15d27661..5f8d9c6ddff 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -28,4 +28,5 @@ galera_flush : mysql-wsrep/issues/229 galera_transaction_read_only : mysql-wsrep/issues/229 galera_gcs_fragment : Incorrect arguments to SET galera_flush_local : Fails sporadically -galera_binlog_stmt_autoinc : TODO: investigate \ No newline at end of file +galera_binlog_stmt_autoinc : TODO: investigate +galera_concurrent_ctas : Test times out, investigate diff --git a/mysql-test/suite/galera/r/galera_roles.result b/mysql-test/suite/galera/r/galera_roles.result index d8c13758797..6312250c18d 100644 --- a/mysql-test/suite/galera/r/galera_roles.result +++ b/mysql-test/suite/galera/r/galera_roles.result @@ -170,10 +170,10 @@ localhost foo role3 Y localhost root role1 Y localhost root role2 Y SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES; -GRANTEE ROLE_NAME IS_GRANTABLE -role1 role4 YES -root@localhost role1 YES -root@localhost role2 YES +GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT +role1 role4 YES NULL +root@localhost role1 YES NO +root@localhost role2 YES NO # On node_2 SELECT * FROM mysql.roles_mapping; @@ -183,10 +183,10 @@ localhost foo role3 Y localhost root role1 Y localhost root role2 Y SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES; -GRANTEE ROLE_NAME IS_GRANTABLE -role1 role4 YES -root@localhost role1 YES -root@localhost role2 YES +GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT +role1 role4 YES NULL +root@localhost role1 YES NO +root@localhost role2 YES NO DROP ROLE role1; DROP ROLE role2; DROP ROLE role3; diff --git a/mysql-test/suite/galera/t/MW-259.test b/mysql-test/suite/galera/t/MW-259.test index ff9a30deed3..7298285f6ff 100644 --- a/mysql-test/suite/galera/t/MW-259.test +++ b/mysql-test/suite/galera/t/MW-259.test @@ -24,7 +24,7 @@ SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; --connection node_1b --sleep 2 ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'exit open_tables()' and INFO = 'SET GLOBAL wsrep_desync=1' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'SET GLOBAL wsrep_desync=1' --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL continue'; diff --git a/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test index dc7ff11a9f5..882f846fe67 100644 --- a/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test +++ b/mysql-test/suite/galera/t/galera_rsu_wsrep_desync.test @@ -60,7 +60,7 @@ SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue'; --connection node_1b --sleep 2 ---let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'exit open_tables()' and INFO = 'SET GLOBAL wsrep_desync=1' +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'SET GLOBAL wsrep_desync=1' --source include/wait_condition.inc SET DEBUG_SYNC= 'now SIGNAL continue'; diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result index 3d7ec08166d..36d04afb80d 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result +++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result @@ -241,13 +241,13 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME WSREP_MAX_WS_ROWS SESSION_VALUE NULL -GLOBAL_VALUE 131072 +GLOBAL_VALUE 0 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 131072 +DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Max number of rows in write set -NUMERIC_MIN_VALUE 1 +NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL @@ -255,14 +255,14 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME WSREP_MAX_WS_SIZE SESSION_VALUE NULL -GLOBAL_VALUE 1073741824 +GLOBAL_VALUE 2147483647 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 1073741824 +DEFAULT_VALUE 2147483647 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Max write set size (bytes) NUMERIC_MIN_VALUE 1024 -NUMERIC_MAX_VALUE 4294901759 +NUMERIC_MAX_VALUE 2147483647 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -367,7 +367,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME WSREP_PATCH_VERSION SESSION_VALUE NULL -GLOBAL_VALUE wsrep_25.13 +GLOBAL_VALUE wsrep_25.16 GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE NULL VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result b/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result index e4d452c11b5..90925e71c32 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_desync_basic.result @@ -24,8 +24,6 @@ SELECT @@global.wsrep_desync; # valid values SET @@global.wsrep_desync='OFF'; -Warnings: -Warning 1231 'wsrep_desync' is already OFF. SELECT @@global.wsrep_desync; @@global.wsrep_desync 0 @@ -35,8 +33,6 @@ SELECT @@global.wsrep_desync; @@global.wsrep_desync 0 SET @@global.wsrep_desync=default; -Warnings: -Warning 1231 'wsrep_desync' is already OFF. SELECT @@global.wsrep_desync; @@global.wsrep_desync 0 diff --git a/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result b/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result index d7e72869be3..689da3e9cb0 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result @@ -1,9 +1,6 @@ # # wsrep_max_ws_size # -# save the initial value -SET @wsrep_max_ws_size_global_saved = @@global.wsrep_max_ws_size; -SET @wsrep_provider_options_saved = @@global.wsrep_provider_options; # default SELECT @@global.wsrep_max_ws_size; @@global.wsrep_max_ws_size @@ -13,28 +10,29 @@ SELECT @@global.wsrep_max_ws_size; SELECT @@session.wsrep_max_ws_size; ERROR HY000: Variable 'wsrep_max_ws_size' is a GLOBAL variable SET @@global.wsrep_max_ws_size=1; -Warnings: -Warning 1292 Truncated incorrect wsrep_max_ws_size value: '1' +ERROR HY000: WSREP (galera) not started SELECT @@global.wsrep_max_ws_size; @@global.wsrep_max_ws_size -1024 +2147483647 # valid values SET @@global.wsrep_max_ws_size=1073741824; +ERROR HY000: WSREP (galera) not started SELECT @@global.wsrep_max_ws_size; @@global.wsrep_max_ws_size -1073741824 +2147483647 SET @@global.wsrep_max_ws_size=1073741825; +ERROR HY000: WSREP (galera) not started SELECT @@global.wsrep_max_ws_size; @@global.wsrep_max_ws_size -1073741825 +2147483647 SET @@global.wsrep_max_ws_size=0; -Warnings: -Warning 1292 Truncated incorrect wsrep_max_ws_size value: '0' +ERROR HY000: WSREP (galera) not started SELECT @@global.wsrep_max_ws_size; @@global.wsrep_max_ws_size -1024 +2147483647 SET @@global.wsrep_max_ws_size=default; +ERROR HY000: WSREP (galera) not started SELECT @global.wsrep_max_ws_size; @global.wsrep_max_ws_size NULL @@ -48,13 +46,8 @@ SELECT @global.wsrep_max_ws_size; @global.wsrep_max_ws_size NULL SET @@global.wsrep_max_ws_size=-1; -Warnings: -Warning 1292 Truncated incorrect wsrep_max_ws_size value: '-1' +ERROR HY000: WSREP (galera) not started SELECT @global.wsrep_max_ws_size; @global.wsrep_max_ws_size NULL - -# restore the initial value -SET @@global.wsrep_max_ws_size = @wsrep_max_ws_size_global_saved; -SET @@global.wsrep_provider_options = @wsrep_provider_options_saved; # End of test diff --git a/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test b/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test index 2e302015136..50506ed12df 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test @@ -4,10 +4,6 @@ --echo # wsrep_max_ws_size --echo # ---echo # save the initial value -SET @wsrep_max_ws_size_global_saved = @@global.wsrep_max_ws_size; -SET @wsrep_provider_options_saved = @@global.wsrep_provider_options; - --echo # default SELECT @@global.wsrep_max_ws_size; @@ -15,17 +11,22 @@ SELECT @@global.wsrep_max_ws_size; --echo # scope --error ER_INCORRECT_GLOBAL_LOCAL_VAR SELECT @@session.wsrep_max_ws_size; +--error ER_WRONG_ARGUMENTS SET @@global.wsrep_max_ws_size=1; SELECT @@global.wsrep_max_ws_size; --echo --echo # valid values +--error ER_WRONG_ARGUMENTS SET @@global.wsrep_max_ws_size=1073741824; SELECT @@global.wsrep_max_ws_size; +--error ER_WRONG_ARGUMENTS SET @@global.wsrep_max_ws_size=1073741825; SELECT @@global.wsrep_max_ws_size; +--error ER_WRONG_ARGUMENTS SET @@global.wsrep_max_ws_size=0; SELECT @@global.wsrep_max_ws_size; +--error ER_WRONG_ARGUMENTS SET @@global.wsrep_max_ws_size=default; SELECT @global.wsrep_max_ws_size; @@ -36,12 +37,8 @@ SET @@global.wsrep_max_ws_size=NULL; --error ER_WRONG_TYPE_FOR_VAR SET @@global.wsrep_max_ws_size='junk'; SELECT @global.wsrep_max_ws_size; +--error ER_WRONG_ARGUMENTS SET @@global.wsrep_max_ws_size=-1; SELECT @global.wsrep_max_ws_size; ---echo ---echo # restore the initial value -SET @@global.wsrep_max_ws_size = @wsrep_max_ws_size_global_saved; -SET @@global.wsrep_provider_options = @wsrep_provider_options_saved; - --echo # End of test diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result index 928f1995072..62d7f62440f 100644 --- a/mysql-test/suite/wsrep/r/variables.result +++ b/mysql-test/suite/wsrep/r/variables.result @@ -36,7 +36,6 @@ wsrep_commit_oooe # wsrep_commit_oool # wsrep_commit_window # wsrep_connected # -wsrep_debug_sync_waiters # wsrep_flow_control_paused # wsrep_flow_control_paused_ns # wsrep_flow_control_recv # @@ -92,7 +91,6 @@ wsrep_commit_oooe # wsrep_commit_oool # wsrep_commit_window # wsrep_connected # -wsrep_debug_sync_waiters # wsrep_flow_control_paused # wsrep_flow_control_paused_ns # wsrep_flow_control_recv # diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 9ad70514852..306528c5c86 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -4865,8 +4865,8 @@ static Sys_var_ulong Sys_wsrep_max_ws_size ( "wsrep_max_ws_size", "Max write set size (bytes)", GLOBAL_VAR(wsrep_max_ws_size), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1024, WSREP_MAX_WS_SIZE), DEFAULT(WSREP_MAX_WS_SIZE), - BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), - ON_UPDATE(wsrep_max_ws_size_update)); + BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, + ON_CHECK(wsrep_max_ws_size_check), ON_UPDATE(wsrep_max_ws_size_update)); static Sys_var_ulong Sys_wsrep_max_ws_rows ( "wsrep_max_ws_rows", "Max number of rows in write set", diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 296ff26962d..04ccc1a7e45 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -170,6 +170,9 @@ extern void wsrep_prepend_PATH (const char* path); extern wsrep_seqno_t wsrep_locked_seqno; #define WSREP_ON \ + (global_system_variables.wsrep_on) + +#define WSREP_ON_NEW \ ((global_system_variables.wsrep_on) && \ wsrep_provider && \ strcmp(wsrep_provider, WSREP_NONE)) diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 56a799c97c1..30c5bf900ff 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -195,6 +195,8 @@ end: static bool refresh_provider_options() { + DBUG_ASSERT(wsrep); + WSREP_DEBUG("refresh_provider_options: %s", (wsrep_provider_options) ? wsrep_provider_options : "null"); char* opts= wsrep->options_get(wsrep); @@ -318,18 +320,18 @@ void wsrep_provider_init (const char* value) } bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var) -{ - return 0; -} - -bool wsrep_provider_options_update(sys_var *self, THD* thd, enum_var_type type) { if (wsrep == NULL) { my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) not started", MYF(0)); return true; } + return false; +} +bool wsrep_provider_options_update(sys_var *self, THD* thd, enum_var_type type) +{ + DBUG_ASSERT(wsrep); wsrep_status_t ret= wsrep->options_set(wsrep, wsrep_provider_options); if (ret != WSREP_OK) { @@ -522,6 +524,12 @@ bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type) bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) { + if (wsrep == NULL) + { + my_message(ER_WRONG_ARGUMENTS, "WSREP (galera) not started", MYF(0)); + return true; + } + bool new_wsrep_desync= (bool) var->save_result.ulonglong_value; if (wsrep_desync == new_wsrep_desync) { if (new_wsrep_desync) { @@ -559,6 +567,12 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) } bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) +{ + DBUG_ASSERT(wsrep); + return false; +} + +bool wsrep_max_ws_size_check(sys_var *self, THD* thd, set_var* var) { if (wsrep == NULL) { @@ -570,6 +584,8 @@ bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) bool wsrep_max_ws_size_update (sys_var *self, THD *thd, enum_var_type) { + DBUG_ASSERT(wsrep); + char max_ws_size_opt[128]; my_snprintf(max_ws_size_opt, sizeof(max_ws_size_opt), "repl.max_ws_size=%d", wsrep_max_ws_size); diff --git a/sql/wsrep_var.h b/sql/wsrep_var.h index 66b9a736b38..ca77b5c0039 100644 --- a/sql/wsrep_var.h +++ b/sql/wsrep_var.h @@ -92,7 +92,9 @@ extern bool wsrep_slave_threads_update UPDATE_ARGS; extern bool wsrep_desync_check CHECK_ARGS; extern bool wsrep_desync_update UPDATE_ARGS; +extern bool wsrep_max_ws_size_check CHECK_ARGS; extern bool wsrep_max_ws_size_update UPDATE_ARGS; + #else /* WITH_WSREP */ #define WSREP_NONE