From: Alexander Nozdrin Date: June 8 2011 9:55am Subject: Re: bzr commit into mysql-trunk branch (alexander.nozdrin:3165) Bug#11763162 List-Archive: http://lists.mysql.com/commits/138827 Message-Id: <4DEF472D.90102@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello, On 06/07/11 19:32, Davi Arnaut wrote: >> === modified file 'sql/sql_class.h' >> --- a/sql/sql_class.h 2011-05-31 13:52:09 +0000 >> +++ b/sql/sql_class.h 2011-06-07 13:09:47 +0000 >> @@ -2178,6 +2178,12 @@ public: >> auto_inc_intervals_forced.append(next_id, ULONGLONG_MAX, 0); >> } >> >> + inline Warning_info *get_warning_info() { return m_warning_info; } >> + inline void set_warning_info(Warning_info *wi) { m_warning_info= wi; } >> + >> + inline Diagnostics_area *get_stmt_da() { return m_stmt_da; } >> + inline void set_stmt_da(Diagnostics_area *da) { m_stmt_da= da; } > > Please drop the inline keyword, it's not necessary for member functions > that are defined in the class body. If it is not critical, I'd leave them. They can be helpful when grepping. > Please also move those closer to the > other functions related to the diagnostics area (ie, clear_error, > is_error, etc). Ok. >> === modified file 'sql/table.cc' >> --- a/sql/table.cc 2011-05-26 15:20:09 +0000 >> +++ b/sql/table.cc 2011-06-07 13:09:47 +0000 >> @@ -3841,20 +3841,20 @@ void TABLE_LIST::hide_view_error(THD *th >> /* Hide "Unknown column" or "Unknown function" error */ >> DBUG_ASSERT(thd->is_error()); >> >> - if (thd->stmt_da->sql_errno() == ER_BAD_FIELD_ERROR || >> - thd->stmt_da->sql_errno() == ER_SP_DOES_NOT_EXIST || >> - thd->stmt_da->sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION || >> - thd->stmt_da->sql_errno() == ER_PROCACCESS_DENIED_ERROR || >> - thd->stmt_da->sql_errno() == ER_COLUMNACCESS_DENIED_ERROR || >> - thd->stmt_da->sql_errno() == ER_TABLEACCESS_DENIED_ERROR || >> - thd->stmt_da->sql_errno() == ER_TABLE_NOT_LOCKED || >> - thd->stmt_da->sql_errno() == ER_NO_SUCH_TABLE) >> + if (thd->get_stmt_da()->sql_errno() == ER_BAD_FIELD_ERROR || >> + thd->get_stmt_da()->sql_errno() == ER_SP_DOES_NOT_EXIST || >> + thd->get_stmt_da()->sql_errno() == ER_FUNC_INEXISTENT_NAME_COLLISION || >> + thd->get_stmt_da()->sql_errno() == ER_PROCACCESS_DENIED_ERROR || >> + thd->get_stmt_da()->sql_errno() == ER_COLUMNACCESS_DENIED_ERROR || >> + thd->get_stmt_da()->sql_errno() == ER_TABLEACCESS_DENIED_ERROR || >> + thd->get_stmt_da()->sql_errno() == ER_TABLE_NOT_LOCKED || >> + thd->get_stmt_da()->sql_errno() == ER_NO_SUCH_TABLE) > > This becomes a bit more unpleasant. Could you please rewrite it into a > switch statement? Patch attached. Ok. Thanks!