diff options
author | unknown <pekka@mysql.com> | 2004-06-16 18:59:35 +0200 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2004-06-16 18:59:35 +0200 |
commit | 6b099d2c1b4057ab2401e238dc5917c59c9d42ec (patch) | |
tree | 2123d176746e466f1bbe8ca7cdc14ea6dc0dedf0 | |
parent | cb0486992b5fa188bb9c7aaf615a352648141141 (diff) | |
parent | 6e048c1fcb74013add8726a8d3b702abd9a7b072 (diff) | |
download | mariadb-git-6b099d2c1b4057ab2401e238dc5917c59c9d42ec.tar.gz |
Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into mysql.com:/space/pekka/ndb/version/my41
-rwxr-xr-x | Build-tools/Do-compile | 14 | ||||
-rw-r--r-- | acinclude.m4 | 2 | ||||
-rw-r--r-- | mysys/charset.c | 2 | ||||
-rwxr-xr-x | ndb/bin/mysqlcluster | 11 | ||||
-rwxr-xr-x | ndb/bin/mysqlcluster_install_db | 119 | ||||
-rwxr-xr-x | ndb/bin/mysqlclusterd | 34 | ||||
-rw-r--r-- | ndb/src/common/debugger/signaldata/CreateTrig.cpp | 2 | ||||
-rw-r--r-- | sql/sql_string.cc | 2 | ||||
-rw-r--r-- | strings/ctype-uca.c | 14 |
9 files changed, 19 insertions, 181 deletions
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 5d4a1bdb987..85361108700 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -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", @@ -57,8 +57,7 @@ GetOptions( "with-other-libc=s", "with-small-disk", "without-embedded", - "clearlogs", - "without-ndbcluster", + "clearlogs", ) || 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") diff --git a/acinclude.m4 b/acinclude.m4 index 8ef32c8163a..2af463627f7 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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) diff --git a/mysys/charset.c b/mysys/charset.c index 72f102a2296..1388fc40c6d 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -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; } diff --git a/ndb/bin/mysqlcluster b/ndb/bin/mysqlcluster deleted file mode 100755 index 81fc7308942..00000000000 --- a/ndb/bin/mysqlcluster +++ /dev/null @@ -1,11 +0,0 @@ -#!/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 $* diff --git a/ndb/bin/mysqlcluster_install_db b/ndb/bin/mysqlcluster_install_db deleted file mode 100755 index 6fe95ff105d..00000000000 --- a/ndb/bin/mysqlcluster_install_db +++ /dev/null @@ -1,119 +0,0 @@ -#!/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 - diff --git a/ndb/bin/mysqlclusterd b/ndb/bin/mysqlclusterd deleted file mode 100755 index 3b4deb3ed48..00000000000 --- a/ndb/bin/mysqlclusterd +++ /dev/null @@ -1,34 +0,0 @@ -#!/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 $* diff --git a/ndb/src/common/debugger/signaldata/CreateTrig.cpp b/ndb/src/common/debugger/signaldata/CreateTrig.cpp index d8360dec4d5..ddd45080cba 100644 --- a/ndb/src/common/debugger/signaldata/CreateTrig.cpp +++ b/ndb/src/common/debugger/signaldata/CreateTrig.cpp @@ -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"); 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, "\n"); diff --git a/sql/sql_string.cc b/sql/sql_string.cc index cf4f94ba966..1ec0faafa8f 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -370,7 +370,7 @@ bool String::copy(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); return 0; diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 67214d31ed9..2e03bc8718e 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -7549,8 +7549,8 @@ typedef struct my_coll_rule_item_st USAGE RETURN VALUES - 0 - OK - 1 - ERROR, e.g. too many items. + A positive number means the number of rules loaded. + -1 means ERROR, e.g. too many items, syntax error, etc. */ 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)) return 1; } - if (!(newweights= (uint16**) alloc(256*sizeof(uint16*)))) + if (!(newweights= (uint16**) (*alloc)(256*sizeof(uint16*)))) return 1; bzero(newweights, 256*sizeof(uint16*)); - if (!(newlengths= (uchar*) alloc(256))) + if (!(newlengths= (uchar*) (*alloc)(256))) return 1; memcpy(newlengths, deflengths, 256); @@ -7747,7 +7747,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) /* Alloc new page and copy the default UCA weights */ uint size= 256*newlengths[pagec]*sizeof(uint16); - if (!(newweights[pagec]= (uint16*) alloc(size))) + if (!(newweights[pagec]= (uint16*) (*alloc)(size))) return 1; bzero((void*) newweights[pagec], size); @@ -7774,8 +7774,10 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) /* Copy non-overwritten pages from the default UCA weights */ for (i= 0; i < 256 ; i++) + { if (!newweights[i]) newweights[i]= defweights[i]; + } cs->sort_order= newlengths; cs->sort_order_big= newweights; @@ -7785,7 +7787,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint)) if (ncontractions) { 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; bzero((void*)cs->contractions, size); for (i=0; i < rc; i++) |