1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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

@ -436,7 +436,7 @@ pthread_handler_t handle_bootstrap(void *arg)
if (thd->is_fatal_error)
break;
if (thd->net.report_error)
if (thd->is_error())
{
/* The query failed, send error to log and abort bootstrap */
net_send_error(thd);
@ -990,7 +990,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
mysql_parse(thd, thd->query, thd->query_length, & found_semicolon);
while (!thd->killed && found_semicolon && !thd->net.report_error)
while (!thd->killed && found_semicolon && ! thd->is_error())
{
char *next_packet= (char*) found_semicolon;
net->no_send_error= 0;
@ -1355,9 +1355,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->transaction.xid_state.xid.null();
/* report error issued during command execution */
if (thd->killed_errno() && !thd->net.report_error)
if (thd->killed_errno() && ! thd->is_error())
thd->send_kill_message();
if (thd->net.report_error)
if (thd->is_error())
net_send_error(thd);
log_slow_statement(thd);
@ -3930,7 +3930,7 @@ create_sp_error:
thd->row_count_func));
else
{
DBUG_ASSERT(thd->net.report_error == 1 || thd->killed);
DBUG_ASSERT(thd->is_error() || thd->killed);
goto error; // Substatement should already have sent error
}
}
@ -4523,7 +4523,7 @@ finish:
*/
start_waiting_global_read_lock(thd);
}
DBUG_RETURN(res || thd->net.report_error);
DBUG_RETURN(res || thd->is_error());
}
@ -5467,7 +5467,7 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
else
#endif
{
if (! thd->net.report_error)
if (! thd->is_error())
{
/*
Binlog logs a string starting from thd->query and having length
@ -5491,7 +5491,7 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
}
else
{
DBUG_ASSERT(thd->net.report_error);
DBUG_ASSERT(thd->is_error());
DBUG_PRINT("info",("Command aborted. Fatal_error: %d",
thd->is_fatal_error));
@ -6311,7 +6311,7 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
RETURN
0 ok
!=0 error. thd->killed or thd->net.report_error is set
!=0 error. thd->killed or thd->is_error() is set
*/
bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
@ -7274,10 +7274,10 @@ bool parse_sql(THD *thd,
bool mysql_parse_status= MYSQLparse(thd) != 0;
/* Check that if MYSQLparse() failed, thd->net.report_error is set. */
/* Check that if MYSQLparse() failed, thd->is_error() is set. */
DBUG_ASSERT(!mysql_parse_status ||
mysql_parse_status && thd->net.report_error);
mysql_parse_status && thd->is_error());
/* Reset Lex_input_stream. */