diff -wbBdu -u --recursive /s/src/mysql-5.1.47/sql/sql_base.cc sql/sql_base.cc --- /s/src/mysql-5.1.47/sql/sql_base.cc 2010-05-06 08:27:31.000000000 -0700 +++ sql/sql_base.cc 2011-03-28 13:22:39.000000000 -0700 @@ -2187,6 +2187,10 @@ mutex is unlocked */ +fprintf(stderr, "sleeping in wait_for_condition\n"); +my_sleep(15000000); +fprintf(stderr, "done sleeping in wait_for_condition\n"); + pthread_mutex_unlock(mutex); pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; @@ -2839,7 +2843,9 @@ if (table->in_use != thd) { /* wait_for_conditionwill unlock LOCK_open for us */ +fprintf(stderr, "start wait_for_cond\n"); wait_for_condition(thd, &LOCK_open, &COND_refresh); +fprintf(stderr, "stop wait_for_cond\n"); } else { diff -wbBdu -u --recursive /s/src/mysql-5.1.47/sql/sql_class.cc sql/sql_class.cc --- /s/src/mysql-5.1.47/sql/sql_class.cc 2010-05-06 08:27:31.000000000 -0700 +++ sql/sql_class.cc 2011-03-28 13:13:50.000000000 -0700 @@ -407,7 +407,11 @@ str.append(proc_info); } + // DBUG_EXECUTE_IF("sleep_before_lock_thd_data", { fprintf(stderr, "start sleep_before_lock_thd_data\n"); my_sleep(5000000); fprintf(stderr, "stop sleep_before_lock_thd_data\n");}); + + DBUG_EXECUTE_IF("sleep_before_lock_thd_data", fprintf(stderr, "locking LOCK_thd_data\n"); ); pthread_mutex_lock(&thd->LOCK_thd_data); + // DBUG_EXECUTE_IF("sleep_before_lock_thd_data", fprintf(stderr, "locked LOCK_thd_data\n"); ); if (thd->query()) { @@ -420,6 +424,7 @@ } pthread_mutex_unlock(&thd->LOCK_thd_data); + DBUG_EXECUTE_IF("sleep_before_lock_thd_data", fprintf(stderr, "unlocked LOCK_thd_data\n"); ); if (str.c_ptr_safe() == buffer) return buffer; @@ -1144,9 +1149,12 @@ */ if (mysys_var->current_cond && mysys_var->current_mutex) { + // DBUG_EXECUTE_IF("sleep_before_kill_lock_open", {fprintf(stderr, "start sleep_before_kill_lock_open\n"); my_sleep(6000000); fprintf(stderr, "stop sleep_before_kill_lock_open\n");}); +fprintf(stderr, "start ::awake, lock mutex\n"); pthread_mutex_lock(mysys_var->current_mutex); pthread_cond_broadcast(mysys_var->current_cond); pthread_mutex_unlock(mysys_var->current_mutex); +fprintf(stderr, "start ::awake, unlock mutex\n"); } pthread_mutex_unlock(&mysys_var->mutex); } diff -wbBdu -u --recursive /s/src/mysql-5.1.47/sql/sql_rename.cc sql/sql_rename.cc --- /s/src/mysql-5.1.47/sql/sql_rename.cc 2010-05-06 08:27:32.000000000 -0700 +++ sql/sql_rename.cc 2011-03-28 12:51:29.000000000 -0700 @@ -175,6 +175,10 @@ */ pthread_mutex_unlock(&LOCK_open); +fprintf(stderr, "start rename_sleep\n"); +my_sleep(5000000); +fprintf(stderr, "stop rename_sleep\n"); + if (!silent && !error) { binlog_error= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); diff -wbBdu -u --recursive /s/src/mysql-5.1.47/sql/sql_table.cc sql/sql_table.cc --- /s/src/mysql-5.1.47/sql/sql_table.cc 2010-05-06 08:27:36.000000000 -0700 +++ sql/sql_table.cc 2011-03-28 13:14:52.000000000 -0700 @@ -1902,7 +1902,9 @@ mysql_ha_rm_tables(thd, tables, FALSE); +fprintf(stderr, "rm_table_part2 pre_lock\n"); pthread_mutex_lock(&LOCK_open); +fprintf(stderr, "rm_table_part2 locked\n"); /* Disable drop of enabled log tables, must be done before name locking */ for (table= tables; table; table= table->next_local) @@ -2050,8 +2052,12 @@ *(end= path + path_length - reg_ext_length)= '\0'; DBUG_PRINT("info", ("deleting table of type %d", (table_type ? table_type->db_type : 0))); +fprintf(stderr, "sleep rm_table_part2 calling ha_delete_table\n"); +my_sleep(5000000); +fprintf(stderr, "start rm_table_part2 calling ha_delete_table\n"); error= ha_delete_table(thd, table_type, path, db, table->table_name, !dont_log_query); +fprintf(stderr, "stop rm_table_part2 calling ha_delete_table\n"); /* No error if non existent table and 'IF EXIST' clause or view */ if ((error == ENOENT || error == HA_ERR_NO_SUCH_TABLE) && @@ -2093,6 +2099,7 @@ on the table name. */ pthread_mutex_unlock(&LOCK_open); +fprintf(stderr, "rm_table_part2 unlocked\n"); DEBUG_SYNC(thd, "rm_table_part2_before_binlog"); thd->thread_specific_used|= tmp_table_deleted; error= 0;