Merge trunk
authorBrian Aker <brian@tangent.org>
Thu, 3 Nov 2011 02:39:51 +0000 (19:39 -0700)
committerBrian Aker <brian@tangent.org>
Thu, 3 Nov 2011 02:39:51 +0000 (19:39 -0700)
13 files changed:
ChangeLog
libmemcached/get.cc
libmemcached/memcached.cc
m4/enable_utillib.m4 [deleted file]
m4/pandora_have_libdrizzle.m4 [deleted file]
m4/pandora_have_libmysqlclient.m4 [deleted file]
m4/pandora_have_libpq.m4 [deleted file]
m4/pandora_have_libpqxx.m4 [deleted file]
m4/pandora_have_libsqlite3.m4 [deleted file]
m4/pandora_plugins.m4 [deleted file]
m4/pandora_python3_devel.m4 [deleted file]
m4/pandora_with_python.m4 [deleted file]
tests/mem_functions.cc

index cfa355bd817396baf33e75d2e5de481f0f89548b..e61d72806695989ff51fe2086def87ca6ff880c0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+1.0.3
+* Change default distribution to be consistent
+
 1.0.2 Mon Oct 24 08:00:48 PDT 2011
 * Dropped libmemcached/memcached_util.h (undocumented header file)
 * Added memcached_touch() and memcached_touch_by_key()
index a78d73efecc2ef07d985795c6700ec09001ac3e4..6dfb7a79a271409902f88947e9d0cb870da5bc01 100644 (file)
@@ -418,7 +418,9 @@ memcached_return_t memcached_mget_execute_by_key(memcached_st *ptr,
                                                  unsigned int number_of_callbacks)
 {
   if ((ptr->flags.binary_protocol) == 0)
+  {
     return MEMCACHED_NOT_SUPPORTED;
+  }
 
   memcached_return_t rc;
   memcached_callback_st *original_callbacks= ptr->callbacks;
index 163658efc62f1d03308368bbebc2573433030a6b..3201c99c3e61be286b17f676b779aef51c7c27a1 100644 (file)
@@ -87,7 +87,7 @@ static inline bool _memcached_init(memcached_st *self)
 
   self->virtual_bucket= NULL;
 
-  self->distribution= MEMCACHED_DISTRIBUTION_MODULA;
+  self->distribution= MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY;
 
   if (hashkit_create(&self->hashkit) == NULL)
   {
@@ -233,7 +233,6 @@ memcached_st *memcached(const char *string, size_t length)
   memcached_st *self= memcached_create(NULL);
   if (self == NULL)
   {
-    errno= ENOMEM;
     return NULL;
   }
 
@@ -251,7 +250,6 @@ memcached_st *memcached(const char *string, size_t length)
   if (memcached_failed(rc))
   {
     memcached_free(self);
-    errno= EINVAL;
     return NULL;
   }
 
diff --git a/m4/enable_utillib.m4 b/m4/enable_utillib.m4
deleted file mode 100644 (file)
index e9730f1..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-AC_DEFUN([ENABLE_UTILLIB],[
-  AC_ARG_ENABLE([utils],
-    [AS_HELP_STRING([--disable-utils],
-       [Disable libmemcachedutils @<:@default=on@:>@])],
-    [BUILD_UTILLIB="$enableval"],
-    [BUILD_UTILLIB="yes"])
-
-  if test "x$BUILD_UTILLIB" = "xyes"; then
-    if test x"$ax_pthread_ok" != "xyes"; then
-      AC_MSG_ERROR([Sorry you need POSIX thread library to build libmemcachedutil.])
-    fi
-    AC_DEFINE([HAVE_LIBMEMCACHEDUTIL], [1], [Enables libmemcachedutil Support])
-  fi
-
-  AM_CONDITIONAL([BUILD_LIBMEMCACHEDUTIL],[test "x$BUILD_UTILLIB" = "xyes"])
-])
diff --git a/m4/pandora_have_libdrizzle.m4 b/m4/pandora_have_libdrizzle.m4
deleted file mode 100644 (file)
index bdd4b6a..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([_PANDORA_SEARCH_LIBDRIZZLE],[
-  AC_REQUIRE([AC_LIB_PREFIX])
-
-  dnl --------------------------------------------------------------------
-  dnl  Check for libdrizzle
-  dnl --------------------------------------------------------------------
-
-  AC_ARG_ENABLE([libdrizzle],
-    [AS_HELP_STRING([--disable-libdrizzle],
-      [Build with libdrizzle support @<:@default=on@:>@])],
-    [ac_enable_libdrizzle="$enableval"],
-    [ac_enable_libdrizzle="yes"])
-
-  AS_IF([test "x$ac_enable_libdrizzle" = "xyes"],[
-    AC_LIB_HAVE_LINKFLAGS(drizzle,,[
-      #include <libdrizzle/drizzle_client.h>
-    ],[
-      drizzle_st drizzle;
-      drizzle_version();
-    ])
-  ],[
-    ac_cv_libdrizzle="no"
-  ])
-  
-  AM_CONDITIONAL(HAVE_LIBDRIZZLE, [test "x${ac_cv_libdrizzle}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBDRIZZLE],[
-  AC_REQUIRE([_PANDORA_SEARCH_LIBDRIZZLE])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBDRIZZLE],[
-  AC_REQUIRE([PANDORA_HAVE_LIBDRIZZLE])
-  AS_IF([test "x${ac_cv_libdrizzle}" = "xno"],[
-    AC_MSG_ERROR([libdrizzle is required for ${PACKAGE}])
-  ],[
-    dnl We need at least 0.8 on Solaris non-sparc
-    AS_IF([test "$target_cpu" != "sparc" -a "x${TARGET_SOLARIS}" = "xtrue"],[
-      PANDORA_LIBDRIZZLE_RECENT
-    ])
-  ])
-])
-
-AC_DEFUN([PANDORA_LIBDRIZZLE_RECENT],[
-  AC_CACHE_CHECK([if libdrizzle is recent enough],
-    [pandora_cv_libdrizzle_recent],
-    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <libdrizzle/drizzle.h>
-drizzle_con_options_t foo= DRIZZLE_CON_EXPERIMENTAL;
-    ]])],
-    [pandora_cv_libdrizzle_recent=yes],
-    [pandora_cv_libdrizzle_recent=no])])
-  AS_IF([test "$pandora_cv_libdrizzle_recent" = "no"],[
-    AC_MSG_ERROR([Your version of libdrizzle is too old. ${PACKAGE} requires at least version 0.8])
-  ])
-])
diff --git a/m4/pandora_have_libmysqlclient.m4 b/m4/pandora_have_libmysqlclient.m4
deleted file mode 100644 (file)
index 63a1e2d..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
-dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
-dnl
-dnl  Copyright (C) 2010 Monty Taylor
-dnl  This file is free software; Sun Microsystems
-dnl  gives unlimited permission to copy and/or distribute it,
-dnl  with or without modifications, as long as this notice is preserved.
-dnl
-
-AC_DEFUN([PANDORA_WITH_MYSQL],[
-  AC_ARG_WITH([mysql],
-    [AS_HELP_STRING([--with-mysql=PATH],
-        [path to mysql_config binary or mysql prefix dir])], 
-      [with_mysql=$withval],
-      [with_mysql=":"])
-
-  dnl There are three possibilities:
-  dnl   1) nothing is given: we will search for mysql_config in PATH
-  dnl   2) the location of mysql_config is given: we'll use that to determine
-  dnl   3) a directory argument is given: that will be mysql_base
-
-     
-  dnl option 1: nothing, we need to insert something into MYSQL_CONFIG
-  AS_IF([test "x$with_mysql" = "x:"],[
-    AC_CHECK_PROGS(MYSQL_CONFIG,[mysql_config])
-  ],[
-    MYSQL_CONFIG="${with_mysql}"
-  ])
-
-  AC_CACHE_CHECK([for MySQL Base Location],[pandora_cv_mysql_base],[
-
-    dnl option 2: something in MYSQL_CONFIG now, use that to get a base dir
-    AS_IF([test -f "${MYSQL_CONFIG}" -a -x "${MYSQL_CONFIG}"],[
-      pandora_cv_mysql_base=$(dirname $(MYSQL_CONFIG --include | sed 's/-I//'))
-    ],[
-      dnl option 1: a directory
-      AS_IF([test -d $with_mysql],[pandora_cv_mysql_base=$with_mysql],[
-        pandora_cv_mysql_base="not found"
-      ])
-    ])
-  ])
-])
-
-AC_DEFUN([_PANDORA_SEARCH_LIBMYSQLCLIENT],[
-  AC_REQUIRE([AC_LIB_PREFIX])
-
-  AC_ARG_ENABLE([libmysqlclient],
-    [AS_HELP_STRING([--disable-libmysqlclient],
-      [Build with libmysqlclient support @<:@default=on@:>@])],
-    [ac_enable_libmysqlclient="$enableval"],
-    [ac_enable_libmysqlclient="yes"])
-
-  AS_IF([test "x$ac_enable_libmysqlclient" = "xyes"],[
-    AC_LIB_HAVE_LINKFLAGS(mysqlclient_r,,[
-#include <mysql/mysql.h>
-    ],[
-MYSQL mysql;
-  ])],[
-    ac_cv_libmysqlclient_r="no"
-  ])
-
-  AM_CONDITIONAL(HAVE_LIBMYSQLCLIENT, [test "x${ac_cv_libmysqlclient_r}" = "xyes"])
-  
-AC_DEFUN([PANDORA_HAVE_LIBMYSQLCLIENT],[
-  AC_REQUIRE([_PANDORA_SEARCH_LIBMYSQLCLIENT])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBMYSQLCLIENT],[
-  AC_REQUIRE([PANDORA_HAVE_LIBMYSQLCLIENT])
-  AS_IF([test "x${ac_cv_libmysqlclient_r}" = "xno"],
-      AC_MSG_ERROR([libmysqlclient_r is required for ${PACKAGE}]))
-])
-
-  AS_IF([test "x$MYSQL_CONFIG" = "xISDIR"],[
-    IBASE="-I${with_mysql}"
-    MYSQL_CONFIG="${with_mysql}/scripts/mysql_config"
-    ADDIFLAGS="$IBASE/include "
-    ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/include/ndbapi "
-    ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/include/mgmapi "
-    ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/include "
-    LDFLAGS="-L${with_mysql}/storage/ndb/src/.libs -L${with_mysql}/libmysql_r/.libs/ -L${with_mysql}/mysys/.libs -L${with_mysql}/mysys -L${with_mysql}/strings/.libs -L${with_mysql}/strings "
-  ],[
-    IBASE=`$MYSQL_CONFIG --include`
-    ADDIFLAGS=""
-    # add regular MySQL C flags
-    ADDCFLAGS=`$MYSQL_CONFIG --cflags` 
-    # add NdbAPI specific C flags
-    LDFLAGS="$LDFLAGS "`$MYSQL_CONFIG --libs_r | sed 's/-lmysqlclient_r//'`
-    ])
-
-
-    ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb"
-    ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/ndbapi"
-    ADDIFLAGS="$ADDIFLAGS $IBASE/storage/ndb/mgmapi"
-    ADDIFLAGS="$ADDIFLAGS $IBASE/ndb"
-    ADDIFLAGS="$ADDIFLAGS $IBASE/ndb/ndbapi"
-    ADDIFLAGS="$ADDIFLAGS $IBASE/ndb/mgmapi"
-    ADDIFLAGS="$ADDIFLAGS $IBASE"
-
-    CFLAGS="$CFLAGS $ADDCFLAGS $ADDIFLAGS"    
-    CXXFLAGS="$CXXFLAGS $ADDCFLAGS $ADDIFLAGS" 
-    MYSQL_INCLUDES="$IBASE $ADDIFLAGS"   
-
-    
-    dnl AC_CHECK_LIB([mysqlclient_r],[safe_mutex_init],,[AC_MSG_ERROR([Can't link against libmysqlclient_r])])
-    dnl First test to see if we can run with only ndbclient
-    AC_CHECK_LIB([ndbclient],[decimal_bin_size],,[dnl else
-      LDFLAGS="$LDFLAGS -lmysys -ldbug"
-      AC_CHECK_LIB([mysqlclient_r],[safe_mutex_init],,)
-      AC_CHECK_LIB([ndbclient],[ndb_init],,[
-        AC_MSG_ERROR([Can't link against libndbclient])])
-      AC_CHECK_LIB([mystrings],[decimal_bin_size],,[
-          AC_MSG_ERROR([Can't find decimal_bin_size])])])
-    AC_MSG_CHECKING(for NdbApi headers)
-     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <NdbApi.hpp>]], [[int attr=NdbTransaction::Commit; ]])],[ndbapi_found="yes"],[])
-    AS_IF([test "$ndbapi_found" = "yes"], 
-       [AC_MSG_RESULT(found)],
-       [AC_MSG_ERROR([Couldn't find NdbApi.hpp!])])
-    AC_MSG_CHECKING(for NDB_LE_ThreadConfigLoop)
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <mgmapi.h>]], [[int attr=NDB_LE_ThreadConfigLoop; ]])],[have_cge63="yes"],[])
-      AS_IF([test "$have_cge63" = "yes"],
-        [AC_MSG_RESULT(found)
-         HAVE_CGE63="-DCGE63"
-         AC_SUBST(HAVE_CGE63)],
-        [AC_MSG_RESULT(missing)])
-
-    LDFLAGS="$LDFLAGS $LIBS"
-  
-
-    MYSQL_MAJOR_VERSION=`$MYSQL_CONFIG --version | sed -e 's/\.//g' -e 's/-//g' -e 's/[A-Za-z]//g' | cut -c1-2`
-
-    case "$MYSQL_MAJOR_VERSION" in 
-      50) AC_DEFINE(MYSQL_50, [1], [mysql5.0])
-       ;;
-      51) AC_DEFINE(MYSQL_51, [1], [mysql5.1])
-        ;;
-      *) echo "Unsupported version of MySQL Detected!"
-        ;;
-     esac
-    
-    AC_SUBST(MYSQL_MAJOR_VERSION)
-    AC_SUBST(MYSQL_CONFIG)
-    
-  
-])
-
diff --git a/m4/pandora_have_libpq.m4 b/m4/pandora_have_libpq.m4
deleted file mode 100644 (file)
index 28675d1..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([_PANDORA_SEARCH_LIBPQ],[
-  AC_REQUIRE([AC_LIB_PREFIX])
-
-  dnl --------------------------------------------------------------------
-  dnl  Check for libpq
-  dnl --------------------------------------------------------------------
-
-  AC_ARG_ENABLE([libpq],
-    [AS_HELP_STRING([--disable-libpq],
-      [Build with libpq support @<:@default=on@:>@])],
-    [ac_enable_libpq="$enableval"],
-    [ac_enable_libpq="yes"])
-
-  AS_IF([test "x$ac_enable_libpq" = "xyes"],[
-    AC_CHECK_HEADERS([libpq-fe.h])
-    AC_LIB_HAVE_LINKFLAGS(pq,,[
-      #ifdef HAVE_LIBPQ_FE_H
-      # include <libpq-fe.h>
-      #else
-      # include <postgresql/libpq-fe.h>
-      #endif
-    ], [
-      PGconn *conn;
-      conn = PQconnectdb(NULL);
-    ])
-  ],[
-    ac_cv_libpq="no"
-  ])
-  
-  AM_CONDITIONAL(HAVE_LIBPQ, [test "x${ac_cv_libpq}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBPQ],[
-  AC_REQUIRE([_PANDORA_SEARCH_LIBPQ])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBPQ],[
-  AC_REQUIRE([PANDORA_HAVE_LIBPQ])
-  AS_IF([test "x${ac_cv_libpq}" = "xno"],
-    AC_MSG_ERROR([libpq is required for ${PACKAGE}]))
-])
diff --git a/m4/pandora_have_libpqxx.m4 b/m4/pandora_have_libpqxx.m4
deleted file mode 100644 (file)
index 30b9436..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-dnl  Copyright (C) 2010 Padraig O'Sullivan
-dnl This file is free software; 
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([_PANDORA_SEARCH_LIBPQXX],[
-  AC_REQUIRE([AC_LIB_PREFIX])
-
-  dnl --------------------------------------------------------------------
-  dnl  Check for libpqxx
-  dnl --------------------------------------------------------------------
-
-  AC_ARG_ENABLE([libpqxx],
-    [AS_HELP_STRING([--disable-libpqxx],
-      [Build with libpqxx support @<:@default=on@:>@])],
-    [ac_enable_libpqxx="$enableval"],
-    [ac_enable_libpqxx="yes"])
-
-  AS_IF([test "x$ac_enable_libpqxx" = "xyes"],[
-    AC_LANG_PUSH([C++])
-    AC_LIB_HAVE_LINKFLAGS(pqxx,,[
-      #include <pqxx/pqxx>
-    ],[
-       pqxx::connection conn("dbname=test");
-    ])
-    AC_LANG_POP()
-  ],[
-    ac_cv_libpqxx="no"
-  ])
-  
-  AM_CONDITIONAL(HAVE_LIBPQXX, [test "x${ac_cv_libpqxx}" = "xyes"])
-  
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBPQXX],[
-  AC_REQUIRE([_PANDORA_SEARCH_LIBPQXX])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBPQXX],[
-  AC_REQUIRE([PANDORA_HAVE_LIBPQXX])
-  AS_IF([test "x$ac_cv_libpqxx" = "xno"],[
-      AC_MSG_ERROR([libpqxx is required for ${PACKAGE}])
-  ])
-])
diff --git a/m4/pandora_have_libsqlite3.m4 b/m4/pandora_have_libsqlite3.m4
deleted file mode 100644 (file)
index c112033..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([_PANDORA_SEARCH_LIBSQLITE3],[
-  AC_REQUIRE([AC_LIB_PREFIX])
-
-  dnl --------------------------------------------------------------------
-  dnl  Check for libsqlite3
-  dnl --------------------------------------------------------------------
-
-  AC_ARG_ENABLE([libsqlite3],
-    [AS_HELP_STRING([--disable-libsqlite3],
-      [Build with libsqlite3 support @<:@default=on@:>@])],
-    [ac_enable_libsqlite3="$enableval"],
-    [ac_enable_libsqlite3="yes"])
-
-  AS_IF([test "x$ac_enable_libsqlite3" = "xyes"],[
-    AC_LIB_HAVE_LINKFLAGS(sqlite3,,[
-      #include <stdio.h>
-      #include <sqlite3.h>
-    ],[
-      sqlite3 *db;
-      sqlite3_open(NULL, &db);
-    ])
-  ],[
-    ac_cv_libsqlite3="no"
-  ])
-
-  AM_CONDITIONAL(HAVE_LIBSQLITE3, [test "x${ac_cv_libsqlite3}" = "xyes"])
-])
-
-AC_DEFUN([PANDORA_HAVE_LIBSQLITE3],[
-  AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
-])
-
-AC_DEFUN([PANDORA_REQUIRE_LIBSQLITE3],[
-  AC_REQUIRE([_PANDORA_SEARCH_LIBSQLITE3])
-  AS_IF([test "x${ac_cv_libsqlite3}" = "xno"],
-    AC_MSG_ERROR([libsqlite3 is required for ${PACKAGE}]))
-])
diff --git a/m4/pandora_plugins.m4 b/m4/pandora_plugins.m4
deleted file mode 100644 (file)
index 540443b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-dnl  Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems, Inc.
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl--------------------------------------------------------------------
-dnl PANDORA_PLUGINS
-dnl Declare our plugin modules
-dnl--------------------------------------------------------------------
-
-AC_DEFUN([PANDORA_PLUGINS],[
-
-  dnl We do this to prime the files from a fresh checkout. Normally we want
-  dnl these commands to be executed by make. Perhaps we should split them into
-  dnl a few shell script snippets in config and make Make call them... we're
-  dnl going to get there...
-  dnl ANYWAY - syscmd gets called during aclocal - so before automake. It will
-  dnl get called probably during autoconf too, so it's important to protect
-  dnl with test -f ... if the files exist, we don't have the chicken/egg 
-  dnl problem and therefore don't need to do anything here
-  m4_syscmd([PYTHON=${PYTHON:-python} && $PYTHON config/pandora-plugin > /dev/null])
-  m4_syscmd([test -f config/plugin.stamp || touch config/plugin.stamp aclocal.m4])
-
-  m4_sinclude(config/pandora-plugin.ac)
-
-  dnl Add code here to read set plugin lists and  set drizzled_default_plugin_list
-  pandora_builtin_list=`echo $pandora_builtin_list | sed 's/, *$//'`
-  pandora_builtin_symbols_list=`echo $pandora_builtin_symbols_list | sed 's/, *$//'`
-  pandora_builtin_load_list=`echo $pandora_builtin_load_list | sed 's/, *$//'`
-  pandora_builtin_load_symbols_list=`echo $pandora_builtin_load_symbols_list | sed 's/, *$//'`
-  AS_IF([test "x$pandora_builtin_symbols_list" = "x"], pandora_builtin_symbols_list="NULL")
-  AS_IF([test "x$pandora_builtin_load_symbols_list" = "x"], pandora_builtin_load_symbols_list="NULL")
-  AC_SUBST([PANDORA_BUILTIN_LIST],[$pandora_builtin_list])
-  AC_SUBST([PANDORA_BUILTIN_SYMBOLS_LIST],[$pandora_builtin_symbols_list])
-  AC_SUBST([PANDORA_BUILTIN_LOAD_LIST],[$pandora_builtin_load_list])
-  AC_SUBST([PANDORA_BUILTIN_LOAD_SYMBOLS_LIST],[$pandora_builtin_load_symbols_list])
-  AC_SUBST([PANDORA_PLUGIN_LIST],[$pandora_default_plugin_list])
-  m4_ifval(m4_normalize([$1]),[
-    AC_CONFIG_FILES($*)
-    ],[
-    AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_LIST],["$pandora_builtin_list"],
-                       [List of plugins to be built in])
-    AC_DEFINE_UNQUOTED([PANDORA_BUILTIN_SYMBOLS_LIST],["$pandora_builtin_symbols_list"],
-                       [List of builtin plugin symbols to be built in])
-    AC_DEFINE_UNQUOTED([PANDORA_PLUGIN_LIST],["$pandora_default_plugin_list"],
-                       [List of plugins that should be loaded on startup if no
-                        value is given for --plugin-load])
-  ])
-
-
-  AC_SUBST(pandora_plugin_test_list)
-  AC_SUBST(pandora_plugin_libs)
-
-  pandora_plugin_defs=`echo $pandora_plugin_defs | sed 's/, *$//'`
-  AC_SUBST(pandora_plugin_defs)
-
-  AC_SUBST(PANDORA_PLUGIN_DEP_LIBS)
-  AC_SUBST(pkgplugindir,"\$(pkglibdir)")
-])
-
-AC_DEFUN([PANDORA_ADD_PLUGIN_DEP_LIB],[
-  PANDORA_PLUGIN_DEP_LIBS="${PANDORA_PLUGIN_DEP_LIBS} $*"
-])
diff --git a/m4/pandora_python3_devel.m4 b/m4/pandora_python3_devel.m4
deleted file mode 100644 (file)
index 53a5ffd..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
-dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
-dnl   
-dnl pandora-build: A pedantic build system
-dnl
-dnl   Copyright (C) 2009 Sun Microsystems, Inc.
-dnl   Copyright (C) 2008 Sebastian Huber <sebastian-huber@web.de>
-dnl   Copyright (C) 2008 Alan W. Irwin <irwin@beluga.phys.uvic.ca>
-dnl   Copyright (C) 2008 Rafael Laboissiere <rafael@laboissiere.net>
-dnl   Copyright (C) 2008 Andrew Collier <colliera@ukzn.ac.za>
-dnl   Copyright (C) 2008 Matteo Settenvini <matteo@member.fsf.org>
-dnl   Copyright (C) 2008 Horst Knorr <hk_classes@knoda.org>
-dnl
-dnl   This program is free software: you can redistribute it and/or modify it
-dnl   under the terms of the GNU General Public License as published by the
-dnl   Free Software Foundation, either version 3 of the License, or (at your
-dnl   option) any later version.
-dnl
-dnl   This program is distributed in the hope that it will be useful, but
-dnl   WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-dnl   Public License for more details.
-dnl
-dnl   You should have received a copy of the GNU General Public License along
-dnl   with this program. If not, see <http://www.gnu.org/licenses/>.
-dnl
-dnl   As a special exception, the respective Autoconf Macro's copyright owner
-dnl   gives unlimited permission to copy, distribute and modify the configure
-dnl   scripts that are the output of Autoconf when processing the Macro. You
-dnl   need not follow the terms of the GNU General Public License when using
-dnl   or distributing such scripts, even though portions of the text of the
-dnl   Macro appear in them. The GNU General Public License (GPL) does govern
-dnl   all other use of the material that constitutes the Autoconf Macro.
-dnl
-dnl   This special exception to the GPL applies to versions of the Autoconf
-dnl   Macro released by the Autoconf Macro Archive. When you make and
-dnl   distribute a modified version of the Autoconf Macro, you may extend this
-dnl   special exception to the GPL to apply to your modified version as well.
-
-dnl SYNOPSIS
-dnl
-dnl   PANDORA_PYTHON3_DEVEL([version])
-dnl
-dnl DESCRIPTION
-dnl
-dnl   Note: Defines as a precious variable "PYTHON3_VERSION". Don't override it
-dnl   in your configure.ac.
-dnl
-dnl   This macro checks for Python and tries to get the include path to
-dnl   'Python.h'. It provides the $(PYTHON3_CPPFLAGS) and $(PYTHON3_LDFLAGS)
-dnl   output variables. It also exports $(PYTHON3_EXTRA_LIBS) and
-dnl   $(PYTHON3_EXTRA_LDFLAGS) for embedding Python in your code.
-dnl
-dnl   You can search for some particular version of Python by passing a
-dnl   parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please
-dnl   note that you *have* to pass also an operator along with the version to
-dnl   match, and pay special attention to the single quotes surrounding the
-dnl   version number. Don't use "PYTHON3_VERSION" for this: that environment
-dnl   variable is declared as precious and thus reserved for the end-user.
-dnl
-dnl LAST MODIFICATION
-dnl
-dnl   2009-08-23
-
-AC_DEFUN([PANDORA_PYTHON3_DEVEL],[
-       #
-       # Allow the use of a (user set) custom python version
-       #
-       AC_ARG_VAR([PYTHON3_VERSION],[The installed Python
-               version to use, for example '3.0'. This string
-               will be appended to the Python interpreter
-               canonical name.])
-
-
-  AS_IF([test -z "$PYTHON3"],[
-       AC_PATH_PROG([PYTHON3],[python[$PYTHON3_VERSION]])
-  ])
-       AS_IF([test -z "$PYTHON3"],[
-         AC_MSG_ERROR([Cannot find python$PYTHON3_VERSION in your system path])
-         PYTHON3_VERSION=""
-  ])
-
-       #
-       # if the macro parameter ``version'' is set, honour it
-       #
-       if test -n "$1"; then
-               AC_MSG_CHECKING([for a version of Python $1])
-               ac_supports_python3_ver=`$PYTHON3 -c "import sys, string; \
-                       ver = string.split(sys.version)[[0]]; \
-                       print(ver $1)"`
-               if test "$ac_supports_python3_ver" = "True"; then
-                  AC_MSG_RESULT([yes])
-               else
-                       AC_MSG_RESULT([no])
-                       AC_MSG_ERROR([this package requires Python $1.
-If you have it installed, but it isn't the default Python
-interpreter in your system path, please pass the PYTHON3_VERSION
-variable to configure. See ``configure --help'' for reference.
-])
-                       PYTHON_VERSION=""
-               fi
-       fi
-
-       #
-       # Check if you have distutils, else fail
-       #
-       AC_MSG_CHECKING([for Python3 distutils package])
-       ac_python3_distutils_result=`$PYTHON3 -c "import distutils" 2>&1`
-       if test -z "$ac_python3_distutils_result"; then
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-               AC_MSG_ERROR([cannot import Python3 module "distutils".
-Please check your Python3 installation. The error was:
-$ac_python3_distutils_result])
-               PYTHON3_VERSION=""
-       fi
-
-       #
-       # Check for Python include path
-       #
-       AC_MSG_CHECKING([for Python3 include path])
-       if test -z "$PYTHON3_CPPFLAGS"; then
-               python3_path=`$PYTHON3 -c "import distutils.sysconfig; \
-                       print(distutils.sysconfig.get_python_inc());"`
-               if test -n "${python3_path}"; then
-                       python3_path="-I$python3_path"
-               fi
-               PYTHON3_CPPFLAGS=$python3_path
-       fi
-       AC_MSG_RESULT([$PYTHON3_CPPFLAGS])
-       AC_SUBST([PYTHON3_CPPFLAGS])
-
-       #
-       # Check for Python library path
-       #
-       AC_MSG_CHECKING([for Python3 library path])
-       if test -z "$PYTHON3_LDFLAGS"; then
-               # (makes two attempts to ensure we've got a version number
-               # from the interpreter)
-               py3_version=`$PYTHON3 -c "from distutils.sysconfig import *; \
-                       print(' '.join(get_config_vars('VERSION')))"`
-               if test "$py3_version" == "[None]"; then
-                       if test -n "$PYTHON3_VERSION"; then
-                               py3_version=$PYTHON3_VERSION
-                       else
-                               py3_version=`$PYTHON3 -c "import sys; \
-                                       print(sys.version[[:3]])"`
-                       fi
-               fi
-
-               PYTHON3_LDFLAGS=`$PYTHON3 -c "from distutils.sysconfig import *; \
-                       print('-L' + get_python_lib(0,1), \
-                       '-lpython');"`$py3_version
-       fi
-       AC_MSG_RESULT([$PYTHON3_LDFLAGS])
-       AC_SUBST([PYTHON3_LDFLAGS])
-
-       #
-       # Check for site packages
-       #
-       AC_MSG_CHECKING([for Python3 site-packages path])
-       if test -z "$PYTHON3_SITE_PKG"; then
-               PYTHON3_SITE_PKG=`$PYTHON3 -c "import distutils.sysconfig; \
-                       print(distutils.sysconfig.get_python_lib(0,0));"`
-       fi
-       AC_MSG_RESULT([$PYTHON3_SITE_PKG])
-       AC_SUBST([PYTHON3_SITE_PKG])
-
-       #
-       # libraries which must be linked in when embedding
-       #
-       AC_MSG_CHECKING(for Python3 embedding libraries)
-       if test -z "$PYTHON3_EMBED_LIBS"; then
-          PYTHON3_EMBED_LIBS=`$PYTHON3 -c "import distutils.sysconfig; \
-                conf = distutils.sysconfig.get_config_var; \
-                print(conf('LOCALMODLIBS'), conf('LIBS'))"`
-       fi
-       AC_MSG_RESULT([$PYTHON3_EMBED_LIBS])
-       AC_SUBST(PYTHON3_EMBED_LIBS)
-
-       #
-       # linking flags needed when embedding
-       #
-       AC_MSG_CHECKING(for Python3 embedding linking flags)
-       if test -z "$PYTHON3_EMBED_LDFLAGS"; then
-               PYTHON3_EMBED_LDFLAGS=`$PYTHON3 -c "import distutils.sysconfig; \
-                       conf = distutils.sysconfig.get_config_var; \
-                       print(conf('LINKFORSHARED'))"`
-       fi
-       AC_MSG_RESULT([$PYTHON3_EMBED_LDFLAGS])
-       AC_SUBST(PYTHON3_EMBED_LDFLAGS)
-
-       #
-       # final check to see if everything compiles alright
-       #
-       AC_MSG_CHECKING([for Python3 development environment consistency])
-       AC_LANG_PUSH([C])
-       # save current global flags
-  ac_save_LIBS="$LIBS"
-  ac_save_CPPFLAGS="$CPPFLAGS"
-       LIBS="$ac_save_LIBS $PYTHON3_LDFLAGS"
-       CPPFLAGS="$ac_save_CPPFLAGS $PYTHON3_CPPFLAGS"
-       AC_TRY_LINK([
-               #include <Python.h>
-       ],[
-               Py_Initialize();
-       ],[python3exists=yes],[python3exists=no])
-
-       AC_MSG_RESULT([$python3exists])
-
-        if test ! "$python3exists" = "yes"; then
-          AC_MSG_WARN([
-  Could not link test program to Python3.
-  Maybe the main Python3 library has been installed in some non-standard
-  library path. If so, pass it to configure, via the LDFLAGS environment
-  variable.
-  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python3/lib"
-  ============================================================================
-   ERROR!
-   You probably have to install the development version of the Python3 package
-   for your distribution.  The exact name of this package varies among them.
-  ============================================================================
-          ])
-         PYTHON3_VERSION=""
-       fi
-       AC_LANG_POP
-       # turn back to default flags
-       CPPFLAGS="$ac_save_CPPFLAGS"
-       LIBS="$ac_save_LIBS"
-
-       #
-       # all done!
-       #
-])
-
diff --git a/m4/pandora_with_python.m4 b/m4/pandora_with_python.m4
deleted file mode 100644 (file)
index 5b28c8e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-dnl -*- mode: m4; c-basic-offset: 2; indent-tabs-mode: nil; -*-
-dnl vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
-dnl   
-dnl pandora-build: A pedantic build system
-dnl Copyright (C) 2009 Sun Microsystems, Inc.
-dnl This file is free software; Sun Microsystems
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl From Monty Taylor
-
-
-AC_DEFUN([PANDORA_WITH_PYTHON], [
-
-  AC_ARG_WITH([python], 
-    [AS_HELP_STRING([--with-python],
-      [Build Python Bindings @<:@default=yes@:>@])],
-    [with_python=$withval
-     python_requested=$withval
-    ], 
-    [with_python=yes
-     python_requested=no
-    ])
-
-  AS_IF([test "x$with_python" != "xno"],[
-    AS_IF([test "x$with_python" != "xyes"],[PYTHON=$with_python])
-    AM_PATH_PYTHON([2.4],,[with_python="no"])
-    AC_PYTHON_DEVEL()
-    AS_IF([test "x$pythonexists" = "xno"],[with_python="no"])
-  ])
-  AS_IF([test "x$with_python" = "xno" -a "$python_requested" = "yes"],[
-    AC_MSG_ERROR([Python support was explicity requested, but Python support
-                  was not found. Please correct your build environment and try
-                  again])
-  ])
-  AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" = "yes"])
-])
index 54cce01d265bbad784a8ec65b4a5bdd530119e79..03dc591d824973f13b020bcadf484035136e522a 100644 (file)
@@ -106,16 +106,47 @@ static size_t global_keys_length[GLOBAL_COUNT];
 */
 static test_return_t pre_binary(memcached_st *memc)
 {
-  memcached_return_t rc= MEMCACHED_FAILURE;
+  test_skip(true, libmemcached_util_version_check(memc, 1, 4, 4));
+  test_skip(MEMCACHED_SUCCESS, memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, true));
+
+  return TEST_SUCCESS;
+}
 
-  if (libmemcached_util_version_check(memc, 1, 4, 4))
+static memcached_st * create_single_instance_memcached(const memcached_st *original_memc, const char *options)
+{
+  /*
+   * I only want to hit _one_ server so I know the number of requests I'm
+   * sending in the pipeline.
+   */
+  memcached_server_instance_st instance= memcached_server_instance_by_position(original_memc, 0);
+
+  char server_string[1024];
+  int server_string_length;
+  if (options)
   {
-    rc = memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1);
-    test_compare(MEMCACHED_SUCCESS, rc);
-    test_true(memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) == 1);
+    server_string_length= snprintf(server_string, sizeof(server_string), "--server=%s:%d %s", 
+                                   memcached_server_name(instance), int(memcached_server_port(instance)),
+                                   options);
+  }
+  else
+  {
+    server_string_length= snprintf(server_string, sizeof(server_string), "--server=%s:%d",
+                                   memcached_server_name(instance), int(memcached_server_port(instance)));
   }
 
-  return rc == MEMCACHED_SUCCESS ? TEST_SUCCESS : TEST_SKIPPED;
+  if (server_string_length <= 0)
+  {
+    return NULL;
+  }
+
+  char buffer[1024];
+  if (memcached_failed(libmemcached_check_configuration(server_string, server_string_length, buffer, sizeof(buffer))))
+  {
+    Error << "Failed to parse " << server_string_length;
+    return NULL;
+  }
+
+  return memcached(server_string, server_string_length);
 }
 
 
@@ -1740,19 +1771,12 @@ static test_return_t mget_test(memcached_st *memc)
   return TEST_SUCCESS;
 }
 
-static test_return_t mget_execute(memcached_st *memc)
+static test_return_t mget_execute(memcached_st *original_memc)
 {
-  bool binary= false;
+  test_skip(true, memcached_behavior_get(original_memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL));
 
-  if (memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) != 0)
-    binary= true;
-
-  /*
-   * I only want to hit _one_ server so I know the number of requests I'm
-   * sending in the pipeline.
-   */
-  uint32_t number_of_hosts= memc->number_of_hosts;
-  memc->number_of_hosts= 1;
+  memcached_st *memc= create_single_instance_memcached(original_memc, "--BINARY-PROTOCOL");
+  test_true(memc);
 
   size_t max_keys= 20480;
 
@@ -1762,7 +1786,6 @@ static test_return_t mget_execute(memcached_st *memc)
 
   /* First add all of the items.. */
   char blob[1024] = {0};
-  memcached_return_t rc;
 
   for (size_t x= 0; x < max_keys; ++x)
   {
@@ -1772,7 +1795,7 @@ static test_return_t mget_execute(memcached_st *memc)
     keys[x]= strdup(k);
     test_true(keys[x] != NULL);
     uint64_t query_id= memcached_query_id(memc);
-    rc= memcached_add(memc, keys[x], key_length[x], blob, sizeof(blob), 0, 0);
+    memcached_return_t rc= memcached_add(memc, keys[x], key_length[x], blob, sizeof(blob), 0, 0);
     test_true_got(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED, memcached_strerror(NULL, rc));
     test_compare(query_id +1, memcached_query_id(memc));
   }
@@ -1780,12 +1803,11 @@ static test_return_t mget_execute(memcached_st *memc)
   /* Try to get all of them with a large multiget */
   size_t counter= 0;
   memcached_execute_fn callbacks[]= { &callback_counter };
-  rc= memcached_mget_execute(memc, (const char**)keys, key_length,
-                             max_keys, callbacks, &counter, 1);
+  test_compare(MEMCACHED_SUCCESS, 
+               memcached_mget_execute(memc, (const char**)keys, key_length,
+                                      max_keys, callbacks, &counter, 1));
 
-  if (memcached_success(rc))
   {
-    test_true(binary);
     uint64_t query_id= memcached_query_id(memc);
     test_compare(MEMCACHED_SUCCESS, 
                  memcached_fetch_execute(memc, callbacks, (void *)&counter, 1));
@@ -1794,14 +1816,6 @@ static test_return_t mget_execute(memcached_st *memc)
     /* Verify that we got all of the items */
     test_true(counter == max_keys);
   }
-  else if (rc == MEMCACHED_NOT_SUPPORTED)
-  {
-    test_true(counter == 0);
-  }
-  else
-  {
-    test_fail("note: this test functions differently when in binary mode");
-  }
 
   /* Release all allocated resources */
   for (size_t x= 0; x < max_keys; ++x)
@@ -1811,7 +1825,8 @@ static test_return_t mget_execute(memcached_st *memc)
   free(keys);
   free(key_length);
 
-  memc->number_of_hosts= number_of_hosts;
+  memcached_free(memc);
+
   return TEST_SUCCESS;
 }
 
@@ -4423,7 +4438,7 @@ static test_return_t memcached_get_hashkit_test (memcached_st *)
   const char **ptr;
   hashkit_st new_kit;
 
-  memcached_st *memc= memcached(test_literal_param("--server=localhost:1 --server=localhost:2 --server=localhost:3 --server=localhost:4 --server=localhost5"));
+  memcached_st *memc= memcached(test_literal_param("--server=localhost:1 --server=localhost:2 --server=localhost:3 --server=localhost:4 --server=localhost5 --DISTRIBUTION=modula"));
 
   uint32_t md5_hosts[]= {4U, 1U, 0U, 1U, 4U, 2U, 0U, 3U, 0U, 0U, 3U, 1U, 0U, 0U, 1U, 3U, 0U, 0U, 0U, 3U, 1U, 0U, 4U, 4U, 3U};
   uint32_t crc_hosts[]= {2U, 4U, 1U, 0U, 2U, 4U, 4U, 4U, 1U, 2U, 3U, 4U, 3U, 4U, 1U, 3U, 3U, 2U, 0U, 0U, 0U, 1U, 2U, 4U, 0U};
@@ -4611,9 +4626,9 @@ static test_return_t regression_bug_434484(memcached_st *memc)
   return TEST_SUCCESS;
 }
 
-static test_return_t regression_bug_434843(memcached_st *memc)
+static test_return_t regression_bug_434843(memcached_st *original_memc)
 {
-  test_skip(TEST_SUCCESS, pre_binary(memc));
+  test_skip(TEST_SUCCESS, pre_binary(original_memc));
 
   memcached_return_t rc;
   size_t counter= 0;
@@ -4625,8 +4640,8 @@ static test_return_t regression_bug_434843(memcached_st *memc)
    * 1024 (that should satisfy most users don't you think?). Future versions
    * will include a mget_execute function call if you need a higher number.
  */
-  uint32_t number_of_hosts= memcached_server_count(memc);
-  memc->number_of_hosts= 1;
+  memcached_st *memc= create_single_instance_memcached(original_memc, "--BINARY-PROTOCOL");
+
   const size_t max_keys= 1024;
   char **keys= (char**)calloc(max_keys, sizeof(char*));
   size_t *key_length= (size_t *)calloc(max_keys, sizeof(size_t));
@@ -4681,7 +4696,7 @@ static test_return_t regression_bug_434843(memcached_st *memc)
   free(keys);
   free(key_length);
 
-  memc->number_of_hosts= number_of_hosts;
+  memcached_free(memc);
 
   return TEST_SUCCESS;
 }
@@ -5192,26 +5207,23 @@ static test_return_t wrong_failure_counter_two_test(memcached_st *memc)
 /*
  * Test that ensures mget_execute does not end into recursive calls that finally fails
  */
-static test_return_t regression_bug_490486(memcached_st *memc)
+static test_return_t regression_bug_490486(memcached_st *original_memc)
 {
-  memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1);
-  memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NO_BLOCK, 1);
-  memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, 1000);
-  memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT, 1);
-  memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 3600);
 
 #ifdef __APPLE__
   return TEST_SKIPPED; // My MAC can't handle this test
 #endif
 
+  test_skip(TEST_SUCCESS, pre_binary(original_memc));
+
   /*
    * I only want to hit _one_ server so I know the number of requests I'm
    * sending in the pipeline.
  */
-  uint32_t number_of_hosts= memc->number_of_hosts;
-  memc->number_of_hosts= 1;
-  size_t max_keys= 20480;
+  memcached_st *memc= create_single_instance_memcached(original_memc, "--BINARY-PROTOCOL --POLL-TIMEOUT=1000 --REMOVE-FAILED-SERVERS=1 --RETRY-TIMEOUT=3600");
+  test_true(memc);
 
+  size_t max_keys= 20480;
 
   char **keys= (char **)calloc(max_keys, sizeof(char*));
   size_t *key_length= (size_t *)calloc(max_keys, sizeof(size_t));
@@ -5269,7 +5281,7 @@ static test_return_t regression_bug_490486(memcached_st *memc)
   free(keys);
   free(key_length);
 
-  memc->number_of_hosts= number_of_hosts;
+  memcached_free(memc);
 
   return TEST_SUCCESS;
 }