Commit bbfb5d7c authored by Monty's avatar Monty

Fixed failures for privilege_table_io and wsrep_cluster_address_basic

- Sometimes privilege_table_io printed double rows of roles_mapping
  - Fixed by forcing restart of server when running test
- Wsrep_cluster_address_basic failed in some combinations because
  wsrep_cluster_address was set to NULL
  - Fixed by ensuring it's never set to NULL, only empty string
parent 1c915692
# Tests for PERFORMANCE_SCHEMA table io # Tests for PERFORMANCE_SCHEMA table io
# This test makes a restart because without it, events_waits_history_long
# sometimes contains duplicated entries of roles_mapping.
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_perfschema.inc --source include/have_perfschema.inc
--source include/restart_mysqld.inc
--source ../include/table_io_setup_helper.inc --source ../include/table_io_setup_helper.inc
# Remove "deleted" records from mysql.db that may come from previous tests, # Remove "deleted" records from mysql.db that may come from previous tests,
......
...@@ -805,7 +805,7 @@ void wsrep_init_startup (bool first) ...@@ -805,7 +805,7 @@ void wsrep_init_startup (bool first)
(wsrep_on_fun)wsrep_on); (wsrep_on_fun)wsrep_on);
/* Skip replication start if no cluster address */ /* Skip replication start if no cluster address */
if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return; if (!wsrep_cluster_address || wsrep_cluster_address[0] == 0) return;
if (first) wsrep_sst_grab(); // do it so we can wait for SST below if (first) wsrep_sst_grab(); // do it so we can wait for SST below
...@@ -918,7 +918,7 @@ bool wsrep_start_replication() ...@@ -918,7 +918,7 @@ bool wsrep_start_replication()
return true; return true;
} }
if (!wsrep_cluster_address || strlen(wsrep_cluster_address)== 0) if (!wsrep_cluster_address || wsrep_cluster_address[0]== 0)
{ {
// if provider is non-trivial, but no address is specified, wait for address // if provider is non-trivial, but no address is specified, wait for address
wsrep_ready_set(FALSE); wsrep_ready_set(FALSE);
......
...@@ -359,11 +359,11 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var) ...@@ -359,11 +359,11 @@ bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var)
(var->save_result.string_value.length > (FN_REFLEN - 1))) // safety (var->save_result.string_value.length > (FN_REFLEN - 1))) // safety
goto err; goto err;
memcpy(addr_buf, var->save_result.string_value.str, strmake(addr_buf, var->save_result.string_value.str,
var->save_result.string_value.length); sizeof(addr_buf)-1);
addr_buf[var->save_result.string_value.length]= 0;
if (!wsrep_cluster_address_verify(addr_buf)) return 0; if (!wsrep_cluster_address_verify(addr_buf))
return 0;
err: err:
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str,
...@@ -421,8 +421,8 @@ void wsrep_cluster_address_init (const char* value) ...@@ -421,8 +421,8 @@ void wsrep_cluster_address_init (const char* value)
(wsrep_cluster_address) ? wsrep_cluster_address : "null", (wsrep_cluster_address) ? wsrep_cluster_address : "null",
(value) ? value : "null"); (value) ? value : "null");
if (wsrep_cluster_address) my_free ((void*)wsrep_cluster_address); my_free((void*) wsrep_cluster_address);
wsrep_cluster_address = (value) ? my_strdup(value, MYF(0)) : NULL; wsrep_cluster_address= my_strdup(value ? value : "", MYF(0));
} }
/* wsrep_cluster_name cannot be NULL or an empty string. */ /* wsrep_cluster_name cannot be NULL or an empty string. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment