List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:April 4 2011 7:19am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4275)
View as plain text  
#At file:///home/msvensson/mysql/tmp/9hNGPGxX7Y/mysql-5.1-telco-7.0/ based on revid:jonas@stripped-tczrogulr2knkz2y

 4275 Magnus Blåudd	2011-04-04 [merge]
      Merge

    added:
      storage/ndb/include/util/ndb_base64.h
    modified:
      storage/ndb/CMakeLists.txt
      storage/ndb/src/common/util/ndb_opts.c
      storage/ndb/src/mgmapi/mgmapi.cpp
      storage/ndb/src/mgmsrv/Config.cpp
      storage/ndb/src/mgmsrv/Services.cpp
=== modified file 'storage/ndb/CMakeLists.txt'
--- a/storage/ndb/CMakeLists.txt	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/CMakeLists.txt	2011-03-28 08:11:37 +0000
@@ -18,6 +18,20 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
     ${CMAKE_SOURCE_DIR}/cmake
     ${CMAKE_SOURCE_DIR}/storage/ndb/cmake)
 
+# Temporarily remove -Werror from compiler flags until
+# storage/ndb/ can be built with it
+STRING(REPLACE "-Werror" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+STRING(REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+IF (MYSQL_VERSION_ID LESS 50500)
+  # Use same compiler defines as MySQL Server for debug compile
+  MESSAGE(STATUS "Setting same debug compile defines")
+  SET(CMAKE_CXX_FLAGS_DEBUG
+      "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+  SET(CMAKE_C_FLAGS_DEBUG
+      "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
+ENDIF()
+
 IF(SOURCE_SUBLIBS)
   # Sourced by libmysqld/CMakeLists.txt in 5.1 only to get
   # NDBCLUSTER_SOURCES and NDBCLUSTER_LIBS, don't configure
@@ -50,39 +64,30 @@ ELSE()
   # The root of storage/ndb/
   SET(NDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 
-ENDIF()
+  OPTION(WITH_NDB_TEST
+    "Include the NDB Cluster ndbapi test programs" OFF)
+  IF(WITH_NDB_TEST)
+    MESSAGE(STATUS "Building NDB test programs")
+  ENDIF()
 
-OPTION(WITH_NDB_TEST
-  "Include the NDB Cluster ndbapi test programs" OFF)
-IF(WITH_NDB_TEST)
-  MESSAGE(STATUS "Building NDB test programs")
-ENDIF()
+  OPTION(WITH_NDB_BINLOG
+    "Disable NDB binlog" ON)
 
-OPTION(WITH_NDB_BINLOG
-  "Disable NDB binlog" ON)
+  OPTION(WITH_ERROR_INSERT
+    "Enable error injection in MySQL Cluster" OFF)
 
-# Use same compiler defines as MySQL Server for debug compile
-SET(CMAKE_CXX_FLAGS_DEBUG
-    "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG
-    "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
-OPTION(WITH_ERROR_INSERT
-  "Enable error injection in MySQL Cluster" OFF)
-
-OPTION(WITH_NDB_DEBUG
-  "Disable special ndb debug features" OFF)
-IF(WITH_NDB_DEBUG)
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -DVM_TRACE -DNDB_DEBUG -DERROR_INSERT -DARRAY_GUARD -DACC_SAFE_QUEUE")
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEBUG} -DVM_TRACE -DNDB_DEBUG -DERROR_INSERT -DARRAY_GUARD -DACC_SAFE_QUEUE")
-ELSE()
-  IF(WITH_ERROR_INSERT)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DERROR_INSERT")
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DERROR_INSERT")
+  OPTION(WITH_NDB_DEBUG
+    "Disable special ndb debug features" OFF)
+  IF(WITH_NDB_DEBUG)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -DVM_TRACE -DNDB_DEBUG -DERROR_INSERT -DARRAY_GUARD -DACC_SAFE_QUEUE")
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_DEBUG} -DVM_TRACE -DNDB_DEBUG -DERROR_INSERT -DARRAY_GUARD -DACC_SAFE_QUEUE")
+  ELSE()
+    IF(WITH_ERROR_INSERT)
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DERROR_INSERT")
+      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DERROR_INSERT")
+    ENDIF()
   ENDIF()
-ENDIF()
 
-IF(NOT SOURCE_SUBLIBS)
   ADD_SUBDIRECTORY(include)
   ADD_SUBDIRECTORY(src)
   ADD_SUBDIRECTORY(tools)

=== added file 'storage/ndb/include/util/ndb_base64.h'
--- a/storage/ndb/include/util/ndb_base64.h	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/include/util/ndb_base64.h	2011-03-28 09:01:03 +0000
@@ -0,0 +1,51 @@
+/*
+   Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+*/
+#ifndef NDB_BASE64_H
+#define NDB_BASE64_H
+
+/*
+  Interface created to be able to use base64 functions
+  using function signatures which does not change between
+  MySQL version
+*/
+
+#include <base64.h>
+#include <mysql_version.h>
+
+/*
+  Decode a base64 string into data
+*/
+static inline
+int ndb_base64_decode(const char *src, size_t src_len,
+                      void *dst, const char **end_ptr)
+{
+#ifndef MYSQL_VERSION_ID
+#error "Need MYSQL_VERSION_ID defined"
+#endif
+
+  return base64_decode(src, src_len, dst, end_ptr
+#if MYSQL_VERSION_ID >= 50603
+  // Signature of base64_decode changed to be extended
+  // with a "flags" argument in 5.6.3, no flags needed for
+  // vanilla base64_decode so ignore it in this impl.
+                       , 0);
+#else
+                       );
+#endif
+}
+
+#endif

=== modified file 'storage/ndb/src/common/util/ndb_opts.c'
--- a/storage/ndb/src/common/util/ndb_opts.c	2011-01-30 23:13:49 +0000
+++ b/storage/ndb/src/common/util/ndb_opts.c	2011-03-28 08:41:48 +0000
@@ -121,12 +121,12 @@ my_bool ndb_is_load_default_arg_separato
 #error "Need MYSQL_VERSION_ID defined"
 #endif
 
-#if MYSQL_VERSION_ID >= 50501
+#if MYSQL_VERSION_ID >= 50510
   /*
     load_default() in 5.5+ returns an extra arg which has to
     be skipped when processing the argv array
    */
-  if (arg == args_separator)
+  if (my_getopt_is_args_separator(arg))
     return TRUE;
 #else
   (void)arg;

=== modified file 'storage/ndb/src/mgmapi/mgmapi.cpp'
--- a/storage/ndb/src/mgmapi/mgmapi.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/mgmapi/mgmapi.cpp	2011-03-28 09:01:03 +0000
@@ -35,7 +35,7 @@
 #include <OutputStream.hpp>
 #include <InputStream.hpp>
 
-#include <base64.h>
+#include <ndb_base64.h>
 
 //#define MGMAPI_LOG
 #define MGM_CMD(name, fun, desc) \
@@ -2549,7 +2549,7 @@ ndb_mgm_get_configuration2(NdbMgmHandle
       break;
 
     void *tmp_data = malloc(base64_needed_decoded_length((size_t) (len - 1)));
-    const int res = base64_decode(buf64, len-1, tmp_data, NULL);
+    const int res = ndb_base64_decode(buf64, len-1, tmp_data, NULL);
     delete[] buf64;
     UtilBuffer tmp;
     tmp.append((void *) tmp_data, res);

=== modified file 'storage/ndb/src/mgmsrv/Config.cpp'
--- a/storage/ndb/src/mgmsrv/Config.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/mgmsrv/Config.cpp	2011-03-28 09:01:03 +0000
@@ -232,7 +232,7 @@ Config::pack(UtilBuffer& buf) const
 }
 
 
-#include <base64.h>
+#include <ndb_base64.h>
 
 bool
 Config::pack64(BaseString& encoded) const

=== modified file 'storage/ndb/src/mgmsrv/Services.cpp'
--- a/storage/ndb/src/mgmsrv/Services.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/mgmsrv/Services.cpp	2011-03-28 09:01:03 +0000
@@ -34,7 +34,7 @@
 
 #include "ndb_mgmd_error.h"
 
-#include <base64.h>
+#include <ndb_base64.h>
 #include <ndberror.h>
 
 extern bool g_StopServer;
@@ -2098,7 +2098,7 @@ void MgmApiSession::setConfig(Parser_t::
     } while(start < len64);
 
     char* decoded = new char[base64_needed_decoded_length((size_t)len64 - 1)];
-    int decoded_len= base64_decode(buf64, len64-1, decoded, NULL);
+    int decoded_len= ndb_base64_decode(buf64, len64-1, decoded, NULL);
     delete[] buf64;
 
     ConfigValuesFactory cvf;

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4275) Magnus Blåudd4 Apr