Commit 13298bd8 authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb

into  perch.ndb.mysql.com:/home/jonas/src/51-ndb
parents 9529e06c 78fb6b27
# Replication tests need binlog
source include/have_log_bin.inc;
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild
ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
...@@ -21,5 +19,3 @@ ndb_partition_error2 : HF is not sure if the test can work as internded on all ...@@ -21,5 +19,3 @@ ndb_partition_error2 : HF is not sure if the test can work as internded on all
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events #ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
#ndb_binlog_discover : bug#21806 2006-08-24 #ndb_binlog_discover : bug#21806 2006-08-24
#ndb_autodiscover3 : bug#21806
#ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_autodiscover3 : bug#21806
#ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_2myisam : BUG#19227 Seems to pass currently
rpl_ndb_2other : BUG#21842 2007-08-30 tsmith test has never worked on bigendian (sol10-sparc-a, powermacg5
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_binlog_format_mixed_or_row.inc --source include/have_binlog_format_mixed_or_row.inc
--source include/master-slave.inc --source include/ndb_master-slave.inc
# On master use NDB as storage engine. # On master use NDB as storage engine.
connection master; connection master;
......
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
......
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
# #
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
# code between engine tests # # code between engine tests #
################################# #################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDBCLUSTER; let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_blob.test -- source extra/rpl_tests/rpl_row_blob.test
......
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
# set up circular replication # set up circular replication
......
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
connection master; connection master;
......
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
##################################### #####################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
-- source include/have_log_bin.inc
let $engine_type=NDB; let $engine_type=NDB;
-- source extra/rpl_tests/rpl_commit_after_flush.test -- source extra/rpl_tests/rpl_commit_after_flush.test
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# Share test code between engine tests # # Share test code between engine tests #
######################################### #########################################
--source include/have_ndb.inc --source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDB; let $engine_type=NDB;
-- source extra/rpl_tests/rpl_delete_no_where.test -- source extra/rpl_tests/rpl_delete_no_where.test
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
########################################################## ##########################################################
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
--disable_warnings --disable_warnings
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
########################################################## ##########################################################
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
--disable_warnings --disable_warnings
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
# reduce test case code # # reduce test case code #
################################### ###################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDB; let $engine_type=NDB;
-- source extra/rpl_tests/rpl_row_func003.test -- source extra/rpl_tests/rpl_row_func003.test
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
-- source include/have_log_bin.inc
create table t1 (a int, unique(a)) engine=ndbcluster; create table t1 (a int, unique(a)) engine=ndbcluster;
create table t2 (a int, unique(a)) engine=innodb; create table t2 (a int, unique(a)) engine=innodb;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Wrapper for rpl_insert_ignore.test# # Wrapper for rpl_insert_ignore.test#
##################################### #####################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDB; let $engine_type=NDB;
let $engine_type2=myisam; let $engine_type2=myisam;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# to reuse test code between engine runs # # to reuse test code between engine runs #
############################################################ ############################################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDB; let $engine_type=NDB;
-- source extra/rpl_tests/rpl_multi_update3.test -- source extra/rpl_tests/rpl_multi_update3.test
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
########################################################## ##########################################################
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source include/ndb_master-slave.inc --source include/ndb_master-slave.inc
--disable_warnings --disable_warnings
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# By JBM 2005-02-15 Wrapped to allow reuse of test code# # By JBM 2005-02-15 Wrapped to allow reuse of test code#
######################################################## ########################################################
--source include/have_ndb.inc --source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDB; let $engine_type=NDB;
-- source extra/rpl_tests/rpl_row_001.test -- source extra/rpl_tests/rpl_row_001.test
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# For different engines # # For different engines #
################################# #################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDBCLUSTER; let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp003.test -- source extra/rpl_tests/rpl_row_sp003.test
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# For different engines # # For different engines #
################################# #################################
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDBCLUSTER; let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp006.test -- source extra/rpl_tests/rpl_row_sp006.test
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
############################################################################# #############################################################################
# Includes # Includes
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/have_ndb.inc -- source include/have_ndb.inc
-- source include/ndb_master-slave.inc -- source include/ndb_master-slave.inc
let $engine_type=NDB; let $engine_type=NDB;
......
...@@ -3209,11 +3209,6 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb, ...@@ -3209,11 +3209,6 @@ ndb_binlog_thread_handle_non_data_event(THD *thd, Ndb *ndb,
NDB_SHARE *share= (NDB_SHARE *)pOp->getCustomData(); NDB_SHARE *share= (NDB_SHARE *)pOp->getCustomData();
NDBEVENT::TableEvent type= pOp->getEventType(); NDBEVENT::TableEvent type= pOp->getEventType();
/* make sure to flush any pending events as they can be dependent
on one of the tables being changed below
*/
thd->binlog_flush_pending_rows_event(TRUE);
switch (type) switch (type)
{ {
case NDBEVENT::TE_CLUSTER_FAILURE: case NDBEVENT::TE_CLUSTER_FAILURE:
......
...@@ -132,6 +132,11 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db, ...@@ -132,6 +132,11 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
const char* table_name, bool overwrite); const char* table_name, bool overwrite);
static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi); static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi);
static Log_event* next_event(RELAY_LOG_INFO* rli); static Log_event* next_event(RELAY_LOG_INFO* rli);
static int terminate_slave_thread(THD *thd,
pthread_mutex_t* term_lock,
pthread_cond_t* term_cond,
volatile uint *slave_running,
bool skip_lock);
/* /*
Find out which replications threads are running Find out which replications threads are running
...@@ -312,35 +317,26 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) ...@@ -312,35 +317,26 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
DBUG_RETURN(0); /* successfully do nothing */ DBUG_RETURN(0); /* successfully do nothing */
int error,force_all = (thread_mask & SLAVE_FORCE_ALL); int error,force_all = (thread_mask & SLAVE_FORCE_ALL);
pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock; pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock;
pthread_mutex_t *sql_cond_lock,*io_cond_lock;
sql_cond_lock=sql_lock; if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)))
io_cond_lock=io_lock;
if (skip_lock)
{
sql_lock = io_lock = 0;
}
if ((thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) && mi->slave_running)
{ {
DBUG_PRINT("info",("Terminating IO thread")); DBUG_PRINT("info",("Terminating IO thread"));
mi->abort_slave=1; mi->abort_slave=1;
if ((error=terminate_slave_thread(mi->io_thd,io_lock, if ((error=terminate_slave_thread(mi->io_thd,io_lock,
io_cond_lock,
&mi->stop_cond, &mi->stop_cond,
&mi->slave_running)) && &mi->slave_running,
skip_lock)) &&
!force_all) !force_all)
DBUG_RETURN(error); DBUG_RETURN(error);
} }
if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) && mi->rli.slave_running) if ((thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)))
{ {
DBUG_PRINT("info",("Terminating SQL thread")); DBUG_PRINT("info",("Terminating SQL thread"));
DBUG_ASSERT(mi->rli.sql_thd != 0) ;
mi->rli.abort_slave=1; mi->rli.abort_slave=1;
if ((error=terminate_slave_thread(mi->rli.sql_thd,sql_lock, if ((error=terminate_slave_thread(mi->rli.sql_thd,sql_lock,
sql_cond_lock,
&mi->rli.stop_cond, &mi->rli.stop_cond,
&mi->rli.slave_running)) && &mi->rli.slave_running,
skip_lock)) &&
!force_all) !force_all)
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -348,23 +344,60 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) ...@@ -348,23 +344,60 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock)
} }
int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, /**
pthread_mutex_t *cond_lock, Wait for a slave thread to terminate.
pthread_cond_t* term_cond,
volatile uint *slave_running) This function is called after requesting the thread to terminate
(by setting @c abort_slave member of @c Relay_log_info or @c
Master_info structure to 1). Termination of the thread is
controlled with the the predicate <code>*slave_running</code>.
Function will acquire @c term_lock before waiting on the condition
unless @c skip_lock is true in which case the mutex should be owned
by the caller of this function and will remain acquired after
return from the function.
@param term_lock
Associated lock to use when waiting for @c term_cond
@param term_cond
Condition that is signalled when the thread has terminated
@param slave_running
Pointer to predicate to check for slave thread termination
@param skip_lock
If @c true the lock will not be acquired before waiting on
the condition. In this case, it is assumed that the calling
function acquires the lock before calling this function.
@retval 0 All OK
*/
static int
terminate_slave_thread(THD *thd,
pthread_mutex_t* term_lock,
pthread_cond_t* term_cond,
volatile uint *slave_running,
bool skip_lock)
{ {
int error;
DBUG_ENTER("terminate_slave_thread"); DBUG_ENTER("terminate_slave_thread");
if (term_lock)
{ if (!skip_lock)
pthread_mutex_lock(term_lock); pthread_mutex_lock(term_lock);
if (!*slave_running)
{ safe_mutex_assert_owner(term_lock);
if (!*slave_running)
{
if (!skip_lock)
pthread_mutex_unlock(term_lock); pthread_mutex_unlock(term_lock);
DBUG_RETURN(ER_SLAVE_NOT_RUNNING); DBUG_RETURN(ER_SLAVE_NOT_RUNNING);
}
} }
DBUG_ASSERT(thd != 0); DBUG_ASSERT(thd != 0);
THD_CHECK_SENTRY(thd); THD_CHECK_SENTRY(thd);
/* /*
Is is critical to test if the slave is running. Otherwise, we might Is is critical to test if the slave is running. Otherwise, we might
be referening freed memory trying to kick it be referening freed memory trying to kick it
...@@ -380,9 +413,13 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, ...@@ -380,9 +413,13 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock,
*/ */
struct timespec abstime; struct timespec abstime;
set_timespec(abstime,2); set_timespec(abstime,2);
pthread_cond_timedwait(term_cond, cond_lock, &abstime); error= pthread_cond_timedwait(term_cond, term_lock, &abstime);
DBUG_ASSERT(error == ETIMEDOUT || error == 0);
} }
if (term_lock)
DBUG_ASSERT(*slave_running == 0);
if (!skip_lock)
pthread_mutex_unlock(term_lock); pthread_mutex_unlock(term_lock);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -133,10 +133,6 @@ bool flush_relay_log_info(RELAY_LOG_INFO* rli); ...@@ -133,10 +133,6 @@ bool flush_relay_log_info(RELAY_LOG_INFO* rli);
int register_slave_on_master(MYSQL* mysql); int register_slave_on_master(MYSQL* mysql);
int terminate_slave_threads(MASTER_INFO* mi, int thread_mask, int terminate_slave_threads(MASTER_INFO* mi, int thread_mask,
bool skip_lock = 0); bool skip_lock = 0);
int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex,
pthread_mutex_t* cond_lock,
pthread_cond_t* term_cond,
volatile uint* slave_running);
int start_slave_threads(bool need_slave_mutex, bool wait_for_start, int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
MASTER_INFO* mi, const char* master_info_fname, MASTER_INFO* mi, const char* master_info_fname,
const char* slave_info_fname, int thread_mask); const char* slave_info_fname, int thread_mask);
......
...@@ -4555,6 +4555,15 @@ row_search_autoinc_read_column( ...@@ -4555,6 +4555,15 @@ row_search_autoinc_read_column(
ut_a(len != UNIV_SQL_NULL); ut_a(len != UNIV_SQL_NULL);
ut_a(len <= sizeof value); ut_a(len <= sizeof value);
#ifdef WORDS_BIGENDIAN
/* Copy integer data and restore sign bit */
memcpy((ptr = dest), data, len);
if (!unsigned_type) {
dest[0] ^= 128;
}
#else
/* Convert integer data from Innobase to a little-endian format, /* Convert integer data from Innobase to a little-endian format,
sign bit restored to normal */ sign bit restored to normal */
...@@ -4566,6 +4575,7 @@ row_search_autoinc_read_column( ...@@ -4566,6 +4575,7 @@ row_search_autoinc_read_column(
if (!unsigned_type) { if (!unsigned_type) {
dest[len - 1] ^= 128; dest[len - 1] ^= 128;
} }
#endif
/* The assumption here is that the AUTOINC value can't be negative.*/ /* The assumption here is that the AUTOINC value can't be negative.*/
switch (len) { switch (len) {
......
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