1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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

into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
This commit is contained in:
unknown
2008-03-05 09:42:26 +01:00
37 changed files with 477 additions and 21 deletions

View File

@ -2896,6 +2896,9 @@ void set_slave_thread_default_charset(THD* thd, RELAY_LOG_INFO *rli)
static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
{
DBUG_ENTER("init_slave_thread");
#if !defined(DBUG_OFF)
int simulate_error= 0;
#endif
thd->system_thread = (thd_type == SLAVE_THD_SQL) ?
SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO;
thd->security_ctx->skip_grants();
@ -2915,10 +2918,17 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
thd->thread_id = thread_id++;
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())
#endif
{
thd->cleanup();
delete thd;
DBUG_RETURN(-1);
}
@ -3516,6 +3526,7 @@ slave_begin:
thd= new THD; // note that contructor of THD uses DBUG_ !
THD_CHECK_SENTRY(thd);
mi->io_thd = thd;
pthread_detach_this_thread();
thd->thread_stack= (char*) &thd; // remember where our stack is
@ -3526,7 +3537,6 @@ slave_begin:
sql_print_error("Failed during slave I/O thread initialization");
goto err;
}
mi->io_thd = thd;
pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);
pthread_mutex_unlock(&LOCK_thread_count);
@ -3866,9 +3876,11 @@ slave_begin:
thd = new THD; // note that contructor of THD uses DBUG_ !
thd->thread_stack = (char*)&thd; // remember where our stack is
rli->sql_thd= thd;
/* Inform waiting threads that slave has started */
rli->slave_run_id++;
rli->slave_running = 1;
pthread_detach_this_thread();
if (init_slave_thread(thd, SLAVE_THD_SQL))
@ -3883,7 +3895,6 @@ slave_begin:
goto err;
}
thd->init_for_queries();
rli->sql_thd= thd;
thd->temporary_tables = rli->save_temporary_tables; // restore temp tables
pthread_mutex_lock(&LOCK_thread_count);
threads.append(thd);
@ -3896,7 +3907,6 @@ slave_begin:
start receiving data so we realize we are not caught up and
Seconds_Behind_Master grows. No big deal.
*/
rli->slave_running = 1;
rli->abort_slave = 0;
pthread_mutex_unlock(&rli->run_lock);
pthread_cond_broadcast(&rli->start_cond);

View File

@ -730,8 +730,6 @@ void multi_delete::send_error(uint errcode,const char *err)
}
thd->transaction.all.modified_non_trans_table= true;
}
DBUG_ASSERT(!normal_tables || !deleted ||
thd->transaction.stmt.modified_non_trans_table);
DBUG_VOID_RETURN;
}
@ -839,8 +837,6 @@ bool multi_delete::send_eof()
{
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 (mysql_bin_log.is_open())

View File

@ -979,7 +979,7 @@ multi_update::multi_update(TABLE_LIST *table_list,
tmp_tables(0), updated(0), found(0), fields(field_list),
values(value_list), table_count(0), copy_field(0),
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)
{}
@ -1482,7 +1482,7 @@ void multi_update::send_error(uint errcode,const char *err)
if (trans_safe)
{
DBUG_ASSERT(transactional_tables);
DBUG_ASSERT(!updated || transactional_tables);
(void) ha_autocommit_or_rollback(thd, 1);
}
else