1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

post-review fixes

mysql-test/r/rpl_rotate_logs.result:
  removed host dependence in error messages
mysql-test/t/rpl_rotate_logs.test:
  removed host dependence in error messages
mysys/my_error.c:
  comment about using my_error family functions
sql/filesort.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/ha_innodb.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/handler.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/item.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/item_cmpfunc.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/item_func.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/item_strfunc.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/item_subselect.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/item_sum.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/lock.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/log.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/mysql_priv.h:
  error check moved to fill_record
sql/mysqld.cc:
  fixed error messages
sql/parse_file.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/protocol.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/protocol_cursor.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/repl_failsafe.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/set_var.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/slave.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sp.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sp_head.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sp_rcontext.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_acl.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_analyse.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_base.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
  error check moved to fill_record
sql/sql_class.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_class.h:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_db.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_delete.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
  error check moved to fill_record
sql/sql_handler.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_help.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_insert.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
  error check moved to fill_record
sql/sql_lex.cc:
  layout fixed
sql/sql_load.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_map.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_parse.cc:
  error check moved to fill_record
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_prepare.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_rename.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_repl.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_select.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_show.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_table.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_trigger.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_udf.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_union.cc:
  error check moved to fill_record
sql/sql_update.cc:
  error check moved to fill_record
sql/sql_view.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/sql_yacc.yy:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/table.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
sql/unireg.cc:
  changing my_error on my_message and my_printf_error where if they are prefered
This commit is contained in:
unknown
2004-11-12 14:34:00 +02:00
parent 17cf3c633e
commit 9e921615a1
53 changed files with 938 additions and 593 deletions

View File

@@ -100,7 +100,8 @@ check_insert_fields(THD *thd, TABLE_LIST *table_list, List<Item> &fields,
if (check_unique && thd->dupp_field)
{
my_error(ER_FIELD_SPECIFIED_TWICE,MYF(0), thd->dupp_field->field_name);
my_printf_error(ER_FIELD_SPECIFIED_TWICE, ER(ER_FIELD_SPECIFIED_TWICE),
MYF(0), thd->dupp_field->field_name);
return -1;
}
if (table->timestamp_field && // Don't set timestamp if used
@@ -291,7 +292,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
if (fields.elements || !value_count)
{
restore_record(table,default_values); // Get empty record
if (fill_record(fields, *values, 0)|| thd->net.report_error)
if (fill_record(thd, fields, *values, 0))
{
if (values_list.elements != 1 && !thd->net.report_error)
{
@@ -299,14 +300,10 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
continue;
}
/*
Field::store methods can't send errors
TODO: set thd->abort_on_warning if values_list.elements == 1
and check that all items return warning in case of problem with
storing field.
*/
if (!thd->net.report_error)
my_error(ER_UNKNOWN_ERROR, MYF(0));
error=1;
break;
}
@@ -317,16 +314,13 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
restore_record(table,default_values); // Get empty record
else
table->record[0][0]=table->default_values[0]; // Fix delete marker
if (fill_record(table->field,*values, 0) || thd->net.report_error)
if (fill_record(thd, table->field, *values, 0))
{
if (values_list.elements != 1 && ! thd->net.report_error)
{
info.records++;
continue;
}
/* Field::store methods can't send errors */
if (!thd->net.report_error)
my_error(ER_UNKNOWN_ERROR, MYF(0));
error=1;
break;
}
@@ -608,7 +602,8 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
(insert_into_view &&
check_view_insertability(table_list, thd->query_id)))
{
my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "INSERT");
my_printf_error(ER_NON_UPDATABLE_TABLE, ER(ER_NON_UPDATABLE_TABLE),
MYF(0), table_list->alias, "INSERT");
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@@ -655,7 +650,8 @@ bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
if (unique_table(table_list, table_list->next_independent()))
{
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name);
my_printf_error(ER_UPDATE_TABLE_USED, ER(ER_UPDATE_TABLE_USED),
MYF(0), table_list->real_name);
DBUG_RETURN(TRUE);
}
thd->lex->select_lex.first_execution= 0;
@@ -751,13 +747,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
*/
store_record(table,insert_values);
restore_record(table,record[1]);
if (fill_record(*info->update_fields, *info->update_values, 0))
{
/* Field::store methods can't send errors */
if (!thd->net.report_error)
my_error(ER_UNKNOWN_ERROR, MYF(0));
if (fill_record(thd, *info->update_fields, *info->update_values, 0))
goto err;
}
/* CHECK OPTION for VIEW ... ON DUPLICATE KEY UPDATE ... */
if (info->view &&
@@ -1018,7 +1009,7 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
{
delete tmp;
thd->fatal_error();
my_error(ER_OUT_OF_RESOURCES,MYF(0));
my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0));
pthread_mutex_unlock(&LOCK_delayed_create);
DBUG_RETURN(0);
}
@@ -1335,7 +1326,8 @@ extern "C" pthread_handler_decl(handle_delayed_insert,arg)
if (!(di->table->file->table_flags() & HA_CAN_INSERT_DELAYED))
{
thd->fatal_error();
my_error(ER_ILLEGAL_HA, MYF(0), di->table_list.real_name);
my_printf_error(ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA), MYF(0),
di->table_list.real_name);
goto end;
}
di->table->copy_blobs=1;
@@ -1761,9 +1753,9 @@ bool select_insert::send_data(List<Item> &values)
DBUG_RETURN(0);
}
if (fields->elements)
fill_record(*fields, values, 1);
fill_record(thd, *fields, values, 1);
else
fill_record(table->field, values, 1);
fill_record(thd, table->field, values, 1);
switch (table_list->view_check_option(thd,
thd->lex->duplicates == DUP_IGNORE))
{
@@ -1934,7 +1926,7 @@ bool select_create::send_data(List<Item> &values)
unit->offset_limit_cnt--;
return 0;
}
fill_record(field, values, 1);
fill_record(thd, field, values, 1);
if (thd->net.report_error || write_record(thd, table, &info))
return 1;
if (table->next_number_field) // Clear for next record