Commit a2e4768f authored by unknown's avatar unknown
Browse files

aligned ndb versioning with mysql

    changed define SNPRINTF_RETURN_ZERO to SNPRINTF_RETURN_TRUNC
    added define NDB_INIT
    removed getarg, strlcat, strlcpy
    aligned ndb version with mysql version
    cpcd: removed old way of reading config file and replaced with mysql load_defaults
    changed from using getarg to my_getopts
    use mysql my_progname
    moved getarg to test


BitKeeper/deleted/.del-strlcat.c~250851f8f1ac1c2c:
  Delete: ndb/src/common/util/strlcat.c
BitKeeper/deleted/.del-strlcpy.c~43266e312d11c47b:
  Delete: ndb/src/common/util/strlcpy.c
ndb/test/include/getarg.h:
  Rename: ndb/include/util/getarg.h -> ndb/test/include/getarg.h
configure.in:
  aligned ndb versioning with mysql
  changed define SNPRINTF_RETURN_ZERO to SNPRINTF_RETURN_TRUNC
ndb/include/ndb_global.h:
  added define NDB_INIT
  removed strlcpy, strlcat
ndb/src/common/editline/sysunix.c:
  removed usage of strlcat
ndb/src/common/util/Makefile.am:
  removed getarg, strlcat, strlcpy
ndb/src/common/util/basestring_vsnprintf.c:
  changed define from SNPRINTF_RETURN_ZERO to SNPRINTF_RETURN_TRUNC
ndb/src/common/util/socket_io.cpp:
  removed usage of strlcat
ndb/src/common/util/version.c:
  aligned ndb version with mysql version
ndb/src/cw/cpcd/common.cpp:
  removed old way of reading config file and replaced with mysql load_defaults
ndb/src/cw/cpcd/common.hpp:
  removed old way of reading config file and replaced with mysql load_defaults
ndb/src/cw/cpcd/main.cpp:
  changed from usin getarg to my_opts
ndb/src/kernel/blocks/backup/restore/main.cpp:
  changed from usin getarg to my_opts
ndb/src/kernel/error/ErrorReporter.cpp:
  use mysql my_progname
ndb/src/kernel/main.cpp:
  removed const in main declaration
ndb/src/kernel/vm/Configuration.cpp:
  changed from usin getarg to my_opts
ndb/src/kernel/vm/Configuration.hpp:
  removed const in main declaration
ndb/src/mgmclient/main.cpp:
  changed from usin getarg to my_opts
ndb/src/mgmsrv/main.cpp:
  changed from usin getarg to my_opts
ndb/src/ndbapi/Ndb.cpp:
  fixed compiler warnings
ndb/test/run-test/Makefile.am:
  moved getarg to test
ndb/test/src/Makefile.am:
  moved getarg to test
ndb/test/src/getarg.c:
  moved strlcat and strlcpy into getarg.c
ndb/tools/delete_all.cpp:
  changed from usin getarg to my_opts
ndb/tools/desc.cpp:
  changed from usin getarg to my_opts
ndb/tools/drop_index.cpp:
  changed from usin getarg to my_opts
ndb/tools/drop_tab.cpp:
  changed from usin getarg to my_opts
ndb/tools/listTables.cpp:
  changed from usin getarg to my_opts
ndb/tools/select_all.cpp:
  changed from usin getarg to my_opts
ndb/tools/select_count.cpp:
  changed from usin getarg to my_opts
ndb/tools/waiter.cpp:
  changed from usin getarg to my_opts
parent d46c7366
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb
AM_INIT_AUTOMAKE(mysql, 4.1.8)
AM_CONFIG_HEADER(config.h)

@@ -13,9 +14,9 @@ DOT_FRM_VERSION=6
SHARED_LIB_VERSION=14:0:0

# ndb version
NDB_VERSION_MAJOR=3
NDB_VERSION_MINOR=5
NDB_VERSION_BUILD=4
NDB_VERSION_MAJOR=4
NDB_VERSION_MINOR=1
NDB_VERSION_BUILD=8
NDB_VERSION_STATUS=""

# Set all version vars based on $VERSION. How do we do this more elegant ?
@@ -1142,8 +1143,8 @@ dnl Is this the right match for DEC OSF on alpha?
      fi
      echo "Adding defines for OSF1"
      # gethostbyname_r is deprecated and doesn't work ok on OSF1
      CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_ZERO"
      CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_ZERO"
      CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
      CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC"
      # fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler
      CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk"
    ;;
+1 −8
Original line number Diff line number Diff line
@@ -82,19 +82,12 @@ extern "C" {
/* call in main() - does not return on error */
extern int ndb_init(void);
extern void ndb_end(int);
#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();}

#ifndef HAVE_STRDUP
extern char * strdup(const char *s);
#endif

#ifndef HAVE_STRLCPY
extern size_t strlcpy (char *dst, const char *src, size_t dst_sz);
#endif

#ifndef HAVE_STRLCAT
extern size_t strlcat (char *dst, const char *src, size_t dst_sz);
#endif

#ifndef HAVE_STRCASECMP
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, size_t n);
+57 −0
Original line number Diff line number Diff line
/* Copyright (C) 2003 MySQL AB

   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; either version 2 of the License, or
   (at your option) any later version.

   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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#ifndef _NDB_OPTS_H
#define _NDB_OPTS_H

#include <my_sys.h>
#include <my_getopt.h>
#include <mysql_version.h>
#include <ndb_version.h>

#ifndef DBUG_OFF
#define NDB_STD_OPTS(prog_name) \
  { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
    0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "usage", '?', "Display this help and exit.", \
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "help", '?', "Display this help and exit.", \
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "version", 'V', "Output version information and exit.", 0, 0, 0, \
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "connect-string", 'c', \
    "Set connect string for connecting to ndb_mgmd. " \
    "<constr>=\"host=<hostname:port>[;nodeid=<id>]\". " \
    "Overides specifying entries in NDB_CONNECTSTRING and config file", \
    (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
#else
#define NDB_STD_OPTS(prog_name) \
  { "usage", '?', "Display this help and exit.", \
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "help", '?', "Display this help and exit.", \
    0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "version", 'V', "Output version information and exit.", 0, 0, 0, \
    GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
  { "connect-string", 'c', \
    "Set connect string for connecting to ndb_mgmd. " \
    "<constr>=\"host=<hostname:port>[;nodeid=<id>]\". " \
    "Overides specifying entries in NDB_CONNECTSTRING and config file", \
    (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
#endif

#endif /*_NDB_OPTS_H */
+7 −2
Original line number Diff line number Diff line
@@ -138,6 +138,11 @@ rl_add_slash(char *path, char *p, size_t p_len)
{
    struct stat	Sb;

    if (stat(path, &Sb) >= 0)
	(void)strlcat(p, S_ISDIR(Sb.st_mode) ? "/" : " ", p_len);
    if (stat(path, &Sb) >= 0) {
      int len= strlen(p);
      if (len+1 < p_len) {
	p[len]= S_ISDIR(Sb.st_mode) ? '/' : ' ';
	p[len+1]= 0;
      }
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@ libgeneral_la_SOURCES = \
            SocketServer.cpp SocketClient.cpp SocketAuthenticator.cpp\
	    OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \
	    NdbSqlUtil.cpp new.cpp \
            uucode.c random.c getarg.c version.c \
            strdup.c strlcat.c strlcpy.c \
            uucode.c random.c version.c \
            strdup.c \
            ConfigValues.cpp ndb_init.c basestring_vsnprintf.c

include $(top_srcdir)/ndb/config/common.mk.am
Loading