MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Rafal Somla Date:November 20 2008 9:35am
Subject:bzr commit into mysql-6.0-backup branch (Rafal.Somla:2736) Bug#40307
View as plain text  
#At file:///ext/mysql/bzr/backup/bug40307/

 2736 Rafal Somla	2008-11-20
      BUG#40307 - Backup: The list of databases processed by BACKUP/RESTORE not 
                  logged.
      
      After this patch, the trace from BACKUP/RESTOE commands left in server's error 
      log (master.err) will look as follows:
      
       [Note] Backup: Starting backup process
       [Note] Backup: Backing up database(s) <list of databases>
       [Note] Backup: Backup completed
      
       [Note] Restore: Starting restore process
       [Note] Restore: Restoring database(s) <list of databases>
       [Note] Restore: Restore completed
      
      This way DBA can find out which databases are affected by the operation.
      
      Database list is reported in Logger::report_stats_pre() which is called after 
      initializing backup/restore catalogue and before performing backup of table 
      data.
modified:
  sql/backup/kernel.cc
  sql/backup/logger.cc
  sql/share/errmsg.txt

per-file messages:
  sql/backup/kernel.cc
    Remove messages which are replaced by the ones written in 
    Logger::report_stats_pre().
  sql/backup/logger.cc
    Compose list of databases in the backup/restore catalogue and report it.
  sql/share/errmsg.txt
    Added messages for reporting database list in error log, so that they can be internationalized.
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc	2008-11-17 09:57:51 +0000
+++ b/sql/backup/kernel.cc	2008-11-20 09:35:26 +0000
@@ -180,15 +180,9 @@ execute_backup_command(THD *thd, LEX *le
     // select objects to backup
 
     if (lex->db_list.is_empty())
-    {
-      context.write_message(log_level::INFO, "Backing up all databases");
       res= info->add_all_dbs(); // backup all databases
-    }
     else
-    {
-      context.write_message(log_level::INFO, "Backing up selected databases");
       res= info->add_dbs(lex->db_list); // backup databases specified by user
-    }
 
     info->close(); // close catalogue after filling it with objects to backup
 

=== modified file 'sql/backup/logger.cc'
--- a/sql/backup/logger.cc	2008-10-27 13:06:21 +0000
+++ b/sql/backup/logger.cc	2008-11-20 09:35:26 +0000
@@ -125,6 +125,25 @@ void Logger::report_stats_pre(const Imag
 {
   DBUG_ASSERT(m_state == RUNNING);
   backup_log->num_objects(info.table_count());
+  // Compose list of databases.
+
+  Image_info::Db_iterator *it= info.get_dbs();
+  Image_info::Obj *db;
+  Image_info::Obj::describe_buf name_buf;
+  String dbs;
+
+  while((db= (*it)++))
+  {
+    if (!dbs.is_empty())
+      dbs.append(",");
+    dbs.append(db->describe(name_buf));
+  }
+
+  // Log the databases.
+
+  report_error(log_level::INFO, m_type == BACKUP ? ER_BACKUP_BACKUP_DBS
+                                                 : ER_BACKUP_RESTORE_DBS, 
+                                dbs.c_ptr());
 }
 
 /**

=== modified file 'sql/share/errmsg.txt'
--- a/sql/share/errmsg.txt	2008-11-17 09:57:51 +0000
+++ b/sql/share/errmsg.txt	2008-11-20 09:35:26 +0000
@@ -6436,3 +6436,7 @@ ER_RESTORE_DB_EXISTS
   eng "Database \'%-.64s\' already exists. Use OVERWRITE flag to overwrite."
 ER_QUERY_CACHE_DISABLED
 	eng "Query cache is disabled; restart the server with query_cache_type=1 to enable it"
+ER_BACKUP_BACKUP_DBS
+  eng "Backing up database(s) %.256s"
+ER_BACKUP_RESTORE_DBS
+  eng "Restoring database(s) %.256s"

Thread
bzr commit into mysql-6.0-backup branch (Rafal.Somla:2736) Bug#40307Rafal Somla20 Nov
  • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2736)Bug#40307Øystein Grøvlen24 Nov
    • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2736)Bug#40307Rafal Somla25 Nov
      • Re: bzr commit into mysql-6.0-backup branch (Rafal.Somla:2736)Bug#40307Jørgen Løland25 Nov