List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:June 9 2011 6:50am
Subject:Re: bzr commit into mysql-trunk branch (alexander.nozdrin:3168) Bug#11763162
View as plain text  
Hello,

On 06/08/2011 04:46 PM, Alexander Nozdrin wrote:
>   3168 Alexander Nozdrin	2011-06-08
>        Pre-requisite patch for Bug#11763162 (55843 - Handled condition
>        appears as not handled).
>
>        Make THD::stmt_da and THD::warning_info private,
>        and provide getters/setters for them:
>          - THD::get_stmt_da()
>          - THD::set_stmt_da()
>          - THD::get_warning_info()
>          - THD::set_warning_info()

Patch approved, one comment below.

> === 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-08 14:46:12 +0000
> @@ -2832,7 +2830,33 @@ public:
>
>       To raise this flag, use my_error().
>     */
> -  inline bool is_error() const { return stmt_da->is_error(); }
> +  inline bool is_error() const { return get_stmt_da()->is_error(); }
> +
> +  /// Returns Warning-information-area for the current statement.
> +  Warning_info *get_warning_info()
> +  { return m_warning_info; }
> +
> +  /// Returns Warning-information-area for the current statement.
> +  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)
> +  { m_warning_info= wi; }
> +
> +  /// Returns Diagnostics-area for the current statement.
> +  Diagnostics_area *get_stmt_da()
> +  { return m_stmt_da; }
> +
> +  /// Returns Diagnostics-area for the current statement.
> +  const Diagnostics_area *get_stmt_da() const
> +  { return const_cast<THD *>  (this)->get_stmt_da(); }
> +
> +  /// Sets Diagnostics-area for the current statement.
> +  void set_stmt_da(Diagnostics_area *da)
> +  { m_stmt_da= da; }

I know I said that I prefer get/set also used inside THD,
but I didn't really mean inside overloaded get'ers :-)
Both get_stmt_da() functions will be covered by the same
breakpoint anyway.

--- Jon Olav
Thread
bzr commit into mysql-trunk branch (alexander.nozdrin:3168) Bug#11763162Alexander Nozdrin8 Jun
  • Re: bzr commit into mysql-trunk branch (alexander.nozdrin:3168) Bug#11763162Jon Olav Hauglid9 Jun