diff options
author | Monty <monty@mariadb.org> | 2015-08-20 15:24:13 +0300 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-08-21 10:40:51 +0400 |
commit | 1bae0d9e5669c2d03209082142e892417e24d09a (patch) | |
tree | 8702469bab1f515c78a06ede07ae4aeaa297c802 /sql/repl_failsafe.cc | |
parent | 31e365efae28ba3208e80511c4d18fe11a79541a (diff) | |
download | mariadb-git-1bae0d9e5669c2d03209082142e892417e24d09a.tar.gz |
Stage 2 of MDEV-6152:
- Added mem_root to all calls to new Item
- Added private method operator new(size_t size) to Item to ensure that
we always use a mem_root when creating an item.
This saves use once call to current_thd per Item creation
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r-- | sql/repl_failsafe.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 1c7c8c013ea..4860935e9bf 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -230,18 +230,19 @@ bool show_slave_hosts(THD* thd) { List<Item> field_list; Protocol *protocol= thd->protocol; + MEM_ROOT *mem_root= thd->mem_root; DBUG_ENTER("show_slave_hosts"); - field_list.push_back(new Item_return_int(thd, "Server_id", 10, + field_list.push_back(new (mem_root) Item_return_int(thd, "Server_id", 10, MYSQL_TYPE_LONG)); - field_list.push_back(new Item_empty_string(thd, "Host", 20)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "Host", 20)); if (opt_show_slave_auth_info) { - field_list.push_back(new Item_empty_string(thd, "User", 20)); - field_list.push_back(new Item_empty_string(thd, "Password", 20)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "User", 20)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "Password", 20)); } - field_list.push_back(new Item_return_int(thd, "Port", 7, MYSQL_TYPE_LONG)); - field_list.push_back(new Item_return_int(thd, "Master_id", 10, + field_list.push_back(new (mem_root) Item_return_int(thd, "Port", 7, MYSQL_TYPE_LONG)); + field_list.push_back(new (mem_root) Item_return_int(thd, "Master_id", 10, MYSQL_TYPE_LONG)); if (protocol->send_result_set_metadata(&field_list, |