From e2d6912609c976bad04cee76874d4f986cd58cef Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 29 Jun 2016 20:03:06 +0200 Subject: MDEV-9114: Bulk operations (Array binding) (+ default values) --- sql/sql_error.h | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'sql/sql_error.h') diff --git a/sql/sql_error.h b/sql/sql_error.h index 8fb1abacf2b..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,13 +701,21 @@ 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); return m_skip_flush; } + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_skip_flush; + } void set_skip_flush() { m_skip_flush= TRUE; } @@ -717,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; } @@ -907,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; -- cgit v1.2.1