|
drizzle
C++ MySQL-protocol-compatible database server
|
#include <diagnostics_area.h>
Public Types | |
| enum | enum_diagnostics_status { DA_EMPTY = 0 , DA_OK , DA_EOF , DA_ERROR , DA_DISABLED } |
Public Member Functions | |
| void | set_ok_status (Session *session, ha_rows affected_rows_arg, ha_rows found_rows_arg, uint64_t last_insert_id_arg, const char *message) |
| void | set_eof_status (Session *session) |
| void | set_error_status (drizzled::error_t sql_errno_arg, const char *message_arg) |
| 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 |
| drizzled::error_t | sql_errno () const |
| uint32_t | server_status () const |
| ha_rows | affected_rows () const |
| ha_rows | found_rows () const |
| uint64_t | last_insert_id () const |
| uint32_t | total_warn_count () const |
Public Attributes | |
| bool | is_sent |
| bool | can_overwrite_status |
| std::list< DRIZZLE_ERROR * > | m_warn_list |
Private Attributes | |
| char | m_message [DRIZZLE_ERRMSG_SIZE] |
| drizzled::error_t | m_sql_errno |
| uint32_t | m_server_status |
| ha_rows | m_affected_rows |
| ha_rows | m_found_rows |
| uint64_t | m_last_insert_id |
| uint32_t | m_total_warn_count |
| enum_diagnostics_status | m_status |
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.
Definition at line 35 of file diagnostics_area.h.
Definition at line 38 of file diagnostics_area.h.
|
inline |
Definition at line 83 of file diagnostics_area.h.
| ha_rows drizzled::Diagnostics_area::affected_rows | ( | ) | const |
Definition at line 66 of file diagnostics_area.cc.
| void drizzled::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.
Definition at line 170 of file diagnostics_area.cc.
| ha_rows drizzled::Diagnostics_area::found_rows | ( | ) | const |
Definition at line 69 of file diagnostics_area.cc.
|
inline |
Definition at line 70 of file diagnostics_area.h.
|
inline |
Definition at line 68 of file diagnostics_area.h.
|
inline |
Definition at line 67 of file diagnostics_area.h.
|
inline |
Definition at line 69 of file diagnostics_area.h.
|
inline |
Definition at line 66 of file diagnostics_area.h.
| uint64_t drizzled::Diagnostics_area::last_insert_id | ( | ) | const |
Definition at line 72 of file diagnostics_area.cc.
| const char * drizzled::Diagnostics_area::message | ( | ) | const |
Definition at line 47 of file diagnostics_area.cc.
| void drizzled::Diagnostics_area::reset_diagnostics_area | ( | ) |
Clear this diagnostics area.
Normally called at the end of a statement.
Don't take chances in production
Tiny reset in debug mode to see garbage right away
Definition at line 31 of file diagnostics_area.cc.
| uint32_t drizzled::Diagnostics_area::server_status | ( | ) | const |
Definition at line 60 of file diagnostics_area.cc.
| void drizzled::Diagnostics_area::set_eof_status | ( | Session * | session | ) |
Set EOF status.
Only allowed to report eof if has not yet reported an error
Definition at line 115 of file diagnostics_area.cc.
| void drizzled::Diagnostics_area::set_error_status | ( | drizzled::error_t | sql_errno_arg, |
| const char * | message_arg ) |
Set ERROR status.
Definition at line 141 of file diagnostics_area.cc.
| void drizzled::Diagnostics_area::set_ok_status | ( | Session * | session, |
| ha_rows | affected_rows_arg, | ||
| ha_rows | found_rows_arg, | ||
| uint64_t | last_insert_id_arg, | ||
| const char * | message_arg ) |
Set OK status – ends commands that do not return a result set, e.g. INSERT/UPDATE/DELETE.
Only allowed to report success if has not yet reported an error
Definition at line 85 of file diagnostics_area.cc.
| error_t drizzled::Diagnostics_area::sql_errno | ( | ) | const |
Definition at line 54 of file diagnostics_area.cc.
|
inline |
Definition at line 71 of file diagnostics_area.h.
| uint32_t drizzled::Diagnostics_area::total_warn_count | ( | ) | const |
Definition at line 75 of file diagnostics_area.cc.
| bool drizzled::Diagnostics_area::can_overwrite_status |
Set to make set_error_status after set_{ok,eof}_status possible.
Definition at line 54 of file diagnostics_area.h.
| bool drizzled::Diagnostics_area::is_sent |
True if status information is sent to the client.
Definition at line 52 of file diagnostics_area.h.
|
private |
The number of rows affected by the last statement. This is semantically close to session->row_count_func, but has a different life cycle. session->row_count_func stores the value returned by function ROW_COUNT() and is cleared only by statements that update its value, such as INSERT, UPDATE, DELETE and few others. This member is cleared at the beginning of the next statement.
We could possibly merge the two, but life cycle of session->row_count_func can not be changed.
Definition at line 115 of file diagnostics_area.h.
|
private |
This is like m_affected_rows, but contains the number of rows found, not only affected.
Definition at line 120 of file diagnostics_area.h.
|
private |
Similarly to the previous member, this is a replacement of session->first_successful_insert_id_in_prev_stmt, which is used to implement LAST_INSERT_ID().
Definition at line 126 of file diagnostics_area.h.
|
private |
Message buffer. Can be used by OK or ERROR status.
Definition at line 87 of file diagnostics_area.h.
|
private |
Copied from session->server_status when the diagnostics area is assigned. We need this member as some places in the code use the following pattern: session->server_status|= ... my_eof(session); session->server_status&= ~... Assigned by OK, EOF or ERROR.
Definition at line 102 of file diagnostics_area.h.
|
private |
SQL error number. One of ER_ codes from share/errmsg.txt. Set by set_error_status.
Definition at line 92 of file diagnostics_area.h.
|
private |
Definition at line 129 of file diagnostics_area.h.
|
private |
The total number of warnings.
Definition at line 128 of file diagnostics_area.h.
| std::list<DRIZZLE_ERROR*> drizzled::Diagnostics_area::m_warn_list |
Definition at line 81 of file diagnostics_area.h.