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