#include "mysys_priv.h"#include "mysys_err.h"#include <m_string.h>#include <stdarg.h>#include <m_ctype.h>Include dependency graph for my_error.c:

Go to the source code of this file.
Classes | |
| struct | my_err_head |
Functions | |
| int | my_error (int nr, myf MyFlags,...) |
| int | my_printf_error (uint error, const char *format, myf MyFlags,...) |
| int | my_message (uint error, const char *str, register myf MyFlags) |
| int | my_error_register (const char **errmsgs, int first, int last) |
| const char ** | my_error_unregister (int first, int last) |
Variables | |
| char NEAR | errbuff [NRERRBUFFS][ERRMSGSIZE] |
| static struct my_err_head | my_errmsgs_globerrs |
| static struct my_err_head * | my_errmsgs_list = &my_errmsgs_globerrs |
| int my_error | ( | int | nr, | |
| myf | MyFlags, | |||
| ... | ||||
| ) |
Definition at line 74 of file my_error.c.
References args, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ERRMSGSIZE, errno, error_handler_hook, format(), globerrs, init_glob_errs(), my_err_head::meh_errmsgs, my_err_head::meh_first, my_err_head::meh_last, my_err_head::meh_next, my_errmsgs_globerrs, my_errmsgs_list, my_snprintf(), my_vsnprintf(), and NULL.
Referenced by add_field_to_list(), add_table_for_trigger(), append_file_to_dir(), begin_trans(), change_security_context(), Table_triggers_list::change_table_name(), sys_var_thd_storage_engine::check(), set_var::check(), sys_var_max_user_conn::check(), sys_var_thd_time_zone::check(), sys_var_character_set::check(), sys_var_collation::check(), sys_var_thd_date_time_format::check(), sys_var_str::check(), check_access(), check_change_password(), Item_singlerow_subselect::check_cols(), Item_row::check_cols(), Item_cache_row::check_cols(), Item::check_cols(), check_completion_type(), check_duplicate_names(), check_engine(), sys_var::check_enum(), check_fields(), check_global_access(), check_grant(), check_grant_all_columns(), check_grant_column(), ha_myisam::check_if_locking_is_allowed(), handler::check_if_log_table_locking_is_allowed(), check_insert_fields(), check_lock_and_start_stmt(), check_log_update(), check_max_delayed_threads(), Table_triggers_list::check_n_load(), check_pseudo_thread_id(), sys_var::check_set(), check_simple_select(), check_table_access(), check_tx_isolation(), cmp_item_row::cmp(), copy_event_to_schema_table(), Events::create_event(), create_file(), create_frm(), create_func_cast(), Table_triggers_list::create_trigger(), db_create_event(), db_drop_event(), db_drop_events_from_table(), db_find_event(), db_update_event(), Prepared_statement::deallocate(), decimal_operation_results(), delayed_get_table(), dispatch_command(), Events::drop_event(), end_active_trans(), end_trans(), evex_fill_row(), sp_instr_set_case_expr::exec_core(), sp_instr_set::exec_core(), Prepared_statement::execute(), execute_ddl_log_action(), sp_head::execute_function(), sp_head::execute_procedure(), filesort(), fill_record(), Item_func_sp::find_and_check_access(), find_field_in_group_list(), find_field_in_tables(), find_files(), find_item_in_list(), find_order_in_list(), find_prepared_statement(), find_sys_var(), Item_subselect::fix_fields(), Item_func_match::fix_fields(), Item_func_rand::fix_fields(), Item_func_like::fix_fields(), Item_in_optimizer::fix_fields(), Item_trigger_field::fix_fields(), Item_insert_value::fix_fields(), Item_default_value::fix_fields(), Item_ref::fix_fields(), Item_field::fix_fields(), Item_func_set_collation::fix_length_and_dec(), Item_field::fix_outer_field(), get_charset(), get_charset_by_csname(), get_charset_by_name(), get_current_user(), get_file_options_ulllist(), get_key_map_from_key_list(), get_system_var(), get_table_share_with_create(), ha_checktype(), ha_commit_one_phase(), ha_commit_trans(), ha_create_table(), ha_prepare(), ha_release_savepoint(), ha_rollback_to_savepoint(), ha_rollback_trans(), ha_savepoint(), handle_delayed_insert(), st_table_list::hide_view_error(), Item_row::illegal_method_call(), Item_cache_row::illegal_method_call(), create_field::init(), insert_fields(), insert_view_fields(), sp_head::is_not_allowed_in_function(), sys_var_thd_binlog_format::is_readonly(), sys_var::item(), Item_float::Item_float(), Item_type_holder::join_types(), set_var::light_check(), make_empty_rec(), map_file(), mapped_files::mapped_files(), mark_common_columns(), mem_alloc_error(), mi_report_error(), multi_delete_set_locks_and_link_aux_tables(), my_chsize(), my_close(), my_coll_agg_error(), my_copystat(), my_create_with_symlink(), my_delete(), my_dir(), my_fclose(), my_fdopen(), my_fopen(), my_fread(), my_fwrite(), my_getwd(), my_lock(), my_lread(), my_lwrite(), my_malloc(), my_mkdir(), my_once_alloc(), my_pread(), my_pwrite(), my_read(), my_readlink(), my_realloc(), my_realpath(), my_register_filename(), my_rename(), my_setwd(), my_stat(), my_symlink(), my_sync(), my_write(), mysql_alter_table(), mysql_alter_tablespace(), mysql_assign_to_keycache(), mysql_change_db(), mysql_client_binlog_statement(), mysql_create_db(), mysql_create_like_table(), mysql_create_or_drop_trigger(), mysql_create_table_internal(), mysql_create_user(), mysql_create_view(), mysql_delete(), mysql_derived_prepare(), mysql_drop_user(), mysql_drop_view(), mysql_execute_command(), mysql_grant(), mysql_ha_close(), mysql_ha_open(), mysql_ha_read(), mysql_insert(), mysql_install_plugin(), mysql_load(), mysql_lock_tables(), mysql_make_view(), mysql_multi_delete_prepare(), mysql_new_select(), mysql_prepare_delete(), mysql_prepare_insert_check_table(), mysql_prepare_table(), mysql_prepare_update(), mysql_register_view(), mysql_rename_db(), mysql_rename_table(), mysql_rename_user(), mysql_rm_db(), mysql_rm_known_files(), mysql_rm_table(), mysql_rm_table_part2(), mysql_routine_grant(), mysql_show_grants(), mysql_sql_stmt_close(), mysql_sql_stmt_execute(), mysql_stmt_execute(), mysql_stmt_fetch(), mysql_stmt_get_longdata(), mysql_table_dump(), mysql_table_grant(), mysql_test_delete(), mysql_test_insert(), mysql_test_multidelete(), mysql_test_select(), mysql_truncate(), mysql_uninstall_plugin(), mysqld_show_create(), mysqld_show_create_db(), open_binary_frm(), open_grant_tables(), open_new_frm(), open_table(), open_table_error(), open_unireg_entry(), pack_header(), File_parser::parse(), plugin_add(), plugin_dl_add(), prepare_blob_field(), prepare_schema_table(), st_table_list::prepare_view_securety_context(), handler::print_error(), print_lock_error(), proc_analyse_init(), Table_triggers_list::process_triggers(), Handle_old_incorrect_trigger_table_hook::process_unknown_string(), Events::reconstruct_interval_expression(), sp_head::recursion_level_error(), reload_acl_and_cache(), rename_tables(), reopen_tables(), replace_column_table(), replace_db_table(), replace_routine_table(), replace_table_table(), replace_user_table(), resolve_ref_in_select_and_group(), rm_dir_w_symlink(), Item_in_subselect::row_value_transformer(), rr_quick(), Item_in_subselect::select_in_like_transformer(), Arg_comparator::set_compare_func(), set_field_to_null(), set_field_to_null_with_conversions(), setup_group(), setup_procedure(), setup_tables(), Item_in_subselect::single_value_transformer(), sp_add_to_query_tables(), sp_cache_routines_and_add_tables_aux(), sp_change_security_context(), sp_exist_routines(), sp_grant_privileges(), Item_func_sp::sp_result_field(), sql_kill(), sql_parse_prepare(), store_natural_using_join_columns(), cmp_item_row::store_value_by_template(), sys_check_ftb_syntax(), table_check_intact(), sys_var_event_scheduler::update(), sys_var_log_state::update(), Events::update_event(), update_non_unique_table_error(), st_table_list::view_check_option(), MYSQL_BIN_LOG::write(), and write_huff_tree().
00075 { 00076 const char *format; 00077 struct my_err_head *meh_p; 00078 va_list args; 00079 char ebuff[ERRMSGSIZE + 20]; 00080 DBUG_ENTER("my_error"); 00081 DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d", nr, MyFlags, errno)); 00082 00083 /* Search for the error messages array, which could contain the message. */ 00084 for (meh_p= my_errmsgs_list; meh_p; meh_p= meh_p->meh_next) 00085 if (nr <= meh_p->meh_last) 00086 break; 00087 00088 #ifdef SHARED_LIBRARY 00089 if ((meh_p == &my_errmsgs_globerrs) && ! globerrs[0]) 00090 init_glob_errs(); 00091 #endif 00092 00093 /* get the error message string. Default, if NULL or empty string (""). */ 00094 if (! (format= (meh_p && (nr >= meh_p->meh_first)) ? 00095 meh_p->meh_errmsgs[nr - meh_p->meh_first] : NULL) || ! *format) 00096 (void) my_snprintf (ebuff, sizeof(ebuff), "Unknown error %d", nr); 00097 else 00098 { 00099 va_start(args,MyFlags); 00100 (void) my_vsnprintf (ebuff, sizeof(ebuff), format, args); 00101 va_end(args); 00102 } 00103 DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags)); 00104 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int my_error_register | ( | const char ** | errmsgs, | |
| int | first, | |||
| int | last | |||
| ) |
Definition at line 170 of file my_error.c.
References my_err_head::meh_errmsgs, my_err_head::meh_first, my_err_head::meh_last, my_err_head::meh_next, my_errmsgs_list, my_free, my_malloc(), MY_WME, and MYF.
00171 { 00172 struct my_err_head *meh_p; 00173 struct my_err_head **search_meh_pp; 00174 00175 /* Allocate a new header structure. */ 00176 if (! (meh_p= (struct my_err_head*) my_malloc(sizeof(struct my_err_head), 00177 MYF(MY_WME)))) 00178 return 1; 00179 meh_p->meh_errmsgs= errmsgs; 00180 meh_p->meh_first= first; 00181 meh_p->meh_last= last; 00182 00183 /* Search for the right position in the list. */ 00184 for (search_meh_pp= &my_errmsgs_list; 00185 *search_meh_pp; 00186 search_meh_pp= &(*search_meh_pp)->meh_next) 00187 { 00188 if ((*search_meh_pp)->meh_last > first) 00189 break; 00190 } 00191 00192 /* Error numbers must be unique. No overlapping is allowed. */ 00193 if (*search_meh_pp && ((*search_meh_pp)->meh_first <= last)) 00194 { 00195 my_free((gptr)meh_p, MYF(0)); 00196 return 1; 00197 } 00198 00199 /* Insert header into the chain. */ 00200 meh_p->meh_next= *search_meh_pp; 00201 *search_meh_pp= meh_p; 00202 return 0; 00203 }
Here is the call graph for this function:

| const char** my_error_unregister | ( | int | first, | |
| int | last | |||
| ) |
Definition at line 227 of file my_error.c.
References my_err_head::meh_errmsgs, my_err_head::meh_next, my_errmsgs_list, my_free, MYF, and NULL.
00228 { 00229 struct my_err_head *meh_p; 00230 struct my_err_head **search_meh_pp; 00231 const char **errmsgs; 00232 00233 /* Search for the registration in the list. */ 00234 for (search_meh_pp= &my_errmsgs_list; 00235 *search_meh_pp; 00236 search_meh_pp= &(*search_meh_pp)->meh_next) 00237 { 00238 if (((*search_meh_pp)->meh_first == first) && 00239 ((*search_meh_pp)->meh_last == last)) 00240 break; 00241 } 00242 if (! *search_meh_pp) 00243 return NULL; 00244 00245 /* Remove header from the chain. */ 00246 meh_p= *search_meh_pp; 00247 *search_meh_pp= meh_p->meh_next; 00248 00249 /* Save the return value and free the header. */ 00250 errmsgs= meh_p->meh_errmsgs; 00251 my_free((gptr) meh_p, MYF(0)); 00252 00253 return errmsgs; 00254 }
Definition at line 142 of file my_error.c.
References error_handler_hook.
00143 { 00144 return (*error_handler_hook)(error, str, MyFlags); 00145 }
Definition at line 118 of file my_error.c.
References args, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ERRMSGSIZE, errno, error_handler_hook, and my_vsnprintf().
Referenced by sys_var_thd_lc_time_names::check(), db_error(), DB_error(), db_error_with_table(), DBerror(), do_show_master_status(), drop_db(), dump_all_databases(), dump_selected_tables(), execute_commands(), Item_xml_str_func::fix_length_and_dec(), get_pidfile(), get_table_share_with_create(), mysql_init_character_set(), mysql_query_with_error_report(), MYSQLerror(), open_table_error(), prepare_create_field(), handler::print_keydup_error(), process_all_databases(), and sql_connect().
00119 { 00120 va_list args; 00121 char ebuff[ERRMSGSIZE+20]; 00122 DBUG_ENTER("my_printf_error"); 00123 DBUG_PRINT("my", ("nr: %d MyFlags: %d errno: %d Format: %s", 00124 error, MyFlags, errno, format)); 00125 00126 va_start(args,MyFlags); 00127 (void) my_vsnprintf (ebuff, sizeof(ebuff), format, args); 00128 va_end(args); 00129 DBUG_RETURN((*error_handler_hook)(error, ebuff, MyFlags)); 00130 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE] |
Definition at line 34 of file my_error.c.
struct my_err_head my_errmsgs_globerrs [static] |
Referenced by my_error().
struct my_err_head* my_errmsgs_list = &my_errmsgs_globerrs [static] |
Definition at line 57 of file my_error.c.
Referenced by my_error(), my_error_register(), and my_error_unregister().
1.4.7

