Commit 6e048c1f authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into mc05.(none):/space2/tomas/mysql-4.1-ndb-test

parents 5522ffd3 46fbf384
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env="";
$opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_suffix="";
$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0;
$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0;

GetOptions(
	"bdb",
@@ -58,7 +58,6 @@ GetOptions(
	"with-small-disk",
	"without-embedded",
	"clearlogs",
        "without-ndbcluster",
) || usage();

usage() if ($opt_help);
@@ -252,7 +251,6 @@ if ($opt_stage <= 1)
  $opt_config_options.= " --with-raid" if ($opt_raid);
  $opt_config_options.= " --with-readline" if ($opt_readline);
  $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded);
  $opt_config_options.= " --without-ndbcluster" if ($opt_without_ndbcluster);
  $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);

  # Only enable InnoDB when requested (required to be able to
@@ -308,7 +306,7 @@ if ($opt_stage <= 3)
  }

  $flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug);
  $flags.= " --with-ndbcluster" if ($opt__with_ndbcluster);
  $flags.= " --with-ndbcluster" if ($opt_with_cluster);
  check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
  safe_system("mv mysql*.t*gz $pwd/$host");
  if (-f "client/.libs/mysqladmin")
@@ -347,10 +345,12 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
#
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{
  my $flags= "";
  $flags.= " --with-ndbcluster" if ($opt_with_cluster);
  log_timestamp();
  system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
  safe_cd("${test_dir}/mysql-test");
  check_system("./mysql-test-run --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
  check_system("./mysql-test-run $flags --warnings --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful");
}

#
@@ -571,7 +571,7 @@ If user is empty then no mail is sent.
Set name suffix (e.g. 'com' or '-max') for a distribution

--with cluster
Compile with NDB Cluster
Compile and test with NDB Cluster enabled

--with-debug
Build binaries with debug information (implies "--no-strip")
+1 −1
Original line number Diff line number Diff line
@@ -1468,7 +1468,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
      ;;
  esac

  AM_CONDITIONAL(HAVE_NDBCLUSTER_DB, test "have_ndbcluster" = "yes")
  AM_CONDITIONAL([HAVE_NDBCLUSTER_DB], [ test "$have_ndbcluster" = "yes" ])
  AC_SUBST(ndbcluster_includes)
  AC_SUBST(ndbcluster_libs)
  AC_SUBST(ndbcluster_system_libs)
+1 −1
Original line number Diff line number Diff line
@@ -469,7 +469,6 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
    }
    cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL;
  }
  pthread_mutex_unlock(&THR_LOCK_charset);
  if (cs && !(cs->state & MY_CS_READY))
  {
    if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) ||
@@ -478,6 +477,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
    else
      cs->state|= MY_CS_READY;
  }
  pthread_mutex_unlock(&THR_LOCK_charset);
  return cs;
}

ndb/bin/mysqlcluster

deleted100755 → 0
+0 −11
Original line number Diff line number Diff line
#!/bin/sh
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP" ]; then
  echo "MYSQLCLUSTER_TOP not set or directory does not exist"
  exit 1
fi
if [ -z "$MYSQLCLUSTER_TOP" -o ! -d "$MYSQLCLUSTER_TOP/ndb" ]; then
  echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
  exit 1
fi

mysql --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*

ndb/bin/mysqlcluster_install_db

deleted100755 → 0
+0 −119
Original line number Diff line number Diff line
#!/bin/sh

NDB_HOME=
export NDB_CONNECTSTRING
if [ -z "$MYSQLCLUSTER_TOP" ]; then
  echo "MYSQLCLUSTER_TOP not set"
  exit 1
fi
if [ -d "$MYSQLCLUSTER_TOP" ]; then :; else
  echo "$MYSQLCLUSTER_TOP directory does not exist"
  exit 1
fi
if [ -d "$MYSQLCLUSTER_TOP/ndb" ]; then :; else
  echo "$MYSQLCLUSTER_TOP/ndb directory does not exist"
  exit 1
fi

start_default_ndbcluster() {

# configurable parameters, make sure to change in mysqlcluterd as well
MYSQLCLUSTER_FILESYSTEM=$MYSQLCLUSTER_TOP/data/mysqlclusterfs
MYSQLCLUSTER_PORT_BASE="22"  # using ports MYSQLCLUSTER_PORT_BASE{"00","01", etc}
# end configurable parameters

# do some checks

NDB_CONNECTSTRING=

[ -d "$MYSQLCLUSTER_FILESYSTEM" ] || mkdir "$MYSQLCLUSTER_FILESYSTEM"
if [ -d "$MYSQLCLUSTER_FILESYSTEM" ]; then :; else
  echo "$MYSQLCLUSTER_FILESYSTEM filesystem directory does not exist"
  exit 1
fi


# set som help variables

NDB_HOST="localhost"
NDB_PORT=$MYSQLCLUSTER_PORT_BASE"00"
NDB_CONNECTSTRING_BASE="host=$NDB_HOST:$NDB_PORT;nodeid="


# Edit file system path and ports in config file

cd $MYSQLCLUSTER_FILESYSTEM
sed \
    -e s,"WRITE_PATH_TO_FILESYSTEM_2_HERE",$MYSQLCLUSTER_FILESYSTEM,g \
    -e s,"CHOOSE_PORT_BASE",$MYSQLCLUSTER_PORT_BASE,g \
    < $MYSQLCLUSTER_TOP/ndb/demos/config-templates/config_template-install.ini \
    > config.ini


# Start management server as deamon

NDB_ID="1"
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
#xterm -e mgmtsrvr -c $MYSQLCLUSTER_FILESYSTEM/config.ini &
if mgmtsrvr -d -c $MYSQLCLUSTER_FILESYSTEM/config.ini ; then :; else
  echo "Unable to start mgmtsrvr"
  exit 1
fi


# Start database node 

cd $MYSQLCLUSTER_FILESYSTEM  # the output from the database node gets where it starts
NDB_ID="2"
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
#xterm -T "NDB Cluster DB Node" -geometry 80x10 -xrm *.hold:true -e ndb -i &
ndb -d -i &

# Start xterm for application programs

NDB_ID="3"
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
#xterm -T "NDB Cluster API Node" -geometry 80x10 &
echo set before running ndbApi programs > export NDB_CONNECTSTRING=$NDB_CONNECTSTRING

# Start management client

#xterm -T "NDB Management Client" -geometry 80x10 -xrm *.hold:true -e mgmtclient $NDB_HOST $NDB_PORT &
echo "NDB Management Client starts with: mgmtclient $NDB_HOST $NDB_PORT"

# test if Ndb Cluster starts properly

NDB_ID="11"
NDB_CONNECTSTRING=$NDB_CONNECTSTRING_BASE$NDB_ID
if list_tables | grep "NDBT_ProgramExit: 0 - OK"; then :; else
  echo "Ndbcluster startup failed"
  exit 1
fi
}

start_mysql_install_db() {
  # run install of regular MySQL Server

  cd $MYSQLCLUSTER_TOP
  scripts/mysql_install_db --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
}

if test "$1" = "ndb_started"
then
  shift
  mgmt_host=$1
  shift
  mgmt_port=$1
  shift
  if [ -z "$mgmt_host" -o -z "$mgmt_port" ]; then
    echo "syntax: ndb_started hostname port"
    exit 1
  fi
  NDB_CONNECTSTRING="host=$mgmt_host:$mgmt_port;nodeid=11"
  echo using NDB_CONNECTSTRING=$NDB_CONNECTSTRING
  start_mysql_install_db $*
else
  start_default_ndbcluster
  start_mysql_install_db
fi
Loading