diff options
author | unknown <bell@sanja.is.com.ua> | 2004-11-12 14:34:00 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-11-12 14:34:00 +0200 |
commit | 9e921615a1c3147961dc4a8314ebb0e455ea105b (patch) | |
tree | 7591e416fa1685ed1e41707824091a5ca7f9c2c1 /sql/sql_base.cc | |
parent | 17cf3c633eb1db29457cbd62c5fc022d07d5dd6d (diff) | |
download | mariadb-git-9e921615a1c3147961dc4a8314ebb0e455ea105b.tar.gz |
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
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 79 |
1 files changed, 62 insertions, 17 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 1f52c532737..a6a7e99ecec 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1224,7 +1224,8 @@ bool reopen_tables(THD *thd,bool get_locks,bool in_refresh) next=table->next; if (!tables || (!db_stat && reopen_table(table,1))) { - my_error(ER_CANT_REOPEN_TABLE,MYF(0),table->table_name); + my_printf_error(ER_CANT_REOPEN_TABLE, ER(ER_CANT_REOPEN_TABLE), + MYF(0),table->table_name); VOID(hash_delete(&open_cache,(byte*) table)); error=1; } @@ -1509,7 +1510,8 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, { /* Give right error message */ thd->clear_error(); - my_error(ER_NOT_KEYFILE, MYF(0), name, my_errno); + my_printf_error(ER_NOT_KEYFILE, ER(ER_NOT_KEYFILE), MYF(0), + name, my_errno); sql_print_error("Error: Couldn't repair table: %s.%s",db,name); if (entry->file) closefrm(entry); @@ -1574,7 +1576,8 @@ err: { TABLE_LIST * view= table_desc->belong_to_view; thd->clear_error(); - my_error(ER_VIEW_INVALID, MYF(0), view->view_db.str, view->view_name.str); + my_printf_error(ER_VIEW_INVALID, ER(ER_VIEW_INVALID), MYF(0), + view->view_db.str, view->view_name.str); } DBUG_RETURN(1); } @@ -2738,8 +2741,9 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table, (pos= find_type(&table->keynames, name->ptr(), name->length(), 1)) <= 0) { - my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), name->c_ptr(), - table->real_name); + my_printf_error(ER_KEY_COLUMN_DOES_NOT_EXITS, + ER(ER_KEY_COLUMN_DOES_NOT_EXITS), MYF(0), + name->c_ptr(), table->real_name); map->set_all(); return 1; } @@ -2954,9 +2958,10 @@ insert_fields(THD *thd, TABLE_LIST *tables, const char *db_name, DBUG_RETURN(0); if (!table_name) - my_error(ER_NO_TABLES_USED, MYF(0)); + my_message(ER_NO_TABLES_USED, ER(ER_NO_TABLES_USED), MYF(0)); else - my_error(ER_BAD_TABLE_ERROR, MYF(0), table_name); + my_printf_error(ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR), MYF(0), + table_name); err: DBUG_RETURN(1); @@ -3176,8 +3181,25 @@ err_no_arena: ** Returns : 1 if some field has wrong type ******************************************************************************/ -int -fill_record(List<Item> &fields,List<Item> &values, bool ignore_errors) + +/* + Fill fields with given items. + + SYNOPSIS + fill_record() + thd thread handler + fields Item_fields list to be filled + values values to fill with + ignore_errors TRUE if we should ignore errors + + RETURN + FALSE OK + TRUE error occured +*/ + +bool +fill_record(THD * thd, List<Item> &fields, List<Item> &values, + bool ignore_errors) { List_iterator_fast<Item> f(fields),v(values); Item *value; @@ -3192,14 +3214,32 @@ fill_record(List<Item> &fields,List<Item> &values, bool ignore_errors) if (rfield == table->next_number_field) table->auto_increment_field_not_null= TRUE; if ((value->save_in_field(rfield, 0) < 0) && !ignore_errors) - DBUG_RETURN(1); + { + my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0)); + DBUG_RETURN(TRUE); + } } - DBUG_RETURN(0); + DBUG_RETURN(thd->net.report_error); } -int -fill_record(Field **ptr,List<Item> &values, bool ignore_errors) +/* + Fill field buffer with values from Field list + + SYNOPSIS + fill_record() + thd thread handler + ptr pointer on pointer to record + values list of fields + ignore_errors TRUE if we should ignore errors + + RETURN + FALSE OK + TRUE error occured +*/ + +bool +fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors) { List_iterator_fast<Item> v(values); Item *value; @@ -3213,9 +3253,12 @@ fill_record(Field **ptr,List<Item> &values, bool ignore_errors) if (field == table->next_number_field) table->auto_increment_field_not_null= TRUE; if ((value->save_in_field(field, 0) < 0) && !ignore_errors) - DBUG_RETURN(1); + { + my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0)); + DBUG_RETURN(TRUE); + } } - DBUG_RETURN(0); + DBUG_RETURN(thd->net.report_error); } @@ -3439,7 +3482,8 @@ open_new_frm(const char *path, const char *alias, { if (table_desc == 0 || table_desc->required_type == FRMTYPE_TABLE) { - my_error(ER_WRONG_OBJECT, MYF(0), db, table_name, "BASE TABLE"); + my_printf_error(ER_WRONG_OBJECT, ER(ER_WRONG_OBJECT), MYF(0), + db, table_name, "BASE TABLE"); goto err; } if (mysql_make_view(parser, table_desc)) @@ -3448,7 +3492,8 @@ open_new_frm(const char *path, const char *alias, else { /* only VIEWs are supported now */ - my_error(ER_FRM_UNKNOWN_TYPE, MYF(0), path, parser->type()->str); + my_printf_error(ER_FRM_UNKNOWN_TYPE, ER(ER_FRM_UNKNOWN_TYPE), MYF(0), + path, parser->type()->str); goto err; } DBUG_RETURN(0); |