Commit 6b099d2c authored by unknown's avatar unknown

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

into mysql.com:/space/pekka/ndb/version/my41

parents cb048699 6e048c1f
No related merge requests found
...@@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; ...@@ -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_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix="";
$opt_tmp=$opt_version_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_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( GetOptions(
"bdb", "bdb",
...@@ -57,8 +57,7 @@ GetOptions( ...@@ -57,8 +57,7 @@ GetOptions(
"with-other-libc=s", "with-other-libc=s",
"with-small-disk", "with-small-disk",
"without-embedded", "without-embedded",
"clearlogs", "clearlogs",
"without-ndbcluster",
) || usage(); ) || usage();
usage() if ($opt_help); usage() if ($opt_help);
...@@ -252,7 +251,6 @@ if ($opt_stage <= 1) ...@@ -252,7 +251,6 @@ if ($opt_stage <= 1)
$opt_config_options.= " --with-raid" if ($opt_raid); $opt_config_options.= " --with-raid" if ($opt_raid);
$opt_config_options.= " --with-readline" if ($opt_readline); $opt_config_options.= " --with-readline" if ($opt_readline);
$opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); $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); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster);
# Only enable InnoDB when requested (required to be able to # Only enable InnoDB when requested (required to be able to
...@@ -308,7 +306,7 @@ if ($opt_stage <= 3) ...@@ -308,7 +306,7 @@ if ($opt_stage <= 3)
} }
$flags.= " --no-strip" if ($opt_no_strip || $opt_with_debug); $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"); check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
safe_system("mv mysql*.t*gz $pwd/$host"); safe_system("mv mysql*.t*gz $pwd/$host");
if (-f "client/.libs/mysqladmin") if (-f "client/.libs/mysqladmin")
...@@ -347,10 +345,12 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . ...@@ -347,10 +345,12 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
# #
if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest)
{ {
my $flags= "";
$flags.= " --with-ndbcluster" if ($opt_with_cluster);
log_timestamp(); log_timestamp();
system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir);
safe_cd("${test_dir}/mysql-test"); 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. ...@@ -571,7 +571,7 @@ If user is empty then no mail is sent.
Set name suffix (e.g. 'com' or '-max') for a distribution Set name suffix (e.g. 'com' or '-max') for a distribution
--with cluster --with cluster
Compile with NDB Cluster Compile and test with NDB Cluster enabled
--with-debug --with-debug
Build binaries with debug information (implies "--no-strip") Build binaries with debug information (implies "--no-strip")
......
...@@ -1468,7 +1468,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ ...@@ -1468,7 +1468,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
;; ;;
esac 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_includes)
AC_SUBST(ndbcluster_libs) AC_SUBST(ndbcluster_libs)
AC_SUBST(ndbcluster_system_libs) AC_SUBST(ndbcluster_system_libs)
......
...@@ -469,7 +469,6 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) ...@@ -469,7 +469,6 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
} }
cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL; cs= (cs->state & MY_CS_AVAILABLE) ? cs : NULL;
} }
pthread_mutex_unlock(&THR_LOCK_charset);
if (cs && !(cs->state & MY_CS_READY)) if (cs && !(cs->state & MY_CS_READY))
{ {
if ((cs->cset->init && cs->cset->init(cs, cs_alloc)) || 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) ...@@ -478,6 +477,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
else else
cs->state|= MY_CS_READY; cs->state|= MY_CS_READY;
} }
pthread_mutex_unlock(&THR_LOCK_charset);
return cs; return cs;
} }
......
#!/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 $*
#!/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
#!/bin/sh
# configurable parameters
MYSQLCLUSTER_PORT_BASE="22"
# end configurable parameters
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
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
else
NDB_CONNECTSTRING="host=localhost:"$MYSQLCLUSTER_PORT_BASE"00;nodeid=11"
fi
export NDB_CONNECTSTRING
mysqld --default-table-type=ndbcluster --basedir=$MYSQLCLUSTER_TOP --datadir=$MYSQLCLUSTER_TOP/data --socket=$MYSQLCLUSTER_TOP/data/mysqlcluster.sock $*
...@@ -87,7 +87,7 @@ bool printCREATE_TRIG_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uin ...@@ -87,7 +87,7 @@ bool printCREATE_TRIG_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uin
fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false"); fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false");
const AttributeMask& attributeMask = sig->getAttributeMask(); const AttributeMask& attributeMask = sig->getAttributeMask();
char buf[attributeMask.TextLength + 1]; char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
fprintf(output, "Attribute mask: %s", attributeMask.getText(buf)); fprintf(output, "Attribute mask: %s", attributeMask.getText(buf));
fprintf(output, "\n"); fprintf(output, "\n");
......
...@@ -370,7 +370,7 @@ bool String::copy(const char *str, uint32 arg_length, ...@@ -370,7 +370,7 @@ bool String::copy(const char *str, uint32 arg_length,
bool String::set_ascii(const char *str, uint32 arg_length) bool String::set_ascii(const char *str, uint32 arg_length)
{ {
if (!(str_charset->mbminlen > 1)) if (str_charset->mbminlen == 1)
{ {
set(str, arg_length, str_charset); set(str, arg_length, str_charset);
return 0; return 0;
......
...@@ -7549,8 +7549,8 @@ typedef struct my_coll_rule_item_st ...@@ -7549,8 +7549,8 @@ typedef struct my_coll_rule_item_st
USAGE USAGE
RETURN VALUES RETURN VALUES
0 - OK A positive number means the number of rules loaded.
1 - ERROR, e.g. too many items. -1 means ERROR, e.g. too many items, syntax error, etc.
*/ */
static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems,
...@@ -7706,11 +7706,11 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) ...@@ -7706,11 +7706,11 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
return 1; return 1;
} }
if (!(newweights= (uint16**) alloc(256*sizeof(uint16*)))) if (!(newweights= (uint16**) (*alloc)(256*sizeof(uint16*))))
return 1; return 1;
bzero(newweights, 256*sizeof(uint16*)); bzero(newweights, 256*sizeof(uint16*));
if (!(newlengths= (uchar*) alloc(256))) if (!(newlengths= (uchar*) (*alloc)(256)))
return 1; return 1;
memcpy(newlengths, deflengths, 256); memcpy(newlengths, deflengths, 256);
...@@ -7747,7 +7747,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) ...@@ -7747,7 +7747,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
/* Alloc new page and copy the default UCA weights */ /* Alloc new page and copy the default UCA weights */
uint size= 256*newlengths[pagec]*sizeof(uint16); uint size= 256*newlengths[pagec]*sizeof(uint16);
if (!(newweights[pagec]= (uint16*) alloc(size))) if (!(newweights[pagec]= (uint16*) (*alloc)(size)))
return 1; return 1;
bzero((void*) newweights[pagec], size); bzero((void*) newweights[pagec], size);
...@@ -7774,8 +7774,10 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) ...@@ -7774,8 +7774,10 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
/* Copy non-overwritten pages from the default UCA weights */ /* Copy non-overwritten pages from the default UCA weights */
for (i= 0; i < 256 ; i++) for (i= 0; i < 256 ; i++)
{
if (!newweights[i]) if (!newweights[i])
newweights[i]= defweights[i]; newweights[i]= defweights[i];
}
cs->sort_order= newlengths; cs->sort_order= newlengths;
cs->sort_order_big= newweights; cs->sort_order_big= newweights;
...@@ -7785,7 +7787,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) ...@@ -7785,7 +7787,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
if (ncontractions) if (ncontractions)
{ {
uint size= 0x40*0x40*sizeof(uint16); /* 8K, for basic latin letter only */ uint size= 0x40*0x40*sizeof(uint16); /* 8K, for basic latin letter only */
if (!(cs->contractions= (uint16*) alloc(size))) if (!(cs->contractions= (uint16*) (*alloc)(size)))
return 1; return 1;
bzero((void*)cs->contractions, size); bzero((void*)cs->contractions, size);
for (i=0; i < rc; i++) for (i=0; i < rc; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment