Commit 1226cf25 authored by unknown's avatar unknown

Merge build.mysql.com:/users/tulin/mysql-5.0

into build.mysql.com:/users/tulin/mysql-5.1


configure.in:
  Auto merged
parents 85812350 628804d9
...@@ -1923,7 +1923,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ ...@@ -1923,7 +1923,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \ realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
sighold sigset sigthreadmask \ sighold sigset sigthreadmask \
snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \
strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr)
...@@ -2710,7 +2710,10 @@ if test "$ac_cv_func_shmget" = "yes" && ...@@ -2710,7 +2710,10 @@ if test "$ac_cv_func_shmget" = "yes" &&
test "$ac_cv_func_shmat" = "yes" && test "$ac_cv_func_shmat" = "yes" &&
test "$ac_cv_func_shmdt" = "yes" && test "$ac_cv_func_shmdt" = "yes" &&
test "$ac_cv_func_shmctl" = "yes" && test "$ac_cv_func_shmctl" = "yes" &&
test "$ac_cv_func_sigaction" = "yes" test "$ac_cv_func_sigaction" = "yes" &&
test "$ac_cv_func_sigemptyset" = "yes" &&
test "$ac_cv_func_sigaddset" = "yes" &&
test "$ac_cv_func_pthread_sigmask" = "yes"
then then
AC_DEFINE([NDB_SHM_TRANSPORTER], [1], AC_DEFINE([NDB_SHM_TRANSPORTER], [1],
[Including Ndb Cluster DB shared memory transporter]) [Including Ndb Cluster DB shared memory transporter])
......
...@@ -241,6 +241,9 @@ USE_EMBEDDED_SERVER="" ...@@ -241,6 +241,9 @@ USE_EMBEDDED_SERVER=""
RESULT_EXT="" RESULT_EXT=""
TEST_MODE="default" TEST_MODE="default"
NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS=
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
--embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \ --embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \
...@@ -261,6 +264,10 @@ while test $# -gt 0; do ...@@ -261,6 +264,10 @@ while test $# -gt 0; do
--ndb-connectstring=*) --ndb-connectstring=*)
USE_NDBCLUSTER="--ndbcluster" ; USE_NDBCLUSTER="--ndbcluster" ;
USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;; USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;;
--ndb_mgmd-extra-opts=*)
NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;;
--ndbd-extra-opts=*)
NDBD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndbd-extra-opts=;;"` ;;
--tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;; --tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;;
--local-master) --local-master)
MASTER_MYPORT=3306; MASTER_MYPORT=3306;
...@@ -463,7 +470,7 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" ...@@ -463,7 +470,7 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2`
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var" NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgmd-extra-opts=\"$NDB_MGMD_EXTRA_OPTS\" --ndbd-extra-opts=\"$NDBD_EXTRA_OPTS\""
if [ x$SOURCE_DIST = x1 ] ; then if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR MY_BASEDIR=$MYSQL_TEST_DIR
......
...@@ -58,6 +58,9 @@ ndb_con_op=105000 ...@@ -58,6 +58,9 @@ ndb_con_op=105000
ndb_dmem=80M ndb_dmem=80M
ndb_imem=24M ndb_imem=24M
NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS=
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
--test) --test)
...@@ -94,6 +97,12 @@ while test $# -gt 0; do ...@@ -94,6 +97,12 @@ while test $# -gt 0; do
--port-base=*) --port-base=*)
port_base=`echo "$1" | sed -e "s;--port-base=;;"` port_base=`echo "$1" | sed -e "s;--port-base=;;"`
;; ;;
--ndb_mgmd-extra-opts=*)
NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"`
;;
--ndbd-extra-opts=*)
NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"`
;;
-- ) shift; break ;; -- ) shift; break ;;
--* ) $ECHO "Unrecognized option: $1"; exit 1 ;; --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
* ) break ;; * ) break ;;
...@@ -122,8 +131,8 @@ if [ ! -x "$exec_waiter" ]; then ...@@ -122,8 +131,8 @@ if [ ! -x "$exec_waiter" ]; then
fi fi
exec_mgmtclient="$exec_mgmtclient --no-defaults" exec_mgmtclient="$exec_mgmtclient --no-defaults"
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults" exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS"
exec_ndb="$exec_ndb --no-defaults" exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS"
exec_waiter="$exec_waiter --no-defaults" exec_waiter="$exec_waiter --no-defaults"
ndb_host="localhost" ndb_host="localhost"
......
...@@ -28,8 +28,24 @@ struct NdbThread ...@@ -28,8 +28,24 @@ struct NdbThread
{ {
pthread_t thread; pthread_t thread;
char thread_name[MAX_THREAD_NAME]; char thread_name[MAX_THREAD_NAME];
NDB_THREAD_FUNC * func;
void * object;
}; };
static
void*
ndb_thread_wrapper(void* _ss){
void * ret;
struct NdbThread * ss = (struct NdbThread *)_ss;
#ifdef NDB_SHM_TRANSPORTER
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGUSR1);
pthread_sigmask(SIG_BLOCK, &mask, 0);
#endif
ret= (* ss->func)(ss->object);
return ret;
}
struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
...@@ -67,10 +83,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, ...@@ -67,10 +83,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */ #ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
#endif #endif
tmpThread->func= p_thread_func;
tmpThread->object= p_thread_arg;
result = pthread_create(&tmpThread->thread, result = pthread_create(&tmpThread->thread,
&thread_attr, &thread_attr,
p_thread_func, ndb_thread_wrapper,
p_thread_arg); tmpThread);
assert(result==0); assert(result==0);
pthread_attr_destroy(&thread_attr); pthread_attr_destroy(&thread_attr);
......
...@@ -157,8 +157,17 @@ TransporterRegistry::init(NodeId nodeId) { ...@@ -157,8 +157,17 @@ TransporterRegistry::init(NodeId nodeId) {
DEBUG("TransporterRegistry started node: " << localNodeId); DEBUG("TransporterRegistry started node: " << localNodeId);
// return allocateLongSignalMemoryPool(nLargeSegments); #ifdef NDB_SHM_TRANSPORTER
return true; /**
* Make sure to block SIGUSR1
* TransporterRegistry::init is run from "main" thread
*/
sigset_t mask;
sigemptyset(&mask);
sigaddset(&mask, SIGUSR1);
pthread_sigmask(SIG_BLOCK, &mask, 0);
#endif
return true;
} }
bool bool
...@@ -1347,6 +1356,9 @@ TransporterRegistry::startReceiving() ...@@ -1347,6 +1356,9 @@ TransporterRegistry::startReceiving()
#ifdef NDB_SHM_TRANSPORTER #ifdef NDB_SHM_TRANSPORTER
m_shm_own_pid = getpid(); m_shm_own_pid = getpid();
struct sigaction sa; struct sigaction sa;
sigemptyset(&sa.sa_mask);
sigaddset(&sa.sa_mask, SIGUSR1);
pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0);
sa.sa_handler = shm_sig_handler; sa.sa_handler = shm_sig_handler;
sigemptyset(&sa.sa_mask); sigemptyset(&sa.sa_mask);
sa.sa_flags = 0; sa.sa_flags = 0;
......
...@@ -616,7 +616,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) ...@@ -616,7 +616,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob)
char *buf= m_blobs_buffer + offset; char *buf= m_blobs_buffer + offset;
uint32 len= 0xffffffff; // Max uint32 uint32 len= 0xffffffff; // Max uint32
DBUG_PRINT("value", ("read blob ptr=%x len=%u", DBUG_PRINT("value", ("read blob ptr=%x len=%u",
(uint)buf, (uint)blob_len)); (UintPtr)buf, (uint)blob_len));
if (ndb_blob->readData(buf, len) != 0) if (ndb_blob->readData(buf, len) != 0)
DBUG_RETURN(-1); DBUG_RETURN(-1);
DBUG_ASSERT(len == blob_len); DBUG_ASSERT(len == blob_len);
...@@ -3222,7 +3222,7 @@ int ha_ndbcluster::start_stmt(THD *thd) ...@@ -3222,7 +3222,7 @@ int ha_ndbcluster::start_stmt(THD *thd)
#if 0 #if 0
NdbTransaction *tablock_trans= NdbTransaction *tablock_trans=
(NdbTransaction*)thd->transaction.all.ndb_tid; (NdbTransaction*)thd->transaction.all.ndb_tid;
DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans)); DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans));
DBUG_ASSERT(tablock_trans); DBUG_ASSERT(tablock_trans);
// trans= ndb->hupp(tablock_trans); // trans= ndb->hupp(tablock_trans);
#endif #endif
......
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