diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:08:51 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:08:51 +0200 |
commit | 9809f05199aeb0b67991fac41bd86f38730768dc (patch) | |
tree | fa2792ff86d0da014b535d743759810612338042 /sql/sql_error.h | |
parent | 0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff) | |
parent | 5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff) | |
download | mariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz |
5.5-merge
Diffstat (limited to 'sql/sql_error.h')
-rw-r--r-- | sql/sql_error.h | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/sql/sql_error.h b/sql/sql_error.h index 8495a8cfa57..5b9b5ee639a 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -1,5 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, - Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -12,7 +11,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SQL_ERROR_H #define SQL_ERROR_H @@ -79,12 +78,6 @@ public: const char* get_sqlstate() const { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; } - uint server_status() const - { - DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF); - return m_server_status; - } - ulonglong affected_rows() const { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; } @@ -118,15 +111,6 @@ private: char m_sqlstate[SQLSTATE_LENGTH+1]; /** - Copied from thd->server_status when the diagnostics area is assigned. - We need this member as some places in the code use the following pattern: - thd->server_status|= ... - my_eof(thd); - thd->server_status&= ~... - Assigned by OK, EOF or ERROR. - */ - uint m_server_status; - /** The number of rows affected by the last statement. This is semantically close to thd->row_count_func, but has a different life cycle. thd->row_count_func stores the value returned by @@ -345,10 +329,13 @@ class Warning_info { /** A memory root to allocate warnings and errors */ MEM_ROOT m_warn_root; + /** List of warnings of all severities (levels). */ List <MYSQL_ERROR> m_warn_list; + /** A break down of the number of warnings per severity (level). */ uint m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END]; + /** The number of warnings of the current statement. Warning_info life cycle differs from statement life cycle -- it may span @@ -356,20 +343,25 @@ class Warning_info m_statement_warn_count 0, whereas m_warn_list is not empty. */ uint m_statement_warn_count; + /* Row counter, to print in errors and warnings. Not increased in create_sort_index(); may differ from examined_row_count. */ ulong m_current_row_for_warning; - /** Used to optionally clear warnings only once per statement. */ + + /** Used to optionally clear warnings only once per statement. */ ulonglong m_warn_id; + /** Indicates if push_warning() allows unlimited number of warnings. */ + bool m_allow_unlimited_warnings; + private: Warning_info(const Warning_info &rhs); /* Not implemented */ Warning_info& operator=(const Warning_info &rhs); /* Not implemented */ public: - Warning_info(ulonglong warn_id_arg); + Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings); ~Warning_info(); /** @@ -406,19 +398,13 @@ public: void append_warnings(THD *thd, List<MYSQL_ERROR> *src) { MYSQL_ERROR *err; - MYSQL_ERROR *copy; List_iterator_fast<MYSQL_ERROR> it(*src); /* Don't use ::push_warning() to avoid invocation of condition handlers or escalation of warnings to errors. */ while ((err= it++)) - { - copy= Warning_info::push_warning(thd, err->get_sql_errno(), err->get_sqlstate(), - err->get_level(), err->get_message_text()); - if (copy) - copy->copy_opt_attributes(err); - } + Warning_info::push_warning(thd, err); } /** @@ -484,6 +470,9 @@ public: MYSQL_ERROR::enum_warning_level level, const char* msg); + /** Add a new condition to the current list. */ + MYSQL_ERROR *push_warning(THD *thd, const MYSQL_ERROR *sql_condition); + /** Set the read only status for this statement area. This is a privileged operation, reserved for the implementation of |