summaryrefslogtreecommitdiff
path: root/sql/wsrep_var.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-01-29 13:50:26 +0100
committerSergei Golubchik <serg@mariadb.org>2020-03-10 19:24:22 +0100
commit7c58e97bf6f80a251046c5b3e7bce826fe058bd6 (patch)
tree7d32d26b320cf83296ee0ede2ea164ad116c4de8 /sql/wsrep_var.cc
parent2ac3121af2767186c489054db5d4871d04b8eef4 (diff)
downloadmariadb-git-7c58e97bf6f80a251046c5b3e7bce826fe058bd6.tar.gz
perfschema memory related instrumentation changes
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r--sql/wsrep_var.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 950e4aae34d..28dbe4096f7 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -30,17 +30,17 @@ ulong wsrep_reject_queries;
int wsrep_init_vars()
{
- wsrep_provider = my_strdup(WSREP_NONE, MYF(MY_WME));
- wsrep_provider_options= my_strdup("", MYF(MY_WME));
- wsrep_cluster_address = my_strdup("", MYF(MY_WME));
- wsrep_cluster_name = my_strdup(WSREP_CLUSTER_NAME, MYF(MY_WME));
- wsrep_node_name = my_strdup("", MYF(MY_WME));
- wsrep_node_address = my_strdup("", MYF(MY_WME));
- wsrep_node_incoming_address= my_strdup(WSREP_NODE_INCOMING_AUTO, MYF(MY_WME));
+ wsrep_provider = my_strdup(PSI_INSTRUMENT_ME, WSREP_NONE, MYF(MY_WME));
+ wsrep_provider_options= my_strdup(PSI_INSTRUMENT_ME, "", MYF(MY_WME));
+ wsrep_cluster_address = my_strdup(PSI_INSTRUMENT_ME, "", MYF(MY_WME));
+ wsrep_cluster_name = my_strdup(PSI_INSTRUMENT_ME, WSREP_CLUSTER_NAME, MYF(MY_WME));
+ wsrep_node_name = my_strdup(PSI_INSTRUMENT_ME, "", MYF(MY_WME));
+ wsrep_node_address = my_strdup(PSI_INSTRUMENT_ME, "", MYF(MY_WME));
+ wsrep_node_incoming_address= my_strdup(PSI_INSTRUMENT_ME, WSREP_NODE_INCOMING_AUTO, MYF(MY_WME));
if (wsrep_gtid_mode)
- wsrep_start_position = my_strdup(WSREP_START_POSITION_ZERO_GTID, MYF(MY_WME));
+ wsrep_start_position = my_strdup(PSI_INSTRUMENT_ME, WSREP_START_POSITION_ZERO_GTID, MYF(MY_WME));
else
- wsrep_start_position = my_strdup(WSREP_START_POSITION_ZERO, MYF(MY_WME));
+ wsrep_start_position = my_strdup(PSI_INSTRUMENT_ME, WSREP_START_POSITION_ZERO, MYF(MY_WME));
return 0;
}
@@ -50,7 +50,7 @@ static int get_provider_option_value(const char* opts,
{
int ret= 1;
ulong opt_value_tmp;
- char *opt_value_str, *s, *opts_copy= my_strdup(opts, MYF(MY_WME));
+ char *opt_value_str, *s, *opts_copy= my_strdup(PSI_INSTRUMENT_ME, opts, MYF(MY_WME));
if ((opt_value_str= strstr(opts_copy, opt_name)) == NULL)
goto end;
@@ -436,7 +436,7 @@ void wsrep_provider_init (const char* value)
}
if (wsrep_provider) my_free((void *)wsrep_provider);
- wsrep_provider= my_strdup(value, MYF(0));
+ wsrep_provider= my_strdup(PSI_INSTRUMENT_MEM, value, MYF(0));
}
bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var)
@@ -466,7 +466,7 @@ void wsrep_provider_options_init(const char* value)
{
if (wsrep_provider_options && wsrep_provider_options != value)
my_free((void *)wsrep_provider_options);
- wsrep_provider_options= (value) ? my_strdup(value, MYF(0)) : NULL;
+ wsrep_provider_options= value ? my_strdup(PSI_INSTRUMENT_MEM, value, MYF(0)) : NULL;
}
bool wsrep_reject_queries_update(sys_var *self, THD* thd, enum_var_type type)
@@ -578,8 +578,8 @@ void wsrep_cluster_address_init (const char* value)
(wsrep_cluster_address) ? wsrep_cluster_address : "null",
(value) ? value : "null");
- my_free((void*) wsrep_cluster_address);
- wsrep_cluster_address= my_strdup(value ? value : "", MYF(0));
+ my_free(const_cast<char*>(wsrep_cluster_address));
+ wsrep_cluster_address= my_strdup(PSI_INSTRUMENT_MEM, safe_str(value), MYF(0));
}
/* wsrep_cluster_name cannot be NULL or an empty string. */
@@ -652,7 +652,7 @@ void wsrep_node_address_init (const char* value)
if (wsrep_node_address && strcmp(wsrep_node_address, value))
my_free ((void*)wsrep_node_address);
- wsrep_node_address= (value) ? my_strdup(value, MYF(0)) : NULL;
+ wsrep_node_address= value ? my_strdup(PSI_INSTRUMENT_MEM, value, MYF(0)) : NULL;
}
static void wsrep_slave_count_change_update ()