MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:January 4 2007 1:30pm
Subject:bk commit into 5.1 tree (tomas:1.2086) BUG#21345
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2086 07/01/04 14:29:59 tomas@poseidon. +3 -0
    Fix for BUG#21345, Error in cluster logfile rotation.
    Fixed the cluster logfile rotation code, let the cluster logfile be renamed correctly
  when the main logfile exceeds the configured maximum size.

  storage/ndb/src/common/util/File.cpp
    1.11 07/01/04 14:29:53 tomas@poseidon. +12 -0
      Fix for BUG#21345, Error in cluster logfile rotation.
      Fixed the cluster logfile rotation code, let the cluster logfile be renamed correctly
    when the main logfile exceeds the configured maximum size.

  storage/ndb/src/common/logger/FileLogHandler.cpp
    1.11 07/01/04 14:29:53 tomas@poseidon. +10 -1
      Fix for BUG#21345, Error in cluster logfile rotation.
      Fixed the cluster logfile rotation code, let the cluster logfile be renamed correctly
    when the main logfile exceeds the configured maximum size.

  storage/ndb/include/util/File.hpp
    1.6 07/01/04 14:29:52 tomas@poseidon. +8 -0
      Fix for BUG#21345, Error in cluster logfile rotation.
      Fixed the cluster logfile rotation code, let the cluster logfile be renamed correctly
    when the main logfile exceeds the configured maximum size.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	poseidon.
# Root:	/home/tomas/mysql-5.1-wl2325-5.0

--- 1.5/storage/ndb/include/util/File.hpp	2005-04-08 02:43:54 +02:00
+++ 1.6/storage/ndb/include/util/File.hpp	2007-01-04 14:29:52 +01:00
@@ -29,6 +29,14 @@
 {
 public:
   /**
+   * Returns time for last contents modification of a file.
+   *
+   * @param aFileName a filename to check.
+   * @return the time for last contents modificaton of the file.
+   */
+  static time_t mtime(const char* aFileName);      
+
+  /**
    * Returns true if the file exist.
    *
    * @param aFileName a filename to check.

--- 1.10/storage/ndb/src/common/logger/FileLogHandler.cpp	2005-04-08 02:43:56 +02:00
+++ 1.11/storage/ndb/src/common/logger/FileLogHandler.cpp	2007-01-04 14:29:53 +01:00
@@ -147,6 +147,7 @@
   bool rc = true;	
   int fileNo = 1;
   char newName[PATH_MAX];
+  time_t newMtime, preMtime = 0;
 
   do
   {
@@ -159,7 +160,15 @@
     }		
     BaseString::snprintf(newName, sizeof(newName),
 	       "%s.%d", m_pLogFile->getName(), fileNo++); 
-    
+    newMtime = File_class::mtime(newName);
+    if (newMtime < preMtime) 
+    {
+      break;
+    }
+    else
+    {
+      preMtime = newMtime;
+    }
   } while (File_class::exists(newName));
   
   m_pLogFile->close();	

--- 1.10/storage/ndb/src/common/util/File.cpp	2005-05-31 14:34:30 +02:00
+++ 1.11/storage/ndb/src/common/util/File.cpp	2007-01-04 14:29:53 +01:00
@@ -24,6 +24,18 @@
 //
 // PUBLIC
 //
+time_t 
+File_class::mtime(const char* aFileName)
+{
+  MY_STAT stmp;
+  time_t rc = 0;
+
+  if (my_stat(aFileName, &stmp, MYF(0)) != NULL) {
+    rc = stmp.st_mtime;
+  }
+
+  return rc;
+}
 
 bool 
 File_class::exists(const char* aFileName)
Thread
bk commit into 5.1 tree (tomas:1.2086) BUG#21345tomas4 Jan