List:Commits« Previous MessageNext Message »
From:Kristofer Pettersson Date:July 21 2008 2:49pm
Subject:bzr commit into mysql-6.0-backup branch (kpettersson:2732)
View as plain text  
#At file:///home/thek/Development/cpp/mysqlbzr/mysql-6.0-bugteam/

 2732 Kristofer Pettersson	2008-07-21 [merge]
      Auto merge
modified:
  sql/log.cc

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2008-07-21 14:44:53 +0000
+++ b/sql/log.cc	2008-07-21 14:48:26 +0000
@@ -3091,7 +3091,7 @@ int MYSQL_BIN_LOG::purge_logs(const char
   int ret = 0;
   bool exit_loop= 0;
   LOG_INFO log_info;
-  THD *thd =current_thd;
+  THD *thd= current_thd;
   DBUG_ENTER("purge_logs");
   DBUG_PRINT("info",("to_log= %s",to_log));
 
@@ -3118,9 +3118,12 @@ int MYSQL_BIN_LOG::purge_logs(const char
           It's not fatal if we can't stat a log file that does not exist;
           If we could not stat, we won't delete.
         */     
-        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                            ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
-                            log_info.log_file_name);
+        if (thd)
+        {
+          push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                              ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
+                              log_info.log_file_name);
+        }
         sql_print_information("Failed to execute my_stat on file '%s'",
 			      log_info.log_file_name);
         my_errno= 0;
@@ -3130,13 +3133,24 @@ int MYSQL_BIN_LOG::purge_logs(const char
         /*
           Other than ENOENT are fatal
         */
-        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                            ER_BINLOG_PURGE_FATAL_ERR,
-                            "a problem with getting info on being purged %s; "
-                            "consider examining correspondence "
-                            "of your binlog index file "
-                            "to the actual binlog files",
-                            log_info.log_file_name);
+        if (thd)
+        {
+          push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                              ER_BINLOG_PURGE_FATAL_ERR,
+                              "a problem with getting info on being purged %s; "
+                              "consider examining correspondence "
+                              "of your binlog index file "
+                              "to the actual binlog files",
+                              log_info.log_file_name);
+        }
+        else
+        {
+          sql_print_information("Failed to delete log file '%s'; "
+                                "consider examining correspondence "
+                                "of your binlog index file "
+                                "to the actual binlog files",
+                                log_info.log_file_name);
+        }
         error= LOG_INFO_FATAL;
         goto err;
       }
@@ -3153,9 +3167,12 @@ int MYSQL_BIN_LOG::purge_logs(const char
       {
         if (my_errno == ENOENT) 
         {
-          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                              ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
-                              log_info.log_file_name);
+          if (thd)
+          {
+            push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                                ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
+                                log_info.log_file_name);
+          }
           sql_print_information("Failed to delete file '%s'",
                                 log_info.log_file_name);
           my_errno= 0;
@@ -3238,7 +3255,7 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
   int error;
   LOG_INFO log_info;
   MY_STAT stat_area;
-
+  THD *thd= current_thd;
   DBUG_ENTER("purge_logs_before_date");
 
   pthread_mutex_lock(&LOCK_index);
@@ -3260,10 +3277,13 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
       {
         /*
           It's not fatal if we can't stat a log file that does not exist.
-        */     
-        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                            ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
-                            log_info.log_file_name);
+        */
+        if (thd)
+        {
+          push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                              ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
+                              log_info.log_file_name);
+        }
 	sql_print_information("Failed to execute my_stat on file '%s'",
 			      log_info.log_file_name);
         my_errno= 0;
@@ -3273,13 +3293,21 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
         /*
           Other than ENOENT are fatal
         */
-        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                            ER_BINLOG_PURGE_FATAL_ERR,
-                            "a problem with getting info on being purged %s; "
-                            "consider examining correspondence "
-                            "of your binlog index file "
-                            "to the actual binlog files",
-                            log_info.log_file_name);
+        if (thd)
+        {
+          push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                              ER_BINLOG_PURGE_FATAL_ERR,
+                              "a problem with getting info on being purged %s; "
+                              "consider examining correspondence "
+                              "of your binlog index file "
+                              "to the actual binlog files",
+                              log_info.log_file_name);
+        }
+        else
+        {
+          sql_print_information("Failed to delete log file '%s'",
+                                log_info.log_file_name);
+        }
         error= LOG_INFO_FATAL;
         goto err;
       }
@@ -3293,22 +3321,33 @@ int MYSQL_BIN_LOG::purge_logs_before_dat
         if (my_errno == ENOENT) 
         {
           /* It's not fatal even if we can't delete a log file */
-          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
-                              ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
-                              log_info.log_file_name);
+          if (thd)
+          {
+            push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                                ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
+                                log_info.log_file_name);
+          }
           sql_print_information("Failed to delete file '%s'",
                                 log_info.log_file_name);
           my_errno= 0;
         }
         else
         {
-          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
-                              ER_BINLOG_PURGE_FATAL_ERR,
-                              "a problem with deleting %s; "
-                              "consider examining correspondence "
-                              "of your binlog index file "
-                              "to the actual binlog files",
-                              log_info.log_file_name);
+          if (thd)
+          {
+            push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+                                ER_BINLOG_PURGE_FATAL_ERR,
+                                "a problem with deleting %s; "
+                                "consider examining correspondence "
+                                "of your binlog index file "
+                                "to the actual binlog files",
+                                log_info.log_file_name);
+          }
+          else
+          {
+            sql_print_information("Failed to delete log file '%s'",
+                                  log_info.log_file_name); 
+          }
           error= LOG_INFO_FATAL;
           goto err;
         }

Thread
bzr commit into mysql-6.0-backup branch (kpettersson:2732) Kristofer Pettersson21 Jul