diff options
author | Monty <monty@mariadb.org> | 2015-08-24 14:42:07 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-08-27 22:21:08 +0300 |
commit | 3cb578c001b2feabd2410f281d20eb6566371453 (patch) | |
tree | 4e3781e38f6531ea91ff127c024869c6b88c5849 /sql/sql_error.cc | |
parent | ba340d8c47657774ba6d69bfc918dbebaaef6086 (diff) | |
download | mariadb-git-3cb578c001b2feabd2410f281d20eb6566371453.tar.gz |
MDEV-6152: Remove calls to current_thd while creating Item
- Part 3: Adding mem_root to push_back() and push_front()
Other things:
- Added THD as an argument to some partition functions.
- Added memory overflow checking for XML tag's in read_xml()
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index f7eb6dd6a1f..47f24ad9cb8 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -815,25 +815,29 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show) { List<Item> field_list; MEM_ROOT *mem_root= thd->mem_root; - DBUG_ENTER("mysqld_show_warnings"); - - DBUG_ASSERT(thd->get_stmt_da()->is_warning_info_read_only()); - - field_list.push_back(new (mem_root) Item_empty_string(thd, "Level", 7)); - field_list.push_back(new (mem_root) Item_return_int(thd, "Code", 4, - MYSQL_TYPE_LONG)); - field_list.push_back(new (mem_root) Item_empty_string(thd, "Message", - MYSQL_ERRMSG_SIZE)); - - if (thd->protocol->send_result_set_metadata(&field_list, - Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) - DBUG_RETURN(TRUE); - const Sql_condition *err; SELECT_LEX *sel= &thd->lex->select_lex; SELECT_LEX_UNIT *unit= &thd->lex->unit; ulonglong idx= 0; Protocol *protocol=thd->protocol; + DBUG_ENTER("mysqld_show_warnings"); + + DBUG_ASSERT(thd->get_stmt_da()->is_warning_info_read_only()); + + field_list.push_back(new (mem_root) + Item_empty_string(thd, "Level", 7), + mem_root); + field_list.push_back(new (mem_root) + Item_return_int(thd, "Code", 4, MYSQL_TYPE_LONG), + mem_root); + field_list.push_back(new (mem_root) + Item_empty_string(thd, "Message", MYSQL_ERRMSG_SIZE), + mem_root); + + if (protocol->send_result_set_metadata(&field_list, + Protocol::SEND_NUM_ROWS | + Protocol::SEND_EOF)) + DBUG_RETURN(TRUE); unit->set_limit(sel); |