X-Account-Key: account4
X-UIDL: 1153746480.180764
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
X-Mozilla-Keys:                                                                                 
Return-Path: <commits-return-50234-marc.alff=mysql.com@lists.mysql.com>
Received: from mailget.mysql.com ([unix socket])
	 by mailget (Cyrus v2.3.1-Invoca-RPM-2.3.1-2.8.fc5) with LMTPA;
	 Wed, 23 Jul 2008 02:26:11 +0200
X-Sieve: CMU Sieve 2.3
Received: from mail.mysql.com (mail.mysql.com [10.100.1.21])
	by mailget.mysql.com (8.13.8/8.13.8) with ESMTP id m6N0QB9u009495
	for <malff@mailstore1.mysql.com>; Wed, 23 Jul 2008 02:26:11 +0200
Received: from mailgate-b.mysql.com (mailgate-b.mysql.com [10.128.18.33])
	by mail.mysql.com (8.13.3/8.13.3) with ESMTP id m6N0QAto004936
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <marc.alff@mysql.com>; Wed, 23 Jul 2008 02:26:10 +0200
Received: from lists.mysql.com (lists.mysql.com [10.100.1.37])
	by mailgate-b.mysql.com (8.13.8/8.13.8) with SMTP id m6N0Q9vK013701
	for <marc.alff@mysql.com>; Wed, 23 Jul 2008 02:26:09 +0200
Received: (qmail 23012 invoked by uid 510); 23 Jul 2008 00:26:08 -0000
Mailing-List: contact commits-help@lists.mysql.com; run by ezmlm
List-ID: <commits.mysql.com>
Precedence: bulk
List-Help: <mailto:commits-help@lists.mysql.com>
List-Unsubscribe: <mailto:commits-unsubscribe-marc.alff=mysql.com@lists.mysql.com>
List-Post: <mailto:commits@lists.mysql.com>
List-Archive: http://lists.mysql.com/commits/50234
Delivered-To: mailing list commits@lists.mysql.com
Received: (qmail 22967 invoked by uid 509); 23 Jul 2008 00:26:08 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
From: Marc Alff <marc.alff@sun.com>
Subject: bzr commit into mysql-6.0-wl2110-review branch (marc.alff:2675) WL#2110
To: commits@lists.mysql.com
User-Agent: Bazaar (1.4)
X-CSetKey: marc.alff@sun.com-20080723002553-lomvisfluy8tqf66
X-Worklog: 2110
X-bzr-action: commit
X-bzr-revid: marc.alff@sun.com-20080723002553-lomvisfluy8tqf66
X-bzr-revno: 2675
Message-Id: <20080723002559.B19D02DCAB@lambda.WEBLAB>
Date: Tue, 22 Jul 2008 18:25:59 -0600 (MDT)
X-Cxn-Txn: 56108064,34985398

#At file:///home/malff/BZR-TREE/mysql-6.0-wl2110-review-part3/

 2675 Marc Alff	2008-07-22
      WL#2110 (Stored Procedures: Implement SIGNAL)
      
      Formal review part 3/10: Handle condition
      
      This patch adjust the code to comply with the changes in
      Internal_error_handler::raise_condition().
      
        sql/handler.cc
        sql/log.cc
        sql/sp.cc
        sql/sql_acl.cc
        sql/unireg.cc
modified:
  sql/handler.cc
  sql/log.cc
  sql/sp.cc
  sql/sql_acl.cc
  sql/unireg.cc

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2008-07-09 07:12:43 +0000
+++ b/sql/handler.cc	2008-07-23 00:25:53 +0000
@@ -1854,23 +1854,17 @@ static const char *check_lowercase_names
 struct Ha_delete_table_error_handler: public Internal_error_handler
 {
 public:
-  virtual bool handle_error(uint sql_errno,
-                            const char *message,
-                            MYSQL_ERROR::enum_warning_level level,
-                            THD *thd);
+  virtual bool handle_condition(THD *thd, const SQL_condition *cond);
   char buff[MYSQL_ERRMSG_SIZE];
 };
 
 
 bool
 Ha_delete_table_error_handler::
-handle_error(uint sql_errno,
-             const char *message,
-             MYSQL_ERROR::enum_warning_level level,
-             THD *thd)
+handle_condition(THD *, const SQL_condition *cond)
 {
   /* Grab the error message */
-  strmake(buff, message, sizeof(buff)-1);
+  strmake(buff, cond->get_message_text(), sizeof(buff)-1);
   return TRUE;
 }
 

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2008-06-28 11:00:59 +0000
+++ b/sql/log.cc	2008-07-23 00:25:53 +0000
@@ -81,19 +81,14 @@ public:
 
   virtual ~Silence_log_table_errors() {}
 
-  virtual bool handle_error(uint sql_errno, const char *message,
-                            MYSQL_ERROR::enum_warning_level level,
-                            THD *thd);
+  virtual bool handle_condition(THD *thd, const SQL_condition *cond);
   const char *message() const { return m_message; }
 };
 
 bool
-Silence_log_table_errors::handle_error(uint /* sql_errno */,
-                                       const char *message_arg,
-                                       MYSQL_ERROR::enum_warning_level /* level */,
-                                       THD * /* thd */)
+Silence_log_table_errors::handle_condition(THD *, const SQL_condition *cond)
 {
-  strmake(m_message, message_arg, sizeof(m_message)-1);
+  strmake(m_message, cond->get_message_text(), sizeof(m_message)-1);
   return TRUE;
 }
 

=== modified file 'sql/sp.cc'
--- a/sql/sp.cc	2008-06-04 11:18:52 +0000
+++ b/sql/sp.cc	2008-07-23 00:25:53 +0000
@@ -496,18 +496,15 @@ db_find_routine(THD *thd, int type, sp_n
 struct Silence_deprecated_warning : public Internal_error_handler
 {
 public:
-  virtual bool handle_error(uint sql_errno, const char *message,
-                            MYSQL_ERROR::enum_warning_level level,
-                            THD *thd);
+  virtual bool handle_condition(THD *thd, const SQL_condition *cond);
 };
 
 bool
-Silence_deprecated_warning::handle_error(uint sql_errno, const char *message,
-                                         MYSQL_ERROR::enum_warning_level level,
-                                         THD *thd)
+Silence_deprecated_warning::handle_condition(THD *thd,
+                                             const SQL_condition *cond)
 {
-  if (sql_errno == ER_WARN_DEPRECATED_SYNTAX &&
-      level == MYSQL_ERROR::WARN_LEVEL_WARN)
+  if (cond->m_sql_errno == ER_WARN_DEPRECATED_SYNTAX &&
+      cond->m_level == MYSQL_ERROR::WARN_LEVEL_WARN)
     return TRUE;
 
   return FALSE;

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2008-06-28 11:00:59 +0000
+++ b/sql/sql_acl.cc	2008-07-23 00:25:53 +0000
@@ -6132,9 +6132,7 @@ public:
   virtual ~Silence_routine_definer_errors()
   {}
 
-  virtual bool handle_error(uint sql_errno, const char *message,
-                            MYSQL_ERROR::enum_warning_level level,
-                            THD *thd);
+  virtual bool handle_condition(THD *thd, const SQL_condition *cond);
 
   bool has_errors() { return is_grave; }
 
@@ -6143,18 +6141,17 @@ private:
 };
 
 bool
-Silence_routine_definer_errors::handle_error(uint sql_errno,
-                                       const char *message,
-                                       MYSQL_ERROR::enum_warning_level level,
-                                       THD *thd)
+Silence_routine_definer_errors::handle_condition(THD *thd,
+                                                 const SQL_condition *cond)
 {
-  if (level == MYSQL_ERROR::WARN_LEVEL_ERROR)
+  if (cond->m_level == MYSQL_ERROR::WARN_LEVEL_ERROR)
   {
-    switch (sql_errno)
+    switch (cond->m_sql_errno)
     {
       case ER_NONEXISTING_PROC_GRANT:
         /* Convert the error into a warning. */
-        push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, sql_errno, message);
+        push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                     cond->m_sql_errno, cond->get_message_text());
         return TRUE;
       default:
         is_grave= TRUE;

=== modified file 'sql/unireg.cc'
--- a/sql/unireg.cc	2008-05-29 15:44:11 +0000
+++ b/sql/unireg.cc	2008-07-23 00:25:53 +0000
@@ -56,10 +56,7 @@ static bool make_empty_rec(THD *thd, int
 
 struct Pack_header_error_handler: public Internal_error_handler
 {
-  virtual bool handle_error(uint sql_errno,
-                            const char *message,
-                            MYSQL_ERROR::enum_warning_level level,
-                            THD *thd);
+  virtual bool handle_condition(THD *thd, const SQL_condition *cond);
   bool is_handled;
   Pack_header_error_handler() :is_handled(FALSE) {}
 };
@@ -67,12 +64,9 @@ struct Pack_header_error_handler: public
 
 bool
 Pack_header_error_handler::
-handle_error(uint sql_errno,
-             const char * /* message */,
-             MYSQL_ERROR::enum_warning_level /* level */,
-             THD * /* thd */)
+handle_condition(THD *, const SQL_condition *cond)
 {
-  is_handled= (sql_errno == ER_TOO_MANY_FIELDS);
+  is_handled= (cond->m_sql_errno == ER_TOO_MANY_FIELDS);
   return is_handled;
 }
 


-- 
MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits
To unsubscribe:    http://lists.mysql.com/commits?unsub=marc.alff@mysql.com


