Commit c5273c17 authored by mkindahl@dl145h.mysql.com's avatar mkindahl@dl145h.mysql.com

Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl

into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
parents ec9c7913 416001d8
reset master;
stop slave;
reset slave;
start slave;
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File
Read_Master_Log_Pos 4
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos 0
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
--loose-debug=d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init
# Test for
# Bug #33931 assertion at write_ignored_events_info_to_relay_log if init_slave_thread() fails
# Bug #33932 assertion at handle_slave_sql if init_slave_thread() fails
source include/have_debug.inc;
source include/have_log_bin.inc;
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connection master;
reset master;
connection slave;
--disable_warnings
stop slave;
--enable_warnings
reset slave;
start slave;
connection master;
save_master_pos;
connection slave;
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
source include/wait_for_slave_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical show slave status;
# no clean-up is needed
...@@ -1507,6 +1507,9 @@ void set_slave_thread_default_charset(THD* thd, Relay_log_info const *rli) ...@@ -1507,6 +1507,9 @@ void set_slave_thread_default_charset(THD* thd, Relay_log_info const *rli)
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
{ {
DBUG_ENTER("init_slave_thread"); DBUG_ENTER("init_slave_thread");
#if !defined(DBUG_OFF)
int simulate_error= 0;
#endif
thd->system_thread = (thd_type == SLAVE_THD_SQL) ? thd->system_thread = (thd_type == SLAVE_THD_SQL) ?
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
thd->security_ctx->skip_grants(); thd->security_ctx->skip_grants();
...@@ -1526,10 +1529,17 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) ...@@ -1526,10 +1529,17 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
DBUG_EXECUTE_IF("simulate_io_slave_error_on_init",
simulate_error|= (1 << SLAVE_THD_IO););
DBUG_EXECUTE_IF("simulate_sql_slave_error_on_init",
simulate_error|= (1 << SLAVE_THD_SQL););
#if !defined(DBUG_OFF)
if (init_thr_lock() || thd->store_globals() || simulate_error & (1<< thd_type))
#else
if (init_thr_lock() || thd->store_globals()) if (init_thr_lock() || thd->store_globals())
#endif
{ {
thd->cleanup(); thd->cleanup();
delete thd;
DBUG_RETURN(-1); DBUG_RETURN(-1);
} }
lex_start(thd); lex_start(thd);
...@@ -2229,6 +2239,7 @@ pthread_handler_t handle_slave_io(void *arg) ...@@ -2229,6 +2239,7 @@ pthread_handler_t handle_slave_io(void *arg)
thd= new THD; // note that contructor of THD uses DBUG_ ! thd= new THD; // note that contructor of THD uses DBUG_ !
THD_CHECK_SENTRY(thd); THD_CHECK_SENTRY(thd);
mi->io_thd = thd;
pthread_detach_this_thread(); pthread_detach_this_thread();
thd->thread_stack= (char*) &thd; // remember where our stack is thd->thread_stack= (char*) &thd; // remember where our stack is
...@@ -2239,7 +2250,6 @@ pthread_handler_t handle_slave_io(void *arg) ...@@ -2239,7 +2250,6 @@ pthread_handler_t handle_slave_io(void *arg)
sql_print_error("Failed during slave I/O thread initialization"); sql_print_error("Failed during slave I/O thread initialization");
goto err; goto err;
} }
mi->io_thd = thd;
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd); threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count); pthread_mutex_unlock(&LOCK_thread_count);
...@@ -2530,9 +2540,11 @@ pthread_handler_t handle_slave_sql(void *arg) ...@@ -2530,9 +2540,11 @@ pthread_handler_t handle_slave_sql(void *arg)
thd = new THD; // note that contructor of THD uses DBUG_ ! thd = new THD; // note that contructor of THD uses DBUG_ !
thd->thread_stack = (char*)&thd; // remember where our stack is thd->thread_stack = (char*)&thd; // remember where our stack is
rli->sql_thd= thd;
/* Inform waiting threads that slave has started */ /* Inform waiting threads that slave has started */
rli->slave_run_id++; rli->slave_run_id++;
rli->slave_running = 1;
pthread_detach_this_thread(); pthread_detach_this_thread();
if (init_slave_thread(thd, SLAVE_THD_SQL)) if (init_slave_thread(thd, SLAVE_THD_SQL))
...@@ -2547,7 +2559,6 @@ pthread_handler_t handle_slave_sql(void *arg) ...@@ -2547,7 +2559,6 @@ pthread_handler_t handle_slave_sql(void *arg)
goto err; goto err;
} }
thd->init_for_queries(); thd->init_for_queries();
rli->sql_thd= thd;
thd->temporary_tables = rli->save_temporary_tables; // restore temp tables thd->temporary_tables = rli->save_temporary_tables; // restore temp tables
pthread_mutex_lock(&LOCK_thread_count); pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd); threads.append(thd);
...@@ -2560,7 +2571,6 @@ pthread_handler_t handle_slave_sql(void *arg) ...@@ -2560,7 +2571,6 @@ pthread_handler_t handle_slave_sql(void *arg)
start receiving data so we realize we are not caught up and start receiving data so we realize we are not caught up and
Seconds_Behind_Master grows. No big deal. Seconds_Behind_Master grows. No big deal.
*/ */
rli->slave_running = 1;
rli->abort_slave = 0; rli->abort_slave = 0;
pthread_mutex_unlock(&rli->run_lock); pthread_mutex_unlock(&rli->run_lock);
pthread_cond_broadcast(&rli->start_cond); pthread_cond_broadcast(&rli->start_cond);
......
...@@ -780,8 +780,6 @@ void multi_delete::abort() ...@@ -780,8 +780,6 @@ void multi_delete::abort()
} }
thd->transaction.all.modified_non_trans_table= true; thd->transaction.all.modified_non_trans_table= true;
} }
DBUG_ASSERT(!normal_tables || !deleted ||
thd->transaction.stmt.modified_non_trans_table);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -899,8 +897,6 @@ bool multi_delete::send_eof() ...@@ -899,8 +897,6 @@ bool multi_delete::send_eof()
{ {
query_cache_invalidate3(thd, delete_tables, 1); query_cache_invalidate3(thd, delete_tables, 1);
} }
DBUG_ASSERT(!normal_tables || !deleted ||
thd->transaction.stmt.modified_non_trans_table);
if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table) if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table)
{ {
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
......
...@@ -1203,7 +1203,7 @@ multi_update::multi_update(TABLE_LIST *table_list, ...@@ -1203,7 +1203,7 @@ multi_update::multi_update(TABLE_LIST *table_list,
tmp_tables(0), updated(0), found(0), fields(field_list), tmp_tables(0), updated(0), found(0), fields(field_list),
values(value_list), table_count(0), copy_field(0), values(value_list), table_count(0), copy_field(0),
handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1), handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1),
transactional_tables(1), ignore(ignore_arg), error_handled(0) transactional_tables(0), ignore(ignore_arg), error_handled(0)
{} {}
...@@ -1718,7 +1718,7 @@ void multi_update::abort() ...@@ -1718,7 +1718,7 @@ void multi_update::abort()
if (trans_safe) if (trans_safe)
{ {
DBUG_ASSERT(transactional_tables); DBUG_ASSERT(!updated || transactional_tables);
(void) ha_autocommit_or_rollback(thd, 1); (void) ha_autocommit_or_rollback(thd, 1);
} }
else else
......
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