The world's most popular open source database
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| class | MYSQL_ERROR |
Functions | |
| MYSQL_ERROR * | push_warning (THD *thd, MYSQL_ERROR::enum_warning_level level, uint code, const char *msg) |
| void | push_warning_printf (THD *thd, MYSQL_ERROR::enum_warning_level level, uint code, const char *format,...) |
| void | mysql_reset_errors (THD *thd, bool force) |
| bool | mysqld_show_warnings (THD *thd, ulong levels_to_show) |
Variables | |
| const LEX_STRING | warning_level_names [] |
| void mysql_reset_errors | ( | THD * | thd, | |
| bool | force | |||
| ) |
Definition at line 75 of file sql_error.cc.
References bzero, DBUG_ENTER, DBUG_VOID_RETURN, free_root(), and MYF.
Referenced by get_table_share_with_create(), mysql_execute_command(), mysql_stmt_prepare(), mysqld_show_create(), open_unireg_entry(), push_warning(), and sp_exist_routines().
00076 { 00077 DBUG_ENTER("mysql_reset_errors"); 00078 if (thd->query_id != thd->warn_id || force) 00079 { 00080 thd->warn_id= thd->query_id; 00081 free_root(&thd->warn_root,MYF(0)); 00082 bzero((char*) thd->warn_count, sizeof(thd->warn_count)); 00083 if (force) 00084 thd->total_warn_count= 0; 00085 thd->warn_list.empty(); 00086 thd->row_count= 1; // by default point to row 1 00087 } 00088 DBUG_VOID_RETURN; 00089 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 223 of file sql_error.cc.
References MYSQL_ERROR::code, DBUG_ENTER, DBUG_RETURN, err, FALSE, MYSQL_ERROR::level, MYSQL_ERROR::msg, MYSQL_ERRMSG_SIZE, MYSQL_TYPE_LONG, Protocol::prepare_for_resend(), List< T >::push_back(), sel, send_eof(), Protocol::SEND_EOF, Protocol::SEND_NUM_ROWS, Protocol::store(), strlen(), system_charset_info, TRUE, warning_level_names, and Protocol::write().
Referenced by mysql_execute_command().
00224 { 00225 List<Item> field_list; 00226 DBUG_ENTER("mysqld_show_warnings"); 00227 00228 field_list.push_back(new Item_empty_string("Level", 7)); 00229 field_list.push_back(new Item_return_int("Code",4, MYSQL_TYPE_LONG)); 00230 field_list.push_back(new Item_empty_string("Message",MYSQL_ERRMSG_SIZE)); 00231 00232 if (thd->protocol->send_fields(&field_list, 00233 Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) 00234 DBUG_RETURN(TRUE); 00235 00236 MYSQL_ERROR *err; 00237 SELECT_LEX *sel= &thd->lex->select_lex; 00238 SELECT_LEX_UNIT *unit= &thd->lex->unit; 00239 ha_rows idx= 0; 00240 Protocol *protocol=thd->protocol; 00241 00242 unit->set_limit(sel); 00243 00244 List_iterator_fast<MYSQL_ERROR> it(thd->warn_list); 00245 while ((err= it++)) 00246 { 00247 /* Skip levels that the user is not interested in */ 00248 if (!(levels_to_show & ((ulong) 1 << err->level))) 00249 continue; 00250 if (++idx <= unit->offset_limit_cnt) 00251 continue; 00252 if (idx > unit->select_limit_cnt) 00253 break; 00254 protocol->prepare_for_resend(); 00255 protocol->store(warning_level_names[err->level].str, 00256 warning_level_names[err->level].length, system_charset_info); 00257 protocol->store((uint32) err->code); 00258 protocol->store(err->msg, strlen(err->msg), system_charset_info); 00259 if (protocol->write()) 00260 DBUG_RETURN(TRUE); 00261 } 00262 send_eof(thd); 00263 DBUG_RETURN(FALSE); 00264 }
Here is the call graph for this function:

Here is the caller graph for this function:

| MYSQL_ERROR* push_warning | ( | THD * | thd, | |
| MYSQL_ERROR::enum_warning_level | level, | |||
| uint | code, | |||
| const char * | msg | |||
| ) |
Definition at line 106 of file sql_error.cc.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, err, my_message(), MYF, mysql_reset_errors(), NULL, OPTION_SQL_NOTES, query_cache_abort(), MYSQL_ERROR::WARN_LEVEL_ERROR, MYSQL_ERROR::WARN_LEVEL_NOTE, and MYSQL_ERROR::WARN_LEVEL_WARN.
Referenced by sp_head::execute_function(), execute_sqlcom_select(), get_all_tables(), get_referential_constraints_record(), get_schema_column_record(), get_schema_constraints_record(), get_schema_key_column_usage_record(), get_schema_partitions_record(), get_schema_stat_record(), get_schema_triggers_record(), get_schema_views_record(), ha_delete_table(), ha_rollback_trans(), ha_start_consistent_snapshot(), make_truncated_value_warning(), mark_as_dependent(), my_message_sql(), mysql_create_like_table(), mysql_execute_command(), mysql_register_view(), mysql_uninstall_plugin(), net_printf_error(), net_send_error(), plugin_finalize(), prepare_blob_field(), push_warning_printf(), Item_singlerow_subselect::select_transformer(), set_log_update(), sp_head::show_routine_code(), Item_func::signal_divide_by_null(), Item_in_subselect::single_value_transformer(), Item_func_signed::val_int(), Item_func_unsigned::val_int(), and Item_func_group_concat::val_str().
00108 { 00109 MYSQL_ERROR *err= 0; 00110 DBUG_ENTER("push_warning"); 00111 DBUG_PRINT("enter", ("code: %d, msg: %s", code, msg)); 00112 00113 if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && 00114 !(thd->options & OPTION_SQL_NOTES)) 00115 DBUG_RETURN(0); 00116 00117 if (thd->query_id != thd->warn_id && !thd->spcont) 00118 mysql_reset_errors(thd, 0); 00119 thd->got_warning= 1; 00120 00121 /* Abort if we are using strict mode and we are not using IGNORE */ 00122 if ((int) level >= (int) MYSQL_ERROR::WARN_LEVEL_WARN && 00123 thd->really_abort_on_warning()) 00124 { 00125 /* Avoid my_message() calling push_warning */ 00126 bool no_warnings_for_error= thd->no_warnings_for_error; 00127 sp_rcontext *spcont= thd->spcont; 00128 00129 thd->no_warnings_for_error= 1; 00130 thd->spcont= 0; 00131 00132 thd->killed= THD::KILL_BAD_DATA; 00133 my_message(code, msg, MYF(0)); 00134 00135 thd->spcont= spcont; 00136 thd->no_warnings_for_error= no_warnings_for_error; 00137 /* Store error in error list (as my_message() didn't do it) */ 00138 level= MYSQL_ERROR::WARN_LEVEL_ERROR; 00139 } 00140 00141 if (thd->spcont && 00142 thd->spcont->find_handler(code, 00143 ((int) level >= 00144 (int) MYSQL_ERROR::WARN_LEVEL_WARN && 00145 thd->really_abort_on_warning()) ? 00146 MYSQL_ERROR::WARN_LEVEL_ERROR : level)) 00147 { 00148 if (! thd->spcont->found_handler_here()) 00149 thd->net.report_error= 1; /* Make "select" abort correctly */ 00150 DBUG_RETURN(NULL); 00151 } 00152 query_cache_abort(&thd->net); 00153 00154 00155 if (thd->warn_list.elements < thd->variables.max_error_count) 00156 { 00157 /* 00158 The following code is here to change the allocation to not 00159 use the thd->mem_root, which is freed after each query 00160 */ 00161 MEM_ROOT *old_root= thd->mem_root; 00162 thd->mem_root= &thd->warn_root; 00163 if ((err= new MYSQL_ERROR(thd, code, level, msg))) 00164 thd->warn_list.push_back(err); 00165 thd->mem_root= old_root; 00166 } 00167 thd->warn_count[(uint) level]++; 00168 thd->total_warn_count++; 00169 DBUG_RETURN(err); 00170 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void push_warning_printf | ( | THD * | thd, | |
| MYSQL_ERROR::enum_warning_level | level, | |||
| uint | code, | |||
| const char * | format, | |||
| ... | ||||
| ) |
Definition at line 183 of file sql_error.cc.
References args, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, ERRMSGSIZE, my_vsnprintf(), push_warning(), and yaSSL::warning.
Referenced by check_duplicates_in_interval(), check_engine(), Field::check_int(), Table_triggers_list::check_n_load(), check_that_all_fields_are_given_values(), Item_str_func::check_well_formed_result(), Table_triggers_list::create_trigger(), date_add_interval(), db_create_event(), db_drop_event(), decimal_operation_results(), extract_date_time(), find_order_in_list(), fix_query_cache_size(), Field_time::get_date(), ha_prepare(), create_field::init(), mysql_alter_table(), mysql_alter_tablespace(), mysql_create_db(), mysql_create_frm(), mysql_create_table_internal(), mysql_create_view(), mysql_drop_view(), mysql_execute_command(), mysql_make_view(), mysql_rm_db(), mysql_rm_table_part2(), mysqld_show_create(), pack_header(), Item_xml_str_func::parse_xml(), st_table_list::prepare_view_securety_context(), Handle_old_incorrect_sql_modes_hook::process_unknown_string(), Handle_old_incorrect_trigger_table_hook::process_unknown_string(), read_fixed_length(), read_sep_field(), resolve_ref_in_select_and_group(), Item_default_value::save_in_field(), Item::set_name(), Field::set_warning(), Field_new_decimal::store(), sys_var_key_buffer_size::update(), Item_decimal_typecast::val_decimal(), Item::val_decimal_from_string(), Field_double::val_int(), Item_string::val_int(), Item_func_signed::val_int_from_str(), Item_string::val_real(), Item_func_concat::val_str(), Item_func_des_encrypt::val_str(), Item_func_des_decrypt::val_str(), Item_func_concat_ws::val_str(), Item_func_replace::val_str(), Item_func_insert::val_str(), Item_func_repeat::val_str(), Item_func_rpad::val_str(), Item_func_lpad::val_str(), Item_load_file::val_str(), Item_char_typecast::val_str(), and st_table_list::view_check_option().
00185 { 00186 va_list args; 00187 char warning[ERRMSGSIZE+20]; 00188 DBUG_ENTER("push_warning_printf"); 00189 DBUG_PRINT("enter",("warning: %u", code)); 00190 00191 va_start(args,format); 00192 my_vsnprintf(warning, sizeof(warning), format, args); 00193 va_end(args); 00194 push_warning(thd, level, code, warning); 00195 DBUG_VOID_RETURN; 00196 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const LEX_STRING warning_level_names[] |
1.4.7

