List:Commits« Previous MessageNext Message »
From:Ole John Aske Date:May 12 2011 6:49am
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch
(ole.john.aske:3493 to 3494)
View as plain text  
 3494 Ole John Aske	2011-05-12 [merge]
      Merge telco-7.0 -> SPJ

    modified:
      storage/ndb/src/common/portlib/NdbTCP.cpp
 3493 Ole John Aske	2011-05-11 [merge]
      Merge telco-7.0 -> SPJ

    removed:
      mysql-test/suite/ndb/include/add_six_nodes.inc
      mysql-test/suite/ndb/include/add_two_nodes.inc
      mysql-test/suite/ndb/include/reload_ndb_mgmd.inc
      mysql-test/suite/ndb/r/add_node01.result
      mysql-test/suite/ndb/r/add_node02.result
      mysql-test/suite/ndb/r/add_node03.result
      mysql-test/suite/ndb/t/add_node01.test
      mysql-test/suite/ndb/t/add_node02.test
      mysql-test/suite/ndb/t/add_node03.test
    added:
      mysql-test/suite/ndb/data/
    renamed:
      mysql-test/suite/ndb/std_data/ => mysql-test/suite/ndb/backups/
      mysql-test/suite/ndb/std_data/ndb_backup50/ => mysql-test/suite/ndb/backups/50/
      mysql-test/suite/ndb/std_data/ndb_backup51/ => mysql-test/suite/ndb/backups/51/
      mysql-test/suite/ndb/std_data/ndb_backup51_d2_be/ => mysql-test/suite/ndb/backups/51_d2_be/
      mysql-test/suite/ndb/std_data/ndb_backup51_d2_le/ => mysql-test/suite/ndb/backups/51_d2_le/
      mysql-test/suite/ndb/std_data/ndb_backup51_data_be/ => mysql-test/suite/ndb/backups/51_data_be/
      mysql-test/suite/ndb/std_data/ndb_backup51_data_le/ => mysql-test/suite/ndb/backups/51_data_le/
      mysql-test/suite/ndb/std_data/ndb_backup51_dd/ => mysql-test/suite/ndb/backups/51_dd/
      mysql-test/suite/ndb/std_data/ndb_backup51_undolog_be/ => mysql-test/suite/ndb/backups/51_undolog_be/
      mysql-test/suite/ndb/std_data/ndb_backup51_undolog_le/ => mysql-test/suite/ndb/backups/51_undolog_le/
      mysql-test/suite/ndb/std_data/ndb_backup_before_native_default/ => mysql-test/suite/ndb/backups/before_native_default/
      mysql-test/suite/ndb/std_data/ndb_backup_bug54613/ => mysql-test/suite/ndb/backups/bug54613/
      mysql-test/suite/ndb/std_data/ndb_backup_hashmap/ => mysql-test/suite/ndb/backups/hashmap/
      mysql-test/suite/ndb/std_data/ndb_backup_packed/ => mysql-test/suite/ndb/backups/packed/
      mysql-test/suite/ndb/std_data/table_data10000.dat => mysql-test/suite/ndb/data/table_data10000.dat
      mysql-test/suite/ndb/std_data/table_data100000.dat => mysql-test/suite/ndb/data/table_data100000.dat
    modified:
      mysql-test/Makefile.am
      mysql-test/lib/My/SysInfo.pm
      mysql-test/mysql-test-run.pl
      mysql-test/suite/ndb/t/disabled.def
      mysql-test/suite/ndb/t/ndb_addnode.test
      mysql-test/suite/ndb/t/ndb_alter_table_backup.test
      mysql-test/suite/ndb/t/ndb_dd_restore_compat.test
      mysql-test/suite/ndb/t/ndb_native_default_support.test
      mysql-test/suite/ndb/t/ndb_restore_compat_downward.test
      mysql-test/suite/ndb/t/ndb_restore_compat_endianness.test
      mysql-test/suite/ndb/t/ndb_restore_misc.test
      mysql-test/suite/ndb/t/ndb_restore_undolog.test
      mysql-test/suite/ndb_binlog/t/ndb_binlog_restore.test
      storage/ndb/CMakeLists.txt
      storage/ndb/include/CMakeLists.txt
      storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
      storage/ndb/include/ndbapi/NdbReceiver.hpp
      storage/ndb/src/common/portlib/CMakeLists.txt
      storage/ndb/src/common/portlib/Makefile.am
      storage/ndb/src/common/portlib/NdbTCP.cpp
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
      storage/ndb/src/ndbapi/NdbOperationExec.cpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/src/ndbapi/NdbReceiver.cpp
      storage/ndb/src/ndbapi/NdbScanOperation.cpp
      storage/ndb/src/ndbapi/ndberror.c
      storage/ndb/test/ndbapi/testBasic.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/common/portlib/NdbTCP.cpp'
--- a/storage/ndb/src/common/portlib/NdbTCP.cpp	2011-05-11 12:23:24 +0000
+++ b/storage/ndb/src/common/portlib/NdbTCP.cpp	2011-05-11 19:12:56 +0000
@@ -52,7 +52,7 @@ CHECK(const char* address, int expected_
 {
   struct in_addr addr;
 
-  fprintf(stderr, "Checking '%s'\n", address);
+  fprintf(stderr, "Testing '%s'\n", address);
 
   int res= Ndb_getInAddr(&addr, address);
 
@@ -72,12 +72,12 @@ CHECK(const char* address, int expected_
     none.s_addr = INADDR_NONE;
     if (memcmp(&addr, &none, sizeof(none)) != 0)
     {
-      fprintf(stderr, "> didn't reurn INADDR_NONE after failure, "
+      fprintf(stderr, "> didn't return INADDR_NONE after failure, "
              "got: '%s', expected; '%s'\n",
              inet_ntoa(addr), inet_ntoa(none));
       abort();
     }
-    fprintf(stderr, "> got INADDR_NONE\n");
+    fprintf(stderr, "> ok\n");
     return;
   }
 
@@ -95,7 +95,7 @@ CHECK(const char* address, int expected_
     if (memcmp(&addr, &addr2, sizeof(struct in_addr)) != 0)
     {
       fprintf(stderr, "> numeric address '%s' didn't map to same value as "
-             "inet_addr: '%s'", inet_ntoa(addr2));
+              "inet_addr: '%s'", address, inet_ntoa(addr2));
       abort();
     }
     fprintf(stderr, "> ok\n");
@@ -140,16 +140,53 @@ socket_library_end()
 #endif
 }
 
+static bool
+can_resolve_hostname(const char* name)
+{
+  fprintf(stderr, "Checking if '%s' can be used for testing\n", name);
+  struct addrinfo hints;
+  memset(&hints, 0, sizeof(hints));
+  hints.ai_family = AF_INET; // Only IPv4 address
+  hints.ai_socktype = SOCK_STREAM;
+  hints.ai_protocol = IPPROTO_TCP;
+
+  struct addrinfo* ai_list;
+  int err = getaddrinfo(name, NULL, &hints, &ai_list);
+
+  if (err)
+  {
+    fprintf(stderr, "> '%s' -> error: %d '%s'\n",
+             name, err, gai_strerror(err));
+
+    if (err == EAI_NODATA ||
+	err == EAI_NONAME)
+    {
+      // An OK error 
+      fprintf(stderr, ">  skipping tests with this name...\n");
+      return false;
+    }
+
+    // Another unhandled error
+    abort();
+  }
+
+  freeaddrinfo(ai_list);
+
+  return true;
+}
+
 
 TAPTEST(NdbGetInAddr)
 {
   socket_library_init();
 
-  CHECK("localhost", 0);
+  if (can_resolve_hostname("localhost"))
+    CHECK("localhost", 0);
   CHECK("127.0.0.1", 0, true);
 
   char hostname_buf[256];
-  if (gethostname(hostname_buf, sizeof(hostname_buf)) == 0)
+  if (gethostname(hostname_buf, sizeof(hostname_buf)) == 0 &&
+      can_resolve_hostname(hostname_buf))
   {
     // Check this machines hostname
     CHECK(hostname_buf, 0);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch(ole.john.aske:3493 to 3494) Ole John Aske12 May