Commit 5cf5a9a1 authored by Michael Widenius's avatar Michael Widenius

Fixed timing failure in myisam-metadata.test

mysql-test/include/wait_show_condition.inc:
  Print failing statement if timeout
mysql-test/r/myisam-metadata.result:
  Updated DBUG_SYNC
mysql-test/t/myisam-metadata.test:
  Updated DBUG_SYNC.
  Removed wait_show_condtion, as this is not needed when we use DBUG_SYNC
  This should fix timing issues with the test
mysys/thr_mutex.c:
  Added comments
sql/sql_acl.cc:
  atoi -> atoll()  (Safety)
storage/myisam/ha_myisam.cc:
  Send signal before mi_repair_by_sort.
parent 64e53a0f
......@@ -127,5 +127,6 @@ if (!$found)
echo # field : $field;
echo # condition : $condition;
echo # max_run_time : $max_run_time;
eval $show_statement;
}
......@@ -5,7 +5,7 @@ a VARCHAR(100),
INDEX(a)
) ENGINE=MyISAM;
ALTER TABLE t1 DISABLE KEYS;
SET debug_sync= 'myisam_after_repair_by_sort SIGNAL waiting WAIT_FOR go';
SET debug_sync= 'myisam_before_repair_by_sort SIGNAL waiting WAIT_FOR go';
ALTER TABLE t1 ENABLE KEYS;
SET debug_sync= 'now WAIT_FOR waiting';
SET debug_sync= 'now SIGNAL go';
......
......@@ -30,16 +30,11 @@ while ($1)
--enable_query_log
--connect(con1,localhost,root,,)
SET debug_sync= 'myisam_after_repair_by_sort SIGNAL waiting WAIT_FOR go';
SET debug_sync= 'myisam_before_repair_by_sort SIGNAL waiting WAIT_FOR go';
send
ALTER TABLE t1 ENABLE KEYS;
--connection default
--let $wait_timeout=60
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= = 'Repair by sorting'
--source include/wait_show_condition.inc
SET debug_sync= 'now WAIT_FOR waiting';
SET debug_sync= 'now SIGNAL go';
......
......@@ -132,7 +132,7 @@ void safe_mutex_global_init(void)
#ifdef SAFE_MUTEX_DETECT_DESTROY
safe_mutex_create_root= 0;
#endif
#endif /* SAFE_MUTEX_DETECT_DESTROY */
}
static inline void remove_from_active_list(safe_mutex_t *mp)
......@@ -553,7 +553,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
"on %s at %s, line %d\n",
error, errno, mp->name, file, line);
}
#endif
#endif /* EXTRA_DEBUG */
pthread_mutex_lock(&mp->global);
/* Restore state as it was before */
mp->thread= save_state.thread;
......@@ -612,7 +612,7 @@ int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
error=1;
if (pthread_mutex_destroy(&mp->mutex))
error=1;
#endif
#endif /* __WIN__ */
mp->file= 0; /* Mark destroyed */
#ifdef SAFE_MUTEX_DETECT_DESTROY
......@@ -838,7 +838,7 @@ static void print_deadlock_warning(safe_mutex_t *new_mutex,
DBUG_VOID_RETURN;
}
#elif defined(MY_PTHREAD_FASTMUTEX)
#elif defined(MY_PTHREAD_FASTMUTEX) /* !SAFE_MUTEX_DEFINED */
static ulong mutex_delay(ulong delayloops)
{
......@@ -922,4 +922,4 @@ void fastmutex_global_init(void)
#endif
}
#endif /* defined(MY_PTHREAD_FASTMUTEX) */
#endif /* defined(MY_PTHREAD_FASTMUTEX) && defined(SAFE_MUTEX_DEFINED) */
......@@ -968,7 +968,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
{
/* Starting from 5.0.3 we have max_user_connections field */
ptr= get_field(thd->mem_root, table->field[next_field++]);
user.user_resource.user_conn= ptr ? atoi(ptr) : 0;
user.user_resource.user_conn= ptr ? atoll(ptr) : 0;
}
if (table->s->fields >= 41)
......
......@@ -1126,9 +1126,9 @@ int ha_myisam::repair(THD *thd, HA_CHECK &param, bool do_optimize)
else
{
thd_proc_info(thd, "Repair by sorting");
DEBUG_SYNC(thd, "myisam_before_repair_by_sort");
error = mi_repair_by_sort(&param, file, fixed_name,
test(param.testflag & T_QUICK));
DEBUG_SYNC(thd, "myisam_after_repair_by_sort");
}
if (error && file->create_unique_index_by_sort &&
share->state.dupp_key != MAX_KEY)
......
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