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.
This commit is contained in:
kostja@bodhi.(none) 2007-10-30 20:08:16 +03:00
parent 0909d1f8cb
commit e4b353c40c
20 changed files with 82 additions and 68 deletions

View File

@ -555,7 +555,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
else else
file->unlock_row(); file->unlock_row();
/* It does not make sense to read more keys in case of a fatal error */ /* It does not make sense to read more keys in case of a fatal error */
if (thd->net.report_error) if (thd->is_error())
break; break;
} }
if (quick_select) if (quick_select)
@ -573,7 +573,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
file->ha_rnd_end(); file->ha_rnd_end();
} }
if (thd->net.report_error) if (thd->is_error())
DBUG_RETURN(HA_POS_ERROR); DBUG_RETURN(HA_POS_ERROR);
/* Signal we should use orignal column read and write maps */ /* Signal we should use orignal column read and write maps */

View File

@ -271,7 +271,7 @@ static void run_query(THD *thd, char *buf, char *end,
sql_print_error("NDB: %s: error %s %d(ndb: %d) %d %d", sql_print_error("NDB: %s: error %s %d(ndb: %d) %d %d",
buf, thd->net.last_error, thd->net.last_errno, buf, thd->net.last_error, thd->net.last_errno,
thd_ndb->m_error_code, thd_ndb->m_error_code,
thd->net.report_error, thd->is_slave_error); (int) thd->is_error(), thd->is_slave_error);
} }
thd->options= save_thd_options; thd->options= save_thd_options;

View File

@ -187,7 +187,7 @@ Item_func::fix_fields(THD *thd, Item **ref)
} }
} }
fix_length_and_dec(); fix_length_and_dec();
if (thd->net.report_error) // An error inside fix_length_and_dec occured if (thd->is_error()) // An error inside fix_length_and_dec occured
return TRUE; return TRUE;
fixed= 1; fixed= 1;
return FALSE; return FALSE;
@ -4073,7 +4073,7 @@ my_decimal *user_var_entry::val_decimal(my_bool *null_value, my_decimal *val)
NOTES NOTES
For now it always return OK. All problem with value evaluating For now it always return OK. All problem with value evaluating
will be caught by thd->net.report_error check in sql_set_variables(). will be caught by thd->is_error() check in sql_set_variables().
RETURN RETURN
FALSE OK. FALSE OK.

View File

@ -248,7 +248,7 @@ bool Item_subselect::exec()
{ {
int res; int res;
if (thd->net.report_error) if (thd->is_error())
/* Do not execute subselect in case of a fatal error */ /* Do not execute subselect in case of a fatal error */
return 1; return 1;

View File

@ -3051,7 +3051,7 @@ int sql_set_variables(THD *thd, List<set_var_base> *var_list)
if ((error= var->check(thd))) if ((error= var->check(thd)))
goto err; goto err;
} }
if (!(error= test(thd->net.report_error))) if (!(error= test(thd->is_error())))
{ {
it.rewind(); it.rewind();
while ((var= it++)) while ((var= it++))

View File

@ -1866,7 +1866,7 @@ sp_cache_routines_and_add_tables_aux(THD *thd, LEX *lex,
an error with it's return value without calling my_error(), we an error with it's return value without calling my_error(), we
set the generic "mysql.proc table corrupt" error here. set the generic "mysql.proc table corrupt" error here.
*/ */
if (!thd->net.report_error) if (! thd->is_error())
{ {
/* /*
SP allows full NAME_LEN chars thus he have to allocate enough SP allows full NAME_LEN chars thus he have to allocate enough

View File

@ -370,7 +370,7 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr)
thd->abort_on_warning= save_abort_on_warning; thd->abort_on_warning= save_abort_on_warning;
thd->transaction.stmt.modified_non_trans_table= save_stmt_modified_non_trans_table; thd->transaction.stmt.modified_non_trans_table= save_stmt_modified_non_trans_table;
if (thd->net.report_error) if (thd->is_error())
{ {
/* Return error status if something went wrong. */ /* Return error status if something went wrong. */
err_status= TRUE; err_status= TRUE;
@ -1277,7 +1277,7 @@ sp_head::execute(THD *thd)
done: done:
DBUG_PRINT("info", ("err_status: %d killed: %d is_slave_error: %d report_error: %d", DBUG_PRINT("info", ("err_status: %d killed: %d is_slave_error: %d report_error: %d",
err_status, thd->killed, thd->is_slave_error, err_status, thd->killed, thd->is_slave_error,
thd->net.report_error)); thd->is_error()));
if (thd->killed) if (thd->killed)
err_status= TRUE; err_status= TRUE;
@ -2673,7 +2673,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
cleanup_items() is called in sp_head::execute() cleanup_items() is called in sp_head::execute()
*/ */
DBUG_RETURN(res || thd->net.report_error); DBUG_RETURN(res || thd->is_error());
} }

View File

@ -6260,7 +6260,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
thd->lex->allow_sum_func= save_allow_sum_func; thd->lex->allow_sum_func= save_allow_sum_func;
thd->mark_used_columns= save_mark_used_columns; thd->mark_used_columns= save_mark_used_columns;
DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns)); DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns));
DBUG_RETURN(test(thd->net.report_error)); DBUG_RETURN(test(thd->is_error()));
} }
@ -6804,7 +6804,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
select_lex->conds_processed_with_permanent_arena= 1; select_lex->conds_processed_with_permanent_arena= 1;
} }
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup; thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
DBUG_RETURN(test(thd->net.report_error)); DBUG_RETURN(test(thd->is_error()));
err_no_arena: err_no_arena:
select_lex->is_item_list_lookup= save_is_item_list_lookup; select_lex->is_item_list_lookup= save_is_item_list_lookup;
@ -6886,7 +6886,7 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
goto err; goto err;
} }
} }
DBUG_RETURN(thd->net.report_error); DBUG_RETURN(thd->is_error());
err: err:
if (table) if (table)
table->auto_increment_field_not_null= FALSE; table->auto_increment_field_not_null= FALSE;
@ -6971,7 +6971,7 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
table= (*ptr)->table; table= (*ptr)->table;
table->auto_increment_field_not_null= FALSE; table->auto_increment_field_not_null= FALSE;
} }
while ((field = *ptr++) && !thd->net.report_error) while ((field = *ptr++) && ! thd->is_error())
{ {
value=v++; value=v++;
table= field->table; table= field->table;
@ -6980,7 +6980,7 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
if (value->save_in_field(field, 0) < 0) if (value->save_in_field(field, 0) < 0)
goto err; goto err;
} }
DBUG_RETURN(thd->net.report_error); DBUG_RETURN(thd->is_error());
err: err:
if (table) if (table)

View File

@ -1368,7 +1368,7 @@ bool select_send::send_data(List<Item> &items)
thd->sent_row_count++; thd->sent_row_count++;
if (!thd->vio_ok()) if (!thd->vio_ok())
DBUG_RETURN(0); DBUG_RETURN(0);
if (!thd->net.report_error) if (! thd->is_error())
DBUG_RETURN(protocol->write()); DBUG_RETURN(protocol->write());
protocol->remove_last_row(); protocol->remove_last_row();
DBUG_RETURN(1); DBUG_RETURN(1);
@ -1389,7 +1389,7 @@ bool select_send::send_eof()
mysql_unlock_tables(thd, thd->lock); mysql_unlock_tables(thd, thd->lock);
thd->lock=0; thd->lock=0;
} }
if (!thd->net.report_error) if (! thd->is_error())
{ {
::send_eof(thd); ::send_eof(thd);
status= 0; status= 0;

View File

@ -1468,7 +1468,7 @@ public:
bool in_lock_tables; bool in_lock_tables;
/** /**
True if a slave error. Causes the slave to stop. Not the same 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 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. it returned an error on master, and this is OK on the slave.
*/ */
@ -1716,6 +1716,20 @@ public:
net.report_error= 1; net.report_error= 1;
DBUG_PRINT("error",("Fatal error set")); 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; } inline CHARSET_INFO *charset() { return variables.character_set_client; }
void update_charset(); void update_charset();

View File

@ -975,12 +975,12 @@ void end_connection(THD *thd)
decrease_user_connections(thd->user_connect); decrease_user_connections(thd->user_connect);
if (thd->killed || if (thd->killed ||
net->error && net->vio != 0 && net->report_error) net->error && net->vio != 0 && thd->is_error())
{ {
statistic_increment(aborted_threads,&LOCK_status); statistic_increment(aborted_threads,&LOCK_status);
} }
if (net->error && net->vio != 0 && net->report_error) if (net->error && net->vio != 0 && thd->is_error())
{ {
if (!thd->killed && thd->variables.log_warnings > 1) if (!thd->killed && thd->variables.log_warnings > 1)
{ {
@ -1030,7 +1030,7 @@ static void prepare_new_connection_state(THD* thd)
if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL)) if (sys_init_connect.value_length && !(sctx->master_access & SUPER_ACL))
{ {
execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect); execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
if (thd->net.report_error) if (thd->is_error())
{ {
thd->killed= THD::KILL_CONNECTION; thd->killed= THD::KILL_CONNECTION;
sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION), sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),

View File

@ -252,10 +252,10 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
table->mark_columns_needed_for_delete(); table->mark_columns_needed_for_delete();
while (!(error=info.read_record(&info)) && !thd->killed && while (!(error=info.read_record(&info)) && !thd->killed &&
!thd->net.report_error) ! thd->is_error())
{ {
// thd->net.report_error is tested to disallow delete row on error // thd->is_error() is tested to disallow delete row on error
if (!(select && select->skip_record())&& !thd->net.report_error ) if (!(select && select->skip_record())&& ! thd->is_error() )
{ {
if (table->triggers && if (table->triggers &&
@ -389,7 +389,7 @@ cleanup:
send_ok(thd, (ha_rows) thd->row_count_func); send_ok(thd, (ha_rows) thd->row_count_func);
DBUG_PRINT("info",("%ld records deleted",(long) deleted)); DBUG_PRINT("info",("%ld records deleted",(long) deleted));
} }
DBUG_RETURN(error >= 0 || thd->net.report_error); DBUG_RETURN(error >= 0 || thd->is_error());
} }

View File

@ -738,7 +738,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
table->triggers, table->triggers,
TRG_EVENT_INSERT)) TRG_EVENT_INSERT))
{ {
if (values_list.elements != 1 && !thd->net.report_error) if (values_list.elements != 1 && ! thd->is_error())
{ {
info.records++; info.records++;
continue; continue;
@ -769,7 +769,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
table->triggers, table->triggers,
TRG_EVENT_INSERT)) TRG_EVENT_INSERT))
{ {
if (values_list.elements != 1 && ! thd->net.report_error) if (values_list.elements != 1 && ! thd->is_error())
{ {
info.records++; info.records++;
continue; continue;
@ -1909,7 +1909,7 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
thd->proc_info="got old table"; thd->proc_info="got old table";
if (di->thd.killed) 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 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); pthread_mutex_unlock(&di->mutex);
if (table_list->table) if (table_list->table)
{ {
DBUG_ASSERT(thd->net.report_error == 0); DBUG_ASSERT(! thd->is_error());
thd->di= di; thd->di= di;
} }
/* Unlock the delayed insert object after its last access. */ /* 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: end_create:
pthread_mutex_unlock(&LOCK_delayed_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 thd->count_cuted_fields= CHECK_FIELD_WARN; // Calculate cuted fields
store_values(values); store_values(values);
thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->count_cuted_fields= CHECK_FIELD_IGNORE;
if (thd->net.report_error) if (thd->is_error())
DBUG_RETURN(1); DBUG_RETURN(1);
if (table_list) // Not CREATE ... SELECT if (table_list) // Not CREATE ... SELECT
{ {

View File

@ -436,7 +436,7 @@ pthread_handler_t handle_bootstrap(void *arg)
if (thd->is_fatal_error) if (thd->is_fatal_error)
break; break;
if (thd->net.report_error) if (thd->is_error())
{ {
/* The query failed, send error to log and abort bootstrap */ /* The query failed, send error to log and abort bootstrap */
net_send_error(thd); 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); 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; char *next_packet= (char*) found_semicolon;
net->no_send_error= 0; 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(); thd->transaction.xid_state.xid.null();
/* report error issued during command execution */ /* 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(); thd->send_kill_message();
if (thd->net.report_error) if (thd->is_error())
net_send_error(thd); net_send_error(thd);
log_slow_statement(thd); log_slow_statement(thd);
@ -3930,7 +3930,7 @@ create_sp_error:
thd->row_count_func)); thd->row_count_func));
else 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 goto error; // Substatement should already have sent error
} }
} }
@ -4523,7 +4523,7 @@ finish:
*/ */
start_waiting_global_read_lock(thd); 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 else
#endif #endif
{ {
if (! thd->net.report_error) if (! thd->is_error())
{ {
/* /*
Binlog logs a string starting from thd->query and having length 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 else
{ {
DBUG_ASSERT(thd->net.report_error); DBUG_ASSERT(thd->is_error());
DBUG_PRINT("info",("Command aborted. Fatal_error: %d", DBUG_PRINT("info",("Command aborted. Fatal_error: %d",
thd->is_fatal_error)); thd->is_fatal_error));
@ -6311,7 +6311,7 @@ void add_join_natural(TABLE_LIST *a, TABLE_LIST *b, List<String> *using_fields,
RETURN RETURN
0 ok 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, 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; 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 || DBUG_ASSERT(!mysql_parse_status ||
mysql_parse_status && thd->net.report_error); mysql_parse_status && thd->is_error());
/* Reset Lex_input_stream. */ /* Reset Lex_input_stream. */

View File

@ -2864,7 +2864,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len)
lex_start(thd); lex_start(thd);
error= parse_sql(thd, &lip, NULL) || error= parse_sql(thd, &lip, NULL) ||
thd->net.report_error || thd->is_error() ||
init_param_array(this); init_param_array(this);
lex->set_trg_event_type_for_tables(); lex->set_trg_event_type_for_tables();

View File

@ -263,8 +263,8 @@ bool handle_select(THD *thd, LEX *lex, select_result *result,
result, unit, select_lex); result, unit, select_lex);
} }
DBUG_PRINT("info",("res: %d report_error: %d", res, DBUG_PRINT("info",("res: %d report_error: %d", res,
thd->net.report_error)); thd->is_error()));
res|= thd->net.report_error; res|= thd->is_error();
if (unlikely(res)) if (unlikely(res))
result->abort(); result->abort();
@ -491,7 +491,7 @@ JOIN::prepare(Item ***rref_pointer_array,
(having->fix_fields(thd, &having) || (having->fix_fields(thd, &having) ||
having->check_cols(1))); having->check_cols(1)));
select_lex->having_fix_field= 0; select_lex->having_fix_field= 0;
if (having_fix_rc || thd->net.report_error) if (having_fix_rc || thd->is_error())
DBUG_RETURN(-1); /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */
thd->lex->allow_sum_func= save_allow_sum_func; thd->lex->allow_sum_func= save_allow_sum_func;
} }
@ -817,7 +817,7 @@ JOIN::optimize()
} }
conds= optimize_cond(this, conds, join_list, &cond_value); conds= optimize_cond(this, conds, join_list, &cond_value);
if (thd->net.report_error) if (thd->is_error())
{ {
error= 1; error= 1;
DBUG_PRINT("error",("Error from optimize_cond")); DBUG_PRINT("error",("Error from optimize_cond"));
@ -826,7 +826,7 @@ JOIN::optimize()
{ {
having= optimize_cond(this, having, join_list, &having_value); having= optimize_cond(this, having, join_list, &having_value);
if (thd->net.report_error) if (thd->is_error())
{ {
error= 1; error= 1;
DBUG_PRINT("error",("Error from optimize_cond")); DBUG_PRINT("error",("Error from optimize_cond"));
@ -1031,7 +1031,7 @@ JOIN::optimize()
{ {
ORDER *org_order= order; ORDER *org_order= order;
order=remove_const(this, order,conds,1, &simple_order); order=remove_const(this, order,conds,1, &simple_order);
if (thd->net.report_error) if (thd->is_error())
{ {
error= 1; error= 1;
DBUG_PRINT("error",("Error from remove_const")); DBUG_PRINT("error",("Error from remove_const"));
@ -1162,7 +1162,7 @@ JOIN::optimize()
group_list= remove_const(this, (old_group_list= group_list), conds, group_list= remove_const(this, (old_group_list= group_list), conds,
rollup.state == ROLLUP::STATE_NONE, rollup.state == ROLLUP::STATE_NONE,
&simple_group); &simple_group);
if (thd->net.report_error) if (thd->is_error())
{ {
error= 1; error= 1;
DBUG_PRINT("error",("Error from remove_const")); DBUG_PRINT("error",("Error from remove_const"));
@ -1185,7 +1185,7 @@ JOIN::optimize()
{ {
group_list= procedure->group= remove_const(this, procedure->group, conds, group_list= procedure->group= remove_const(this, procedure->group, conds,
1, &simple_group); 1, &simple_group);
if (thd->net.report_error) if (thd->is_error())
{ {
error= 1; error= 1;
DBUG_PRINT("error",("Error from remove_const")); DBUG_PRINT("error",("Error from remove_const"));
@ -2098,10 +2098,10 @@ JOIN::exec()
} }
} }
} }
/* XXX: When can we have here thd->net.report_error not zero? */ /* XXX: When can we have here thd->is_error() not zero? */
if (thd->net.report_error) if (thd->is_error())
{ {
error= thd->net.report_error; error= thd->is_error();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
curr_join->having= curr_join->tmp_having; curr_join->having= curr_join->tmp_having;
@ -2307,7 +2307,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
join->having_history= (join->having?join->having:join->tmp_having); join->having_history= (join->having?join->having:join->tmp_having);
} }
if (thd->net.report_error) if (thd->is_error())
goto err; goto err;
join->exec(); join->exec();
@ -2333,7 +2333,7 @@ err:
{ {
thd->proc_info="end"; thd->proc_info="end";
err|= select_lex->cleanup(); err|= select_lex->cleanup();
DBUG_RETURN(err || thd->net.report_error); DBUG_RETURN(err || thd->is_error());
} }
DBUG_RETURN(join->error); DBUG_RETURN(join->error);
} }
@ -10717,7 +10717,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
DBUG_PRINT("error",("Error: do_select() failed")); DBUG_PRINT("error",("Error: do_select() failed"));
} }
#endif #endif
DBUG_RETURN(join->thd->net.report_error ? -1 : rc); DBUG_RETURN(join->thd->is_error() ? -1 : rc);
} }
@ -16050,7 +16050,7 @@ bool mysql_explain_union(THD *thd, SELECT_LEX_UNIT *unit, select_result *result)
first->options | thd->options | SELECT_DESCRIBE, first->options | thd->options | SELECT_DESCRIBE,
result, unit, first); result, unit, first);
} }
DBUG_RETURN(res || thd->net.report_error); DBUG_RETURN(res || thd->is_error());
} }

View File

@ -58,7 +58,7 @@ bool select_union::send_data(List<Item> &values)
return 0; return 0;
} }
fill_record(thd, table->field, values, 1); fill_record(thd, table->field, values, 1);
if (thd->net.report_error) if (thd->is_error())
return 1; return 1;
if ((error= table->file->ha_write_row(table->record[0]))) if ((error= table->file->ha_write_row(table->record[0])))

View File

@ -844,7 +844,7 @@ int mysql_update(THD *thd,
} }
thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */ thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
thd->abort_on_warning= 0; thd->abort_on_warning= 0;
DBUG_RETURN((error >= 0 || thd->net.report_error) ? 1 : 0); DBUG_RETURN((error >= 0 || thd->is_error()) ? 1 : 0);
err: err:
delete select; delete select;
@ -1193,8 +1193,8 @@ bool mysql_multi_update(THD *thd,
OPTION_SETUP_TABLES_DONE, OPTION_SETUP_TABLES_DONE,
result, unit, select_lex); result, unit, select_lex);
DBUG_PRINT("info",("res: %d report_error: %d", res, DBUG_PRINT("info",("res: %d report_error: %d", res,
thd->net.report_error)); (int) thd->is_error()));
res|= thd->net.report_error; res|= thd->is_error();
if (unlikely(res)) if (unlikely(res))
{ {
/* If we had a another error reported earlier then this will be ignored */ /* If we had a another error reported earlier then this will be ignored */

View File

@ -607,7 +607,7 @@ err:
thd->proc_info= "end"; thd->proc_info= "end";
lex->link_first_table_back(view, link_to_local); lex->link_first_table_back(view, link_to_local);
unit->cleanup(); unit->cleanup();
DBUG_RETURN(res || thd->net.report_error); DBUG_RETURN(res || thd->is_error());
} }
@ -823,7 +823,7 @@ loop_out:
view_parameters + revision_number_position, 1, view_parameters + revision_number_position, 1,
&file_parser_dummy_hook)) &file_parser_dummy_hook))
{ {
error= thd->net.report_error? -1 : 0; error= thd->is_error() ? -1 : 0;
goto err; goto err;
} }
} }
@ -886,7 +886,7 @@ loop_out:
if (sql_create_definition_file(&dir, &file, view_file_type, if (sql_create_definition_file(&dir, &file, view_file_type,
(uchar*)view, view_parameters, num_view_backups)) (uchar*)view, view_parameters, num_view_backups))
{ {
error= thd->net.report_error? -1 : 1; error= thd->is_error() ? -1 : 1;
goto err; goto err;
} }
DBUG_RETURN(0); DBUG_RETURN(0);

View File

@ -9804,7 +9804,7 @@ NUM_literal:
| DECIMAL_NUM | DECIMAL_NUM
{ {
$$= new Item_decimal($1.str, $1.length, YYTHD->charset()); $$= new Item_decimal($1.str, $1.length, YYTHD->charset());
if (YYTHD->net.report_error) if (YYTHD->is_error())
{ {
MYSQL_YYABORT; MYSQL_YYABORT;
} }
@ -9812,7 +9812,7 @@ NUM_literal:
| FLOAT_NUM | FLOAT_NUM
{ {
$$ = new Item_float($1.str, $1.length); $$ = new Item_float($1.str, $1.length);
if (YYTHD->net.report_error) if (YYTHD->is_error())
{ {
MYSQL_YYABORT; MYSQL_YYABORT;
} }