1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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()
This commit is contained in:
unknown
2007-10-30 20:08:16 +03:00
parent f139033063
commit 2437001234
20 changed files with 82 additions and 68 deletions

View File

@@ -738,7 +738,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
table->triggers,
TRG_EVENT_INSERT))
{
if (values_list.elements != 1 && !thd->net.report_error)
if (values_list.elements != 1 && ! thd->is_error())
{
info.records++;
continue;
@@ -769,7 +769,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
table->triggers,
TRG_EVENT_INSERT))
{
if (values_list.elements != 1 && ! thd->net.report_error)
if (values_list.elements != 1 && ! thd->is_error())
{
info.records++;
continue;
@@ -1909,7 +1909,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
thd->proc_info="got old table";
if (di->thd.killed)
{
if (di->thd.net.report_error)
if (di->thd.is_error())
{
/*
Copy the error message. Note that we don't treat fatal
@@ -1940,7 +1940,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
pthread_mutex_unlock(&di->mutex);
if (table_list->table)
{
DBUG_ASSERT(thd->net.report_error == 0);
DBUG_ASSERT(! thd->is_error());
thd->di= di;
}
/* Unlock the delayed insert object after its last access. */
@@ -1949,7 +1949,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
end_create:
pthread_mutex_unlock(&LOCK_delayed_create);
DBUG_RETURN(thd->net.report_error);
DBUG_RETURN(thd->is_error());
}
@@ -3015,7 +3015,7 @@ bool select_insert::send_data(List<Item> &values)
thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields
store_values(values);
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
if (thd->net.report_error)
if (thd->is_error())
DBUG_RETURN(1);
if (table_list) // Not CREATE ... SELECT
{