List:Commits« Previous MessageNext Message »
From:John David Duncan Date:September 23 2011 1:46am
Subject:bzr push into mysql-5.5-cluster branch (john.duncan:3534 to 3540)
View as plain text  
 3540 John David Duncan	2011-09-22
      Fix for bad free() in TableSpec destructor. 

    modified:
      storage/ndb/memcache/sandbox.sh.in
      storage/ndb/memcache/src/TableSpec.cc
 3539 John David Duncan	2011-09-22
      sanbox fix: install dir is not build dir.

    modified:
      storage/ndb/memcache/sandbox.sh.in
 3538 John David Duncan	2011-09-22
      more work on linking

    modified:
      storage/ndb/memcache/CMakeLists.txt
      storage/ndb/memcache/extra/memcached/CMakeLists.txt
      storage/ndb/memcache/src/Config_v1.cc
 3537 John David Duncan	2011-09-22
      typo

    modified:
      storage/ndb/memcache/extra/memcached/CMakeLists.txt
 3536 John David Duncan	2011-09-22
      Linking memcached_utilities: Plan B.

    modified:
      storage/ndb/memcache/extra/memcached/CMakeLists.txt
      storage/ndb/memcache/src/Config_v1.cc
 3535 John David Duncan	2011-09-22
      memcached_utilities library must be link dynamically, and must be installed.

    modified:
      storage/ndb/memcache/extra/memcached/CMakeLists.txt
 3534 John David Duncan	2011-09-22
      No virtual destructor.  (let the compiler give a warning for now)

    modified:
      storage/ndb/memcache/include/Scheduler.h
=== modified file 'storage/ndb/memcache/CMakeLists.txt'
--- a/storage/ndb/memcache/CMakeLists.txt	2011-09-22 19:01:58 +0000
+++ b/storage/ndb/memcache/CMakeLists.txt	2011-09-23 00:00:18 +0000
@@ -43,7 +43,10 @@ include_directories(AFTER ${MEMCACHED_IN
 include_directories(${NDB_SOURCE_DIR}/src/ndbapi/)
 
 # Paths to libraries
-link_directories(${NDB_SOURCE_DIR}/src ${NDB_SOURCE_DIR}/src/common/util)
+link_directories(${NDB_SOURCE_DIR}/src 
+                 ${NDB_SOURCE_DIR}/src/common/util
+                 ${CMAKE_CURRENT_SOURCE_DIR}/extra/memcached
+                )
 
 # Source files for this module 
 set(NDB_MEMCACHE_SOURCE_FILES
@@ -122,16 +125,22 @@ configure_file(${CMAKE_CURRENT_SOURCE_DI
 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/memcached_path.pl
         DESTINATION ${INSTALL_MYSQLTESTDIR}/lib)
                
+######### TARGETS ############
 # Build the module
 add_library(ndb_engine MODULE ${NDB_MEMCACHE_SOURCE_FILES})
-target_link_libraries(ndb_engine ndbclient_static ndbgeneral)
+target_link_libraries(ndb_engine ndbclient_static ndbgeneral memcached_utilities)
 
-add_dependencies(ndb_engine ndbclient_static ndbgeneral)
 # If we are using the bundled memcache, it is a dependency:
 if(WITH_MEMCACHE)
   add_dependencies(ndb_engine memcached)
 endif()
 
+# Build the library used by the unit tests
+add_library(ndbmemcache SHARED ${NDB_MEMCACHE_SOURCE_FILES})
+target_link_libraries(ndbmemcache ndbclient_static ndbgeneral memcached_utilities)
+set_target_properties(ndbmemcache PROPERTIES LINK_FLAGS "${FINAL_LINK_FLAGS}")
+
+
 # Extra linker flags because CMake's "MODULE" support is not quite right.  
 if(APPLE) 
   set(FINAL_LINK_FLAGS "-flat_namespace -undefined suppress -bind_at_load")
@@ -147,7 +156,7 @@ set_target_properties(ndb_engine PROPERT
                       PREFIX ""
                       LINK_FLAGS "${FINAL_LINK_FLAGS}")
 
-
+############ INSTALLER RULES #########
 # Install the ndb_engine.so module
 install(TARGETS ndb_engine DESTINATION ${INSTALL_LIBDIR})
 
@@ -164,10 +173,6 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR
 ######################################################## 
 
 
-# Build the library used by the unit tests
-add_library(ndbmemcache SHARED ${NDB_MEMCACHE_SOURCE_FILES})
-target_link_libraries(ndbmemcache ndbclient_static ndbgeneral ${MEMCACHED_UTILITIES_LIBRARY})
-set_target_properties(ndbmemcache PROPERTIES LINK_FLAGS "${FINAL_LINK_FLAGS}")
 
 add_subdirectory(unit)
 

=== modified file 'storage/ndb/memcache/extra/memcached/CMakeLists.txt'
--- a/storage/ndb/memcache/extra/memcached/CMakeLists.txt	2011-09-22 19:44:57 +0000
+++ b/storage/ndb/memcache/extra/memcached/CMakeLists.txt	2011-09-23 00:00:18 +0000
@@ -46,7 +46,7 @@ SET(LIBMEMCACHED_UTILITIES_SOURCES
                 utilities/genhash_int.h
                 utilities/util.c)
 
-ADD_LIBRARY(memcached_utilities SHARED ${LIBMEMCACHED_UTILITIES_SOURCES})
+ADD_CONVENIENCE_LIBRARY(memcached_utilities ${LIBMEMCACHED_UTILITIES_SOURCES})
 IF(HAVE_LIBDL)
 target_link_libraries(memcached_utilities dl)
 ENDIF()

=== modified file 'storage/ndb/memcache/sandbox.sh.in'
--- a/storage/ndb/memcache/sandbox.sh.in	2011-09-21 09:21:54 +0000
+++ b/storage/ndb/memcache/sandbox.sh.in	2011-09-23 01:44:59 +0000
@@ -7,7 +7,7 @@ libdir=@INSTALL_LIBDIR@
 scriptsdir=@INSTALL_SCRIPTDIR@
 memcachedir=@MEMCACHED_ROOT_DIR@
 sourcetree=@CMAKE_CURRENT_SOURCE_DIR@
-installtree=@CMAKE_BINARY_DIR@/memcache-api
+installtree=@CMAKE_INSTALL_PREFIX@/memcache-api
 memcached_binary=@MEMCACHED_BIN_PATH@
 
 MYSQL_PREFIX=$prefix
@@ -57,6 +57,7 @@ write_my_cnf() {
     echo "datadir=$HOME_BASE/sandbox/data"
     echo "pid-file=$HOME_BASE/sandbox/mysqld.pid"
     echo "user="`whoami`
+    echo "innodb_log_file_size=1M"
     echo
   ) > $HOME_BASE/sandbox/my.cnf
  }
@@ -91,7 +92,11 @@ write_cluster_ini() {
 do_install_db() {
   $MYSQL_SCRIPTS/mysql_install_db \
     --basedir=$MYSQL_PREFIX --datadir=$HOME_BASE/sandbox/data \
-     > /dev/null  && echo Created MySQL System Tables
+    --skip-name-resolve --user=`whoami` > /dev/null
+  if test ! -d sandbox/data/mysql 
+    then echo "Failed: mysql_install_db did not work." && exit
+    else echo "Created MySQL System Tables"
+  fi
 }
 
 start_mgm_server() {

=== modified file 'storage/ndb/memcache/src/Config_v1.cc'
--- a/storage/ndb/memcache/src/Config_v1.cc	2011-09-22 18:27:10 +0000
+++ b/storage/ndb/memcache/src/Config_v1.cc	2011-09-23 00:00:18 +0000
@@ -18,6 +18,63 @@
  02110-1301  USA
  */
 
+#include <unistd.h>
+#include <stdlib.h>  
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <time.h>
+
+#include "NdbApi.hpp"
+
+#include <memcached/extension_loggers.h>
+#include <memcached/util.h>
+#include <memcached/genhash.h>
+
+#include "ndbmemcache_global.h"
+#include "debug.h"
+#include "timing.h"
+#include "Config_v1.h"
+#include "TableSpec.h"
+#include "QueryPlan.h"
+#include "Operation.h"
+
+extern EXTENSION_LOGGER_DESCRIPTOR *logger;
+
+bool kludge_to_help_with_linking() {
+  int i;
+  i = genhash_string_hash("abc", 4);
+  return (i < 6);
+}
+
+
+/* Functions used by genhash */
+extern "C" {
+  int str_eq(const void *, size_t, const void *, size_t);
+  void * str_key_dup(const void *, size_t);
+}
+
+struct hash_ops string_to_pointer_hash = {
+  genhash_string_hash,   /* hash function */
+  str_eq,                /* equality tester */
+  str_key_dup,           /* duplicate a key */
+  NULL,                  /* duplicate a value */
+  free,                  /* free a key */
+  NULL                   /* free a value */
+};
+
+int str_eq(const void *k1, size_t s1, const void *k2, size_t s2) {
+  return s1 == s2 && memcmp(k1, k2, s1) == 0;
+}
+
+void * str_key_dup(const void *key, size_t) {
+  return strdup((const char *) key);
+}
+
+
+
+/*********** VERSION 1 METADATA *******************/
+
 /********************* COMMON SCHEMA FOR VERSION 1.x ***************
  CREATE  TABLE IF NOT EXISTS `ndb_clusters` (
  `cluster_id` INT NOT NULL ,
@@ -46,7 +103,7 @@
  `expire_time_column` VARCHAR(250)
  ) ENGINE = ndbcluster;
  
-CREATE  TABLE IF NOT EXISTS `key_prefixes` (
+ CREATE  TABLE IF NOT EXISTS `key_prefixes` (
  `server_role_id` INT UNSIGNED NOT NULL DEFAULT 0,
  `key_prefix` VARCHAR(250) NOT NULL ,
  `cluster_id` INT UNSIGNED NOT NULL DEFAULT 0,
@@ -61,10 +118,10 @@ CREATE  TABLE IF NOT EXISTS `key_prefixe
  `server_role` VARCHAR(40) NOT NULL,
  `signon_time` timestamp NOT NULL 
  ) ENGINE = ndbcluster;
-
-
+ 
+ 
  ********************* SPECIFIC TO VERSION 1.0 ***************
-
+ 
  CREATE  TABLE IF NOT EXISTS `memcache_server_roles` (
  `role_name` VARCHAR(40) NOT NULL ,
  `role_id` INT UNSIGNED NOT NULL ,
@@ -74,7 +131,7 @@ CREATE  TABLE IF NOT EXISTS `key_prefixe
  
  
  ********************* SPECIFIC TO VERSION 1.1 ***************
-
+ 
  CREATE  TABLE IF NOT EXISTS `memcache_server_roles` (
  `role_name` VARCHAR(40) NOT NULL ,
  `role_id` INT UNSIGNED NOT NULL ,
@@ -83,58 +140,9 @@ CREATE  TABLE IF NOT EXISTS `key_prefixe
  PRIMARY KEY (`role_name`) )
  ENGINE = ndbcluster;
  
-****************/
- 
-#include <unistd.h>
-#include <stdlib.h>  
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-#include <time.h>
-
-#include "NdbApi.hpp"
-
-#include <memcached/extension_loggers.h>
-#include <memcached/util.h>
-
-#include "ndbmemcache_global.h"
-#include "debug.h"
-#include "timing.h"
-#include "Config_v1.h"
-#include "TableSpec.h"
-#include "QueryPlan.h"
-#include "Operation.h"
-
-extern EXTENSION_LOGGER_DESCRIPTOR *logger;
+ ****************/
 
 
-/* Functions used by genhash */
-extern "C" {
-  int str_eq(const void *, size_t, const void *, size_t);
-  void * str_key_dup(const void *, size_t);
-}
-
-struct hash_ops string_to_pointer_hash = {
-  genhash_string_hash,   /* hash function */
-  str_eq,                /* equality tester */
-  str_key_dup,           /* duplicate a key */
-  NULL,                  /* duplicate a value */
-  free,                  /* free a key */
-  NULL                   /* free a value */
-};
-
-int str_eq(const void *k1, size_t s1, const void *k2, size_t s2) {
-  return s1 == s2 && memcmp(k1, k2, s1) == 0;
-}
-
-void * str_key_dup(const void *key, size_t) {
-  return strdup((const char *) key);
-}
-
-
-
-/*********** VERSION 1 METADATA *******************/
-
 config_v1::config_v1(Configuration * cf) :
   conf(*cf),
   server_role_id(-1), 

=== modified file 'storage/ndb/memcache/src/TableSpec.cc'
--- a/storage/ndb/memcache/src/TableSpec.cc	2011-09-22 18:27:10 +0000
+++ b/storage/ndb/memcache/src/TableSpec.cc	2011-09-23 01:44:59 +0000
@@ -61,7 +61,7 @@ char * tokenize_list(char **stringloc, c
 int TableSpec::build_column_list(const char ** const &col_array, 
                                  const char *list) {
   int n = 0;
-  if(list == 0) return 0;
+  if(list == 0 || *list == 0) return 0;
   char *next = strdup(list);  
   while(next && n < (MAX_KEY_COLUMNS + MAX_VAL_COLUMNS)) {
     char *item = tokenize_list(& next, ", ");
@@ -86,19 +86,19 @@ TableSpec::TableSpec(const char *sqltabl
   nkeycols = build_column_list(key_columns, keycols);
   if(nkeycols) must_free.first_key = 1;
   nvaluecols = build_column_list(value_columns, valcols);
-  if(nvaluecols) must_free.first_val = 1;
+  must_free.first_val = (nvaluecols);
   if(sqltable) {
     char *sqltabname = strdup(sqltable);
-    char *s;
-    for(s = sqltabname ; *s && *s != '.' ; s++);
     schema_name = sqltabname;
     must_free.schema_name = 1;
+    char *s = sqltabname;
+    for( ; *s && *s != '.' ; s++);
     if(*s) {
       assert(*s == '.');
       *s = '\0' ;
       table_name = s+1;
     }
-    must_free.table_name = 0;
+    must_free.table_name = must_free.all_val_cols = must_free.special_cols = 0;
   }
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster branch (john.duncan:3534 to 3540) John David Duncan23 Sep