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

errors without code removed

net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
(WL#2133)


include/mysqld_error.h:
  new errors added.
mysql-test/r/rpl_charset.result:
  new error
mysql-test/r/rpl_timezone.result:
  new error
mysql-test/r/sp-security.result:
  more clean error message
mysql-test/r/sp.result:
  now error state intercepted correctly
mysql-test/t/connect.test:
  new error message
mysql-test/t/rpl_charset.test:
  new error message
mysql-test/t/rpl_timezone.test:
  new error
mysql-test/t/sp-security.test:
  more correct error handling
mysql-test/t/sp.test:
  now error state intercepted correctly
sql/ha_innodb.cc:
  -1/1 (sent/unsent) error reporting removed
sql/ha_innodb.h:
  -1/1 (sent/unsent) error reporting removed
sql/item.cc:
  only boolean values should be returned by fix_fields()
sql/item_cmpfunc.cc:
  only boolean values should be returned by fix_fields()
sql/item_func.cc:
  only boolean values should be returned by fix_fields()
  net_printf/send_error calls replaced by my_error family functions
sql/item_row.cc:
  only boolean values should be returned by fix_fields()
sql/item_subselect.cc:
  only boolean values should be returned by fix_fields()
  -1/1 (sent/unsent) error reporting removed
sql/item_subselect.h:
  -1/1 (sent/unsent) error reporting removed
sql/item_sum.cc:
  only boolean values should be returned by fix_fields()
sql/item_timefunc.cc:
  only boolean values should be returned by fix_fields()
sql/item_uniq.h:
  only boolean values should be returned by fix_fields()
sql/mysql_priv.h:
  -1/1 (sent/unsent) error reporting removed
sql/mysqld.cc:
  net_printf/send_error calls replaced by my_error family functions
  changes in my_message_sql to support error handling correctly
sql/protocol.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/protocol_cursor.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/repl_failsafe.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/repl_failsafe.h:
  -1/1 (sent/unsent) error reporting removed
sql/set_var.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/share/czech/errmsg.txt:
  new error messages
sql/share/danish/errmsg.txt:
  new error messages
sql/share/dutch/errmsg.txt:
  new error messages
sql/share/english/errmsg.txt:
  new error messages
sql/share/estonian/errmsg.txt:
  new error messages
sql/share/french/errmsg.txt:
  new error messages
sql/share/german/errmsg.txt:
  new error messages
sql/share/greek/errmsg.txt:
  new error messages
sql/share/hungarian/errmsg.txt:
  new error messages
sql/share/italian/errmsg.txt:
  new error messages
sql/share/japanese/errmsg.txt:
  new error messages
sql/share/korean/errmsg.txt:
  new error messages
sql/share/norwegian-ny/errmsg.txt:
  new error messages
sql/share/norwegian/errmsg.txt:
  new error messages
sql/share/polish/errmsg.txt:
  new error messages
sql/share/portuguese/errmsg.txt:
  new error messages
sql/share/romanian/errmsg.txt:
  new error messages
sql/share/russian/errmsg.txt:
  new error messages
sql/share/serbian/errmsg.txt:
  new error messages
sql/share/slovak/errmsg.txt:
  new error messages
sql/share/spanish/errmsg.txt:
  new error messages
sql/share/swedish/errmsg.txt:
  new error messages
sql/share/ukrainian/errmsg.txt:
  new error messages
sql/slave.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/slave.h:
  -1/1 (sent/unsent) error reporting removed
sql/sp.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/sp_head.cc:
  new eror handling support
  net_printf/send_error calls replaced by my_error family functions
sql/sp_rcontext.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/sql_acl.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/sql_acl.h:
  -1/1 (sent/unsent) error reporting removed
sql/sql_base.cc:
  -1/1 (sent/unsent) error reporting removed
  net_printf/send_error calls replaced by my_error family functions
sql/sql_class.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/sql_class.h:
  my_messhage_sql now set/reset query_error flag
sql/sql_db.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_delete.cc:
  -1/1 (sent/unsent) error reporting removed
  net_printf/send_error calls replaced by my_error family functions
sql/sql_do.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_error.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_handler.cc:
  -1/1 (sent/unsent) error reporting removed
  net_printf/send_error calls replaced by my_error family functions
sql/sql_help.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/sql_insert.cc:
  -1/1 (sent/unsent) error reporting removed
  net_printf/send_error calls replaced by my_error family functions
sql/sql_lex.h:
  -1/1 (sent/unsent) error reporting removed
sql/sql_load.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_map.cc:
  errors without code removed
sql/sql_parse.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed from mysql_execute_command
sql/sql_prepare.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/sql_repl.cc:
  error messages fixed
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/sql_repl.h:
  -1/1 (sent/unsent) error reporting removed
sql/sql_select.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_select.h:
  -1/1 (sent/unsent) error reporting removed
sql/sql_show.cc:
  -1/1 (sent/unsent) error reporting removed
  net_printf/send_error calls replaced by my_error family functions
sql/sql_table.cc:
  net_printf/send_error calls replaced by my_error family functions
  -1/1 (sent/unsent) error reporting removed
sql/sql_trigger.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_udf.cc:
  net_printf/send_error calls replaced by my_error family functions
sql/sql_union.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_update.cc:
  -1/1 (sent/unsent) error reporting removed
  net_printf/send_error calls replaced by my_error family functions
sql/sql_view.cc:
  -1/1 (sent/unsent) error reporting removed
sql/sql_view.h:
  -1/1 (sent/unsent) error reporting removed
sql/sql_yacc.yy:
  net_printf/send_error calls replaced by my_error family functions
This commit is contained in:
unknown
2004-10-20 04:04:37 +03:00
parent 65ed693681
commit 066c90563a
86 changed files with 1886 additions and 1566 deletions

View File

@@ -115,12 +115,12 @@ check_insert_fields(THD *thd, TABLE_LIST *table_list, List<Item> &fields,
}
int mysql_insert(THD *thd,TABLE_LIST *table_list,
List<Item> &fields,
List<List_item> &values_list,
List<Item> &update_fields,
List<Item> &update_values,
enum_duplicates duplic)
bool mysql_insert(THD *thd,TABLE_LIST *table_list,
List<Item> &fields,
List<List_item> &values_list,
List<Item> &update_fields,
List<Item> &update_values,
enum_duplicates duplic)
{
int error, res;
/*
@@ -174,7 +174,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
my_printf_error(ER_DELAYED_INSERT_TABLE_LOCKED,
ER(ER_DELAYED_INSERT_TABLE_LOCKED),
MYF(0), table_list->real_name);
DBUG_RETURN(-1);
DBUG_RETURN(TRUE);
}
}
if ((table= delayed_get_table(thd,table_list)) && !thd->is_fatal_error)
@@ -200,7 +200,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
#endif /* EMBEDDED_LIBRARY */
res= open_and_lock_tables(thd, table_list);
if (res || thd->is_fatal_error)
DBUG_RETURN(-1);
DBUG_RETURN(TRUE);
table= table_list->table;
thd->proc_info="init";
@@ -298,6 +298,15 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
info.records++;
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;
}
@@ -315,6 +324,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
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;
}
@@ -465,7 +477,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
free_underlaid_joins(thd, &thd->lex->select_lex);
table->insert_values=0;
thd->abort_on_warning= 0;
DBUG_RETURN(0);
DBUG_RETURN(FALSE);
abort:
#ifndef EMBEDDED_LIBRARY
@@ -475,7 +487,7 @@ abort:
free_underlaid_joins(thd, &thd->lex->select_lex);
table->insert_values=0;
thd->abort_on_warning= 0;
DBUG_RETURN(-1);
DBUG_RETURN(TRUE);
}
@@ -609,11 +621,11 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
table_list Global/local table list
RETURN VALUE
0 OK
-1 error (message is not sent to user)
FALSE OK
TRUE error
*/
int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
bool mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
List<Item> &fields, List_item *values,
List<Item> &update_fields, List<Item> &update_values,
enum_duplicates duplic)
@@ -621,7 +633,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
bool insert_into_view= (table_list->view != 0);
/* TODO: use this condition for 'WITH CHECK OPTION' */
Item *unused_conds= 0;
int res;
bool res;
DBUG_ENTER("mysql_prepare_insert");
if (mysql_prepare_insert_check_table(thd, table_list, fields, &unused_conds))
@@ -636,15 +648,15 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
thd->lex->select_lex.no_wrap_view_item= 0,
res) ||
setup_fields(thd, 0, table_list, update_values, 0, 0, 0))))
DBUG_RETURN(-1);
DBUG_RETURN(TRUE);
if (unique_table(table_list, table_list->next_independent()))
{
my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name);
DBUG_RETURN(-1);
DBUG_RETURN(TRUE);
}
thd->lex->select_lex.first_execution= 0;
DBUG_RETURN(0);
DBUG_RETURN(FALSE);
}
@@ -737,7 +749,12 @@ 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));
goto err;
}
/* CHECK OPTION for VIEW ... ON DUPLICATE KEY UPDATE ... */
if (info->view &&
@@ -1018,7 +1035,7 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
delete tmp;
thd->fatal_error();
pthread_mutex_unlock(&LOCK_delayed_create);
net_printf(thd,ER_CANT_CREATE_THREAD,error);
my_error(ER_CANT_CREATE_THREAD, MYF(0), error);
DBUG_RETURN(0);
}
@@ -1648,11 +1665,11 @@ bool delayed_insert::handle_inserts(void)
thd thread handler
RETURN
0 OK
-1 Error
FALSE OK
TRUE Error
*/
int mysql_insert_select_prepare(THD *thd)
bool mysql_insert_select_prepare(THD *thd)
{
LEX *lex= thd->lex;
DBUG_ENTER("mysql_insert_select_prepare");
@@ -1664,8 +1681,8 @@ int mysql_insert_select_prepare(THD *thd)
if (mysql_prepare_insert_check_table(thd, lex->query_tables,
lex->field_list,
&lex->select_lex.where))
DBUG_RETURN(-1);
DBUG_RETURN(0);
DBUG_RETURN(TRUE);
DBUG_RETURN(FALSE);
}
@@ -1768,8 +1785,7 @@ void select_insert::send_error(uint errcode,const char *err)
{
DBUG_ENTER("select_insert::send_error");
/* TODO error should be sent at the query processing end */
::send_error(thd,errcode,err);
my_message(errcode, err, MYF(0));
if (!table)
{
@@ -1845,8 +1861,6 @@ bool select_insert::send_eof()
if (error)
{
table->file->print_error(error,MYF(0));
//TODO error should be sent at the query processing end
::send_error(thd);
DBUG_RETURN(1);
}
char buff[160];