diff options
Diffstat (limited to 'sql/sql_error.h')
| -rw-r--r-- | sql/sql_error.h | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/sql/sql_error.h b/sql/sql_error.h index e03c3dd4a93..aa8e6c6b0f3 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -658,6 +658,8 @@ public: DA_OK, /** Set whenever one calls my_eof(). */ DA_EOF, + /** Set whenever one calls my_ok() in PS bulk mode. */ + DA_OK_BULK, /** Set whenever one calls my_error() or my_message(). */ DA_ERROR, /** Set in case of a custom response, such as one from COM_STMT_PREPARE. */ @@ -699,10 +701,24 @@ public: bool is_disabled() const { return m_status == DA_DISABLED; } + void set_bulk_execution(bool bulk) { is_bulk_execution= bulk; } + + bool is_bulk_op() const { return is_bulk_execution; } + enum_diagnostics_status status() const { return m_status; } const char *message() const - { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK); return m_message; } + { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK || + m_status == DA_OK_BULK); return m_message; } + + bool skip_flush() const + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_skip_flush; + } + + void set_skip_flush() + { m_skip_flush= TRUE; } uint sql_errno() const { DBUG_ASSERT(m_status == DA_ERROR); return m_sql_errno; } @@ -711,14 +727,21 @@ public: { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; } ulonglong affected_rows() const - { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; } + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_affected_rows; + } ulonglong last_insert_id() const - { DBUG_ASSERT(m_status == DA_OK); return m_last_insert_id; } + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_last_insert_id; + } uint statement_warn_count() const { - DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF); + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK || + m_status == DA_EOF); return m_statement_warn_count; } @@ -857,6 +880,9 @@ private: /** Set to make set_error_status after set_{ok,eof}_status possible. */ bool m_can_overwrite_status; + /** Skip flushing network buffer after writing OK (for COM_MULTI) */ + bool m_skip_flush; + /** Message buffer. Can be used by OK or ERROR status. */ char m_message[MYSQL_ERRMSG_SIZE]; @@ -898,6 +924,8 @@ private: enum_diagnostics_status m_status; + my_bool is_bulk_execution; + Warning_info m_main_wi; Warning_info_list m_wi_stack; |
