List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:October 8 2009 6:48am
Subject:bzr push into mysql-5.1-telco-7.0 branch (jonas:3091 to 3094)
View as plain text  
 3094 Jonas Oreland	2009-10-08
      ndb - trial and terror fix for traditional failure of ndb_binlog_variants on windoze

    modified:
      mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test
 3093 Jonas Oreland	2009-10-08
      ndb - fix windoze warnings

    modified:
      storage/ndb/test/include/DbUtil.hpp
      storage/ndb/test/src/DbUtil.cpp
 3092 Jonas Oreland	2009-10-08 [merge]
      ndb - merge 63 to 70

    modified:
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp
      storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp
      storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp
 3091 jack andrews	2009-10-08
      fixed missing CMakeLists.txt file
      was in patch series, but did not `bzr add`

    added:
      storage/ndb/test/run-test/CMakeLists.txt
=== modified file 'mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test'
--- a/mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test	2009-10-07 16:27:03 +0000
+++ b/mysql-test/suite/ndb_binlog/t/ndb_binlog_variants.test	2009-10-08 06:46:45 +0000
@@ -205,9 +205,8 @@ drop table bah;
 --echo Manually applying captured binlog
 --disable_query_log
 let $MYSQLD_DATADIR= `select @@datadir;`;
-let $BINLOG_FILE= '$MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql';
---exec $MYSQL_BINLOG $MYSQLD_DATADIR/mysqld-bin.000001 > $BINLOG_FILE
---exec $MYSQL -uroot < $BINLOG_FILE
+--exec $MYSQL_BINLOG $MYSQLD_DATADIR/mysqld-bin.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
+--exec $MYSQL -uroot < $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
 
 --enable_query_log
 select * from bah order by tst;

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2009-09-22 07:42:46 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2009-10-08 06:29:00 +0000
@@ -1317,17 +1317,17 @@ public:
      *       invalidated.
      */
     Uint16 savePageIndex;
-    Uint8 logTailMbyte;
+    Uint16 logTailMbyte;
     /**
      *       The mbyte within the starting log file where to start 
      *       executing the log.                
      */
-    Uint8 startMbyte;
+    Uint16 startMbyte;
     /**
      *       The last mbyte in which to execute the log during system
      *       restart.
      */
-    Uint8 stopMbyte;
+    Uint16 stopMbyte;
    /**
      *       This variable refers to the file where invalidation is
      *       occuring during system/node restart.

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp	2009-09-03 09:14:28 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/reader.cpp	2009-10-08 06:24:59 +0000
@@ -60,7 +60,8 @@ Uint32 *redoLogPage;
 unsigned NO_MBYTE_IN_FILE = 16;
 
 NDB_COMMAND(redoLogFileReader,  "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) { 
-  Uint32 wordIndex = 0;
+  ndb_init();
+  Int32 wordIndex = 0;
   Uint32 oldWordIndex = 0;
   Uint32 recordType = 1234567890;
 
@@ -166,7 +167,7 @@ NDB_COMMAND(redoLogFileReader,  "redoLog
       Uint32 *redoLogPagePos = redoLogPage + i*PAGESIZE;
       if (words_from_previous_page)
       {
-	memmove(redoLogPagePos + wordIndex ,
+	memmove(redoLogPagePos + wordIndex,
 		redoLogPagePos - words_from_previous_page,
 		words_from_previous_page*4);
       }
@@ -183,8 +184,8 @@ NDB_COMMAND(redoLogFileReader,  "redoLog
 	else
 	{
 	  // Print out mbyte number, page number and word index.
-	  ndbout << j << ":" << i << ":" << wordIndex << endl 
-		 << " " << j*32 + i << ":" << wordIndex << " ";
+          ndbout_c("mb: %u fp: %u pos: %u",
+                   j, (j*32 + i), wordIndex);
 	}
 	redoLogPagePos = redoLogPage + i*PAGESIZE + wordIndex;
 	oldWordIndex = wordIndex;
@@ -319,7 +320,7 @@ NDB_COMMAND(redoLogFileReader,  "redoLog
             wordIndex = lastWord;
           }
 	}
-      } while(wordIndex < lastWord && i < NO_PAGES_IN_MBYTE);
+      } while(wordIndex < (Int32)lastWord && i < NO_PAGES_IN_MBYTE);
 
 
       if (false && lastPage)
@@ -435,10 +436,6 @@ void readArguments(int argc, const char*
 	onlyLap = true;
       } else if (strcmp(argv[i], "-mbyte") == 0) {
 	startAtMbyte = atoi(argv[i+1]);
-	if (startAtMbyte > 15) {
-	  usage(argv[0]);
-	  doExit();
-	}
 	argc--;
 	i++;
       } else if (strcmp(argv[i], "-page") == 0) {

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp	2009-09-03 08:15:17 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp	2009-10-08 06:24:59 +0000
@@ -293,41 +293,47 @@ Uint32 FileDescriptor::getLogRecordSize(
     + m_fdHeader.m_noOfDescriptors * NO_MBYTE_IN_FILE * FILEDESCRIPTORENTRYSIZE;
 }
 
+static
+const Uint32 *
+printFileDescriptorRecord(Uint32 no, const Uint32 * ptr)
+{
+  ndbout << "------------------FILE DESCRIPTOR " << no
+	 <<" ---------------------" << endl << endl;
+  ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex"); 
+
+  const Uint32 * completed = ptr;
+  const Uint32 * started = (ptr + NO_MBYTE_IN_FILE);
+  const Uint32 * prepref = (ptr + 2 * NO_MBYTE_IN_FILE);
+  for(unsigned i = 0; i < NO_MBYTE_IN_FILE; i++) 
+  {
+    ndbout_c(" mb: %u Max GCI completed: %u" 
+             " Max GCI started: %u Last prepared ref: %u (file: %u mb: %u)",
+             i, 
+             completed[i],
+             started[i],
+             prepref[i],
+             (prepref[i] >> 16),
+             (prepref[i] & 65535));
+  }
+  ndbout << endl;
+  return ptr + 3 * NO_MBYTE_IN_FILE;
+}
+
+
 NdbOut& operator<<(NdbOut& no, const FileDescriptor& fd) {
   no << "-------FILE DESCRIPTOR HEADER------------------" << endl << endl;
   printOut("Record type:", fd.m_fdHeader.m_recordType);
   printOut("Number of file descriptors:", fd.m_fdHeader.m_noOfDescriptors);
   printOut("File number:", fd.m_fdHeader.m_fileNo);
   ndbout << endl;
-  for(Uint32 i = 0; i < fd.m_fdHeader.m_noOfDescriptors; i++) {
-    fd.printARecord(i);
+  const Uint32 * ptr = fd.m_fdRecord;
+  for(Uint32 i = 0; i < fd.m_fdHeader.m_noOfDescriptors; i++)
+  {
+    ptr = printFileDescriptorRecord(i, ptr);
   }
   return no;
 }
 
-void FileDescriptor::printARecord( Uint32 recordIndex ) const {
-  ndbout << "------------------FILE DESCRIPTOR " << recordIndex 
-	 <<" ---------------------" << endl << endl;
-  ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex"); 
-
-  for(unsigned i = 1; i <= NO_MBYTE_IN_FILE; i++) {
-    ndbout_c("%s%2d%s%-12u%-12x", "Max GCI completed, mbyte ", i, ":  ", 
-	     m_fdRecord[recordIndex].m_maxGciCompleted[i-1],
-	     m_fdRecord[recordIndex].m_maxGciCompleted[i-1]);
-  }
-  for(unsigned i = 1; i <= NO_MBYTE_IN_FILE; i++) {
-    ndbout_c("%s%2d%s%-12u%-12x", "Max GCI started,  mbyte ", i, ":   ", 
-	     m_fdRecord[recordIndex].m_maxGciStarted[i-1],
-	     m_fdRecord[recordIndex].m_maxGciStarted[i-1]);
-  }
-  for(unsigned i = 1; i <= NO_MBYTE_IN_FILE; i++) {
-    ndbout_c("%s%2d%s%-12u%-12x", "Last prepared ref, mbyte ", i, ":  ", 
-	     m_fdRecord[recordIndex].m_lastPreparedReference[i-1],
-	     m_fdRecord[recordIndex].m_lastPreparedReference[i-1]);
-  }
-  ndbout << endl;
-}
-
 bool FileDescriptor::check() {
   // Not implemented yet.
   return true;

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp	2009-09-03 08:15:17 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp	2009-10-08 06:24:59 +0000
@@ -174,14 +174,8 @@ public:
   Uint32 m_fileNo;
 };
 
-class FileDescriptorRecord {
-public:
-  Uint32 m_maxGciCompleted[16];
-  Uint32 m_maxGciStarted[16];
-  Uint32 m_lastPreparedReference[16];
-};
-
-class FileDescriptor {
+class FileDescriptor 
+{
   friend NdbOut& operator<<(NdbOut&, const FileDescriptor&);
 public:
   bool check();
@@ -189,7 +183,7 @@ public:
 protected:
   void printARecord( Uint32 ) const;
   FileDescriptorHeader m_fdHeader;
-  FileDescriptorRecord m_fdRecord[1];
+  Uint32 m_fdRecord[1];
 };
 
 

=== modified file 'storage/ndb/test/include/DbUtil.hpp'
--- a/storage/ndb/test/include/DbUtil.hpp	2009-06-11 13:38:12 +0000
+++ b/storage/ndb/test/include/DbUtil.hpp	2009-10-08 06:34:29 +0000
@@ -71,8 +71,8 @@ public:
   uint columnAsInt(const char* col_name);
   unsigned long long columnAsLong(const char* col_name);
 
-  uint insertId();
-  uint affectedRows();
+  unsigned long long insertId();
+  unsigned long long affectedRows();
   uint numRows(void);
   uint mysqlErrno();
   const char* mysqlError();
@@ -139,7 +139,7 @@ public:
   const char* last_error() const { return m_last_error.c_str(); }
   int last_errno() const { return m_last_errno; }
 
-  unsigned long selectCountTable(const char * table);
+  unsigned long long selectCountTable(const char * table);
 
   void silent() { m_silent= true; };
 

=== modified file 'storage/ndb/test/src/DbUtil.cpp'
--- a/storage/ndb/test/src/DbUtil.cpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/test/src/DbUtil.cpp	2009-10-08 06:34:29 +0000
@@ -319,7 +319,7 @@ DbUtil::createDb(BaseString& m_db)
 
 /* Count Table Rows */
 
-unsigned long
+unsigned long long
 DbUtil::selectCountTable(const char * table)
 {
   BaseString query;
@@ -509,11 +509,11 @@ DbUtil::runQuery(const char* sql,
 
   // Save stats in result set
   rows.put("rows", row);
-  rows.put("affected_rows", mysql_affected_rows(m_mysql));
+  rows.put64("affected_rows", mysql_affected_rows(m_mysql));
   rows.put("mysql_errno", mysql_errno(m_mysql));
   rows.put("mysql_error", mysql_error(m_mysql));
   rows.put("mysql_sqlstate", mysql_sqlstate(m_mysql));
-  rows.put("insert_id", mysql_insert_id(m_mysql));
+  rows.put64("insert_id", mysql_insert_id(m_mysql));
 
   mysql_stmt_close(stmt);
   return true;
@@ -701,16 +701,15 @@ unsigned long long SqlResultSet::columnA
 }
 
 
-uint SqlResultSet::insertId(){
-  return get_int("insert_id");
+unsigned long long SqlResultSet::insertId(){
+  return get_long("insert_id");
 }
 
 
-uint SqlResultSet::affectedRows(){
-  return get_int("affected_rows");
+unsigned long long SqlResultSet::affectedRows(){
+  return get_long("affected_rows");
 }
 
-
 uint SqlResultSet::numRows(void){
   return get_int("rows");
 }


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20091008064645-1xadv6146yoycky9.bundle
Thread
bzr push into mysql-5.1-telco-7.0 branch (jonas:3091 to 3094)Jonas Oreland8 Oct