#At file:///home/alik/MySQL/bzr/00/bug55843/mysql-trunk-bug55843-03/ based on revid:alexander.nozdrin@stripped
3173 Alexander Nozdrin 2011-06-09
Pre-requisite patch for Bug#11763162 (55843 - Handled condition
appears as not handled).
Get rid of THD::set_warning_info() as a shortcut
to Diagnostics_area::set_warning_info().
modified:
sql/sp_head.cc
sql/sql_admin.cc
sql/sql_class.h
sql/sql_show.cc
=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc 2011-06-09 08:58:41 +0000
+++ b/sql/sp_head.cc 2011-06-09 09:43:53 +0000
@@ -1214,6 +1214,7 @@ sp_head::execute(THD *thd, bool merge_da
String old_packet;
Reprepare_observer *save_reprepare_observer= thd->m_reprepare_observer;
Object_creation_ctx *saved_creation_ctx;
+ Diagnostics_area *da= thd->get_stmt_da();
Warning_info *saved_warning_info;
Warning_info warning_info(thd->get_warning_info()->warn_id(), false);
@@ -1288,7 +1289,7 @@ sp_head::execute(THD *thd, bool merge_da
/* Push a new warning information area. */
warning_info.append_warning_info(thd, thd->get_warning_info());
saved_warning_info= thd->get_warning_info();
- thd->set_warning_info(&warning_info);
+ da->set_warning_info(&warning_info);
/*
Switch query context. This has to be done early as this is sometimes
@@ -1497,7 +1498,7 @@ sp_head::execute(THD *thd, bool merge_da
*/
if (err_status || merge_da_on_success)
saved_warning_info->merge_with_routine_info(thd, thd->get_warning_info());
- thd->set_warning_info(saved_warning_info);
+ da->set_warning_info(saved_warning_info);
done:
DBUG_PRINT("info", ("err_status: %d killed: %d is_slave_error: %d report_error: %d",
=== modified file 'sql/sql_admin.cc'
--- a/sql/sql_admin.cc 2011-06-09 08:58:41 +0000
+++ b/sql/sql_admin.cc 2011-06-09 09:43:53 +0000
@@ -351,17 +351,18 @@ static bool mysql_admin_table(THD* thd,
because it's already known that the table is badly damaged.
*/
+ Diagnostics_area *da= thd->get_stmt_da();
Warning_info wi(thd->query_id, false);
Warning_info *wi_saved= thd->get_warning_info();
- thd->set_warning_info(&wi);
+ da->set_warning_info(&wi);
open_error= open_temporary_tables(thd, table);
if (!open_error)
open_error= open_and_lock_tables(thd, table, TRUE, 0);
- thd->set_warning_info(wi_saved);
+ da->set_warning_info(wi_saved);
}
else
{
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2011-06-09 09:36:20 +0000
+++ b/sql/sql_class.h 2011-06-09 09:43:53 +0000
@@ -2840,10 +2840,6 @@ public:
const Warning_info *get_warning_info() const
{ return const_cast<THD *> (this)->get_warning_info(); }
- /// Sets Warning-information-area for the current statement.
- void set_warning_info(Warning_info *wi)
- { get_stmt_da()->set_warning_info(wi); }
-
/// Returns Diagnostics-area for the current statement.
Diagnostics_area *get_stmt_da()
{ return m_stmt_da; }
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2011-06-09 08:58:41 +0000
+++ b/sql/sql_show.cc 2011-06-09 09:43:53 +0000
@@ -6803,15 +6803,16 @@ static bool do_fill_table(THD *thd,
// Warning_info, so "useful warnings" get rejected. In order to avoid
// that problem we create a Warning_info instance, which is capable of
// storing "unlimited" number of warnings.
+ Diagnostics_area *da= thd->get_stmt_da();
Warning_info wi(thd->query_id, true);
Warning_info *wi_saved= thd->get_warning_info();
- thd->set_warning_info(&wi);
+ da->set_warning_info(&wi);
bool res= table_list->schema_table->fill_table(
thd, table_list, join_table->condition());
- thd->set_warning_info(wi_saved);
+ da->set_warning_info(wi_saved);
// Pass an error if any.
Attachment: [text/bzr-bundle] bzr/alexander.nozdrin@oracle.com-20110609094353-8vm2z8c0qnhli9y2.bundle