List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:June 7 2011 1:22pm
Subject:bzr commit into mysql-trunk branch (alexander.nozdrin:3166) Bug#11763162
View as plain text  
#At file:///home/alik/MySQL/bzr/00/bug55843/mysql-trunk-bug55843-01/ based on revid:alexander.nozdrin@stripped

 3166 Alexander Nozdrin	2011-06-07
      Pre-requisite patch for Bug#11763162 (55843 - Handled condition
      appears as not handled).
      
      The patch moves Diagnostics_area's declaration after
      Warning_info's one. It's simply cut & paste operation, no real
      changes.

    modified:
      sql/sql_error.h
=== modified file 'sql/sql_error.h'
--- a/sql/sql_error.h	2011-04-15 12:14:35 +0000
+++ b/sql/sql_error.h	2011-06-07 13:22:10 +0000
@@ -23,114 +23,6 @@
 
 class THD;
 
-/**
-  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.
-*/
-
-class Diagnostics_area
-{
-public:
-  enum enum_diagnostics_status
-  {
-    /** The area is cleared at start of a statement. */
-    DA_EMPTY= 0,
-    /** Set whenever one calls my_ok(). */
-    DA_OK,
-    /** Set whenever one calls my_eof(). */
-    DA_EOF,
-    /** 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. */
-    DA_DISABLED
-  };
-  /** True if status information is sent to the client. */
-  bool is_sent;
-  /** Set to make set_error_status after set_{ok,eof}_status possible. */
-  bool can_overwrite_status;
-
-  void set_ok_status(THD *thd, ulonglong affected_rows_arg,
-                     ulonglong last_insert_id_arg,
-                     const char *message);
-  void set_eof_status(THD *thd);
-  void set_error_status(THD *thd, uint sql_errno_arg, const char *message_arg,
-                        const char *sqlstate);
-
-  void disable_status();
-
-  void reset_diagnostics_area();
-
-  bool is_set() const { return m_status != DA_EMPTY; }
-  bool is_error() const { return m_status == DA_ERROR; }
-  bool is_eof() const { return m_status == DA_EOF; }
-  bool is_ok() const { return m_status == DA_OK; }
-  bool is_disabled() const { return m_status == DA_DISABLED; }
-  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; }
-
-  uint sql_errno() const
-  { DBUG_ASSERT(m_status == DA_ERROR); return m_sql_errno; }
-
-  const char* get_sqlstate() const
-  { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; }
-
-  ulonglong affected_rows() const
-  { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; }
-
-  ulonglong last_insert_id() const
-  { DBUG_ASSERT(m_status == DA_OK); return m_last_insert_id; }
-
-  uint statement_warn_count() const
-  {
-    DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
-    return m_statement_warn_count;
-  }
-
-  Diagnostics_area() { reset_diagnostics_area(); }
-
-private:
-  /** Message buffer. Can be used by OK or ERROR status. */
-  char m_message[MYSQL_ERRMSG_SIZE];
-  /**
-    SQL error number. One of ER_ codes from share/errmsg.txt.
-    Set by set_error_status.
-  */
-  uint m_sql_errno;
-
-  char m_sqlstate[SQLSTATE_LENGTH+1];
-
-  /**
-    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
-    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 thd->row_count_func
-    can not be changed.
-  */
-  ulonglong    m_affected_rows;
-  /**
-    Similarly to the previous member, this is a replacement of
-    thd->first_successful_insert_id_in_prev_stmt, which is used
-    to implement LAST_INSERT_ID().
-  */
-  ulonglong   m_last_insert_id;
-  /**
-    Number of warnings of this last statement. May differ from
-    the number of warnings returned by SHOW WARNINGS e.g. in case
-    the statement doesn't clear the warnings, and doesn't generate
-    them.
-  */
-  uint	     m_statement_warn_count;
-  enum_diagnostics_status m_status;
-};
-
 ///////////////////////////////////////////////////////////////////////////
 
 /**
@@ -524,6 +416,118 @@ public:
   char *ptr() { return err_buffer; }
 };
 
+///////////////////////////////////////////////////////////////////////////
+
+/**
+  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.
+*/
+
+class Diagnostics_area
+{
+public:
+  enum enum_diagnostics_status
+  {
+    /** The area is cleared at start of a statement. */
+    DA_EMPTY= 0,
+    /** Set whenever one calls my_ok(). */
+    DA_OK,
+    /** Set whenever one calls my_eof(). */
+    DA_EOF,
+    /** 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. */
+    DA_DISABLED
+  };
+  /** True if status information is sent to the client. */
+  bool is_sent;
+  /** Set to make set_error_status after set_{ok,eof}_status possible. */
+  bool can_overwrite_status;
+
+  void set_ok_status(THD *thd, ulonglong affected_rows_arg,
+                     ulonglong last_insert_id_arg,
+                     const char *message);
+  void set_eof_status(THD *thd);
+  void set_error_status(THD *thd, uint sql_errno_arg, const char *message_arg,
+                        const char *sqlstate);
+
+  void disable_status();
+
+  void reset_diagnostics_area();
+
+  bool is_set() const { return m_status != DA_EMPTY; }
+  bool is_error() const { return m_status == DA_ERROR; }
+  bool is_eof() const { return m_status == DA_EOF; }
+  bool is_ok() const { return m_status == DA_OK; }
+  bool is_disabled() const { return m_status == DA_DISABLED; }
+  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; }
+
+  uint sql_errno() const
+  { DBUG_ASSERT(m_status == DA_ERROR); return m_sql_errno; }
+
+  const char* get_sqlstate() const
+  { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; }
+
+  ulonglong affected_rows() const
+  { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; }
+
+  ulonglong last_insert_id() const
+  { DBUG_ASSERT(m_status == DA_OK); return m_last_insert_id; }
+
+  uint statement_warn_count() const
+  {
+    DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
+    return m_statement_warn_count;
+  }
+
+  Diagnostics_area() { reset_diagnostics_area(); }
+
+private:
+  /** Message buffer. Can be used by OK or ERROR status. */
+  char m_message[MYSQL_ERRMSG_SIZE];
+  /**
+    SQL error number. One of ER_ codes from share/errmsg.txt.
+    Set by set_error_status.
+  */
+  uint m_sql_errno;
+
+  char m_sqlstate[SQLSTATE_LENGTH+1];
+
+  /**
+    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
+    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 thd->row_count_func
+    can not be changed.
+  */
+  ulonglong    m_affected_rows;
+  /**
+    Similarly to the previous member, this is a replacement of
+    thd->first_successful_insert_id_in_prev_stmt, which is used
+    to implement LAST_INSERT_ID().
+  */
+  ulonglong   m_last_insert_id;
+  /**
+    Number of warnings of this last statement. May differ from
+    the number of warnings returned by SHOW WARNINGS e.g. in case
+    the statement doesn't clear the warnings, and doesn't generate
+    them.
+  */
+  uint	     m_statement_warn_count;
+  enum_diagnostics_status m_status;
+};
+
+///////////////////////////////////////////////////////////////////////////
+
 
 void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
                   uint code, const char *msg);


Attachment: [text/bzr-bundle] bzr/alexander.nozdrin@oracle.com-20110607132210-6pijse7xsgajh1iv.bundle
Thread
bzr commit into mysql-trunk branch (alexander.nozdrin:3166) Bug#11763162Alexander Nozdrin7 Jun
  • Re: bzr commit into mysql-trunk branch (alexander.nozdrin:3166) Bug#11763162Davi Arnaut7 Jun