My Project
|
#include <sql_error.h>
Public Types | |
enum | enum_diagnostics_status { DA_EMPTY = 0, DA_OK, DA_EOF, DA_ERROR, DA_DISABLED } |
typedef Warning_info::Sql_condition_list::Const_Iterator | Sql_condition_iterator |
Public Member Functions | |
void | set_overwrite_status (bool can_overwrite_status) |
bool | is_sent () const |
void | set_is_sent (bool is_sent) |
void | set_ok_status (ulonglong affected_rows, ulonglong last_insert_id, const char *message) |
void | set_eof_status (THD *thd) |
void | set_error_status (uint sql_errno) |
void | set_error_status (uint sql_errno, const char *message, const char *sqlstate, const Sql_condition *error_condition) |
void | disable_status () |
void | reset_diagnostics_area () |
bool | is_set () const |
bool | is_error () const |
bool | is_eof () const |
bool | is_ok () const |
bool | is_disabled () const |
enum_diagnostics_status | status () const |
const char * | message () const |
uint | sql_errno () const |
const char * | get_sqlstate () const |
ulonglong | affected_rows () const |
ulonglong | last_insert_id () const |
uint | statement_warn_count () const |
Diagnostics_area (ulonglong warning_info_id, bool allow_unlimited_warnings) | |
void | push_warning_info (Warning_info *wi) |
void | pop_warning_info () |
void | set_warning_info_id (ulonglong id) |
ulonglong | warning_info_id () const |
bool | warning_info_changed (const Warning_info *wi) const |
bool | is_warning_info_empty () const |
ulong | current_statement_warn_count () const |
bool | has_sql_condition (const char *message_str, ulong message_length) const |
void | reset_for_next_command () |
void | clear_warning_info (ulonglong id) |
void | opt_clear_warning_info (ulonglong query_id) |
ulong | current_row_for_warning () const |
void | inc_current_row_for_warning () |
void | reset_current_row_for_warning () |
bool | is_warning_info_read_only () const |
void | set_warning_info_read_only (bool read_only) |
ulong | error_count () const |
ulong | warn_count () const |
uint | cond_count () const |
Sql_condition_iterator | sql_conditions () const |
void | reserve_space (THD *thd, uint count) |
Sql_condition * | push_warning (THD *thd, const Sql_condition *sql_condition) |
Sql_condition * | push_warning (THD *thd, uint sql_errno, const char *sqlstate, Sql_condition::enum_warning_level level, const char *msg) |
void | mark_sql_conditions_for_removal () |
void | unmark_sql_conditions_from_removal () |
void | remove_marked_sql_conditions () |
const Sql_condition * | get_error_condition () const |
void | copy_sql_conditions_to_wi (THD *thd, Warning_info *dst_wi) const |
void | copy_sql_conditions_from_wi (THD *thd, const Warning_info *src_wi) |
void | copy_non_errors_from_wi (THD *thd, const Warning_info *src_wi) |
Stores status of the currently executed statement. Cleared at the beginning of the statement, and then can hold either OK, ERROR, or EOF status. Can not be assigned twice per statement.
Const iterator used to iterate through the warning list.
void Diagnostics_area::copy_non_errors_from_wi | ( | THD * | thd, |
const Warning_info * | src_wi | ||
) |
Copy Sql_conditions that are not WARN_LEVEL_ERROR from the source Warning_info to the current Warning_info.
thd | Thread context. |
sp_wi | Stored-program Warning_info |
thd | Thread context. |
src_wi | Warning_info to copy from. |
void Diagnostics_area::disable_status | ( | ) |
Mark the diagnostics area as 'DISABLED'.
This is used in rare cases when the COM_ command at hand sends a response in a custom format. One example is the query cache, another is COM_STMT_PREPARE.
Clear this diagnostics area.
Normally called at the end of a statement.
Tiny reset in debug mode to see garbage right away
void Diagnostics_area::set_eof_status | ( | THD * | thd | ) |
Set EOF status.
void Diagnostics_area::set_error_status | ( | uint | sql_errno | ) |
Set ERROR status in the Diagnostics Area. This function should be used to report fatal errors (such as out-of-memory errors) when no further processing is possible.
sql_errno | SQL-condition error number |
void Diagnostics_area::set_error_status | ( | uint | sql_errno, |
const char * | message, | ||
const char * | sqlstate, | ||
const Sql_condition * | error_condition | ||
) |
Set ERROR status in the Diagnostics Area.
sql_errno | SQL-condition error number |
message | SQL-condition message |
sqlstate | SQL-condition state |
error_condition | SQL-condition object representing the error state |
void Diagnostics_area::set_ok_status | ( | ulonglong | affected_rows, |
ulonglong | last_insert_id, | ||
const char * | message | ||
) |
Set OK status -- ends commands that do not return a result set, e.g. INSERT/UPDATE/DELETE.
bool Diagnostics_area::warning_info_changed | ( | const Warning_info * | wi | ) | const [inline] |
Compare given current warning info and current warning info and see if they are different. They will be different if warnings have been generated or statements that use tables have been executed. This is checked by comparing m_warn_id.
wi | Warning info to compare with current Warning info. |