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/sql_repl.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/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 263a982db30..ce19bf0846b 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -4000,13 +4000,15 @@ err: bool show_binlog_info(THD* thd) { Protocol *protocol= thd->protocol; + MEM_ROOT *mem_root= thd->mem_root; DBUG_ENTER("show_binlog_info"); + List<Item> field_list; - field_list.push_back(new Item_empty_string(thd, "File", FN_REFLEN)); - field_list.push_back(new Item_return_int(thd, "Position", 20, + field_list.push_back(new (mem_root) Item_empty_string(thd, "File", FN_REFLEN)); + field_list.push_back(new (mem_root) Item_return_int(thd, "Position", 20, MYSQL_TYPE_LONGLONG)); - field_list.push_back(new Item_empty_string(thd, "Binlog_Do_DB", 255)); - field_list.push_back(new Item_empty_string(thd, "Binlog_Ignore_DB", 255)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "Binlog_Do_DB", 255)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "Binlog_Ignore_DB", 255)); if (protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) @@ -4049,6 +4051,7 @@ bool show_binlogs(THD* thd) uint length; int cur_dir_len; Protocol *protocol= thd->protocol; + MEM_ROOT *mem_root= thd->mem_root; DBUG_ENTER("show_binlogs"); if (!mysql_bin_log.is_open()) @@ -4057,9 +4060,9 @@ bool show_binlogs(THD* thd) DBUG_RETURN(TRUE); } - field_list.push_back(new Item_empty_string(thd, "Log_name", 255)); - field_list.push_back(new Item_return_int(thd, "File_size", 20, - MYSQL_TYPE_LONGLONG)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "Log_name", 255)); + field_list.push_back(new (mem_root) Item_return_int(thd, "File_size", 20, + MYSQL_TYPE_LONGLONG)); if (protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); |