List:Commits« Previous MessageNext Message »
From:Marc Alff Date:July 29 2008 10:04pm
Subject:bzr commit into mysql-6.0-backup branch (marc.alff:2743) Bug#36679
View as plain text  
#At file:///home/malff/BZR-TREE/mysql-6.0-36679/

 2743 Marc Alff	2008-07-29
      Bug#36679 (push_warning() should return void)
      
      This fix is required as a preliminary for SIGNAL / RESIGNAL / GET
      DIAGNOSTICS, to prevent code to modify a SQL condition after it has been
      raised.
      
      Minor code cleanup.
modified:
  sql/sql_error.cc
  sql/sql_error.h

=== modified file 'sql/sql_error.cc'
--- a/sql/sql_error.cc	2008-02-19 12:59:19 +0000
+++ b/sql/sql_error.cc	2008-07-29 22:03:57 +0000
@@ -97,12 +97,9 @@ void mysql_reset_errors(THD *thd, bool f
     level		Severity of warning (note, warning, error ...)
     code		Error number
     msg			Clear error message
-    
-  RETURN
-    pointer on MYSQL_ERROR object
 */
 
-MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, 
+void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, 
                           uint code, const char *msg)
 {
   MYSQL_ERROR *err= 0;
@@ -111,7 +108,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQ
 
   if (level == MYSQL_ERROR::WARN_LEVEL_NOTE &&
       !(thd->options & OPTION_SQL_NOTES))
-    DBUG_RETURN(0);
+    DBUG_VOID_RETURN;
 
   if (thd->query_id != thd->warn_id && !thd->spcont)
     mysql_reset_errors(thd, 0);
@@ -138,12 +135,12 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQ
   }
 
   if (thd->handle_error(code, msg, level))
-    DBUG_RETURN(NULL);
+    DBUG_VOID_RETURN;
 
   if (thd->spcont &&
       thd->spcont->handle_error(code, level, thd))
   {
-    DBUG_RETURN(NULL);
+    DBUG_VOID_RETURN;
   }
   query_cache_abort(&thd->query_cache_tls);
 
@@ -156,7 +153,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQ
   }
   thd->warn_count[(uint) level]++;
   thd->total_warn_count++;
-  DBUG_RETURN(err);
+  DBUG_VOID_RETURN;
 }
 
 /*

=== modified file 'sql/sql_error.h'
--- a/sql/sql_error.h	2008-06-12 19:04:52 +0000
+++ b/sql/sql_error.h	2008-07-29 22:03:57 +0000
@@ -35,8 +35,8 @@ private:
   void set_msg(THD *thd, const char *msg_arg);
 };
 
-MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
-                          uint code, const char *msg);
+void push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
+                  uint code, const char *msg);
 void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
 			 uint code, const char *format, ...);
 void mysql_reset_errors(THD *thd, bool force);

Thread
bzr commit into mysql-6.0-backup branch (marc.alff:2743) Bug#36679Marc Alff30 Jul