From 6a8fcca87eaf83a99846fdc3939b856ae1bc5c43 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Oct 2007 20:08:16 +0300 Subject: Use an inline getter method (thd->is_error()) to query if there is an error in THD. In future the error may be stored elsewhere (not in net.report_error) and it's important to start using an opaque getter to simplify merges. sql/filesort.cc: net.report_error -> is_error() sql/ha_ndbcluster_binlog.cc: net.report_error -> is_error() sql/item_func.cc: net.report_error -> is_error() sql/item_subselect.cc: net.report_error -> is_error() sql/set_var.cc: net.report_error -> is_error() sql/sp.cc: net.report_error -> is_error() sql/sp_head.cc: net.report_error -> is_error() sql/sql_base.cc: net.report_error -> is_error() sql/sql_class.cc: net.report_error -> is_error() sql/sql_class.h: net.report_error -> is_error() sql/sql_connect.cc: net.report_error -> is_error() sql/sql_delete.cc: net.report_error -> is_error() sql/sql_insert.cc: net.report_error -> is_error() sql/sql_parse.cc: net.report_error -> is_error() sql/sql_prepare.cc: net.report_error -> is_error() sql/sql_select.cc: net.report_error -> is_error() sql/sql_union.cc: net.report_error -> is_error() sql/sql_update.cc: net.report_error -> is_error() sql/sql_view.cc: net.report_error -> is_error() sql/sql_yacc.yy: net.report_error -> is_error() --- sql/sql_class.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index a7f196cd825..a3e71e183f3 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1468,7 +1468,7 @@ public: bool in_lock_tables; /** True if a slave error. Causes the slave to stop. Not the same - as the statement execution error (net.report_error), since + as the statement execution error (is_error()), since a statement may be expected to return an error, e.g. because it returned an error on master, and this is OK on the slave. */ @@ -1716,6 +1716,20 @@ public: net.report_error= 1; DBUG_PRINT("error",("Fatal error set")); } + /** + TRUE if there is an error in the error stack. + + Please use this method instead of direct access to + net.report_error. + + If TRUE, the current (sub)-statement should be aborted. + The main difference between this member and is_fatal_error + is that a fatal error can not be handled by a stored + procedure continue handler, whereas a normal error can. + + To raise this flag, use my_error(). + */ + inline bool is_error() const { return net.report_error; } inline CHARSET_INFO *charset() { return variables.character_set_client; } void update_charset(); -- cgit v1.2.1