mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
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()
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user