diff options
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); |