mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
This commit is contained in:
commit
b1e00b6be8
1343 changed files with 951100 additions and 3865 deletions
|
|
@ -3360,80 +3360,6 @@ longlong Item_master_pos_wait::val_int()
|
|||
return event_count;
|
||||
}
|
||||
|
||||
#ifdef EXTRA_DEBUG
|
||||
void debug_sync_point(const char* lock_name, uint lock_timeout)
|
||||
{
|
||||
THD* thd=current_thd;
|
||||
User_level_lock* ull;
|
||||
struct timespec abstime;
|
||||
size_t lock_name_len;
|
||||
lock_name_len= strlen(lock_name);
|
||||
pthread_mutex_lock(&LOCK_user_locks);
|
||||
|
||||
if (thd->ull)
|
||||
{
|
||||
item_user_lock_release(thd->ull);
|
||||
thd->ull=0;
|
||||
}
|
||||
|
||||
/*
|
||||
If the lock has not been aquired by some client, we do not want to
|
||||
create an entry for it, since we immediately release the lock. In
|
||||
this case, we will not be waiting, but rather, just waste CPU and
|
||||
memory on the whole deal
|
||||
*/
|
||||
if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
|
||||
(uchar*) lock_name,
|
||||
lock_name_len))))
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_user_locks);
|
||||
return;
|
||||
}
|
||||
ull->count++;
|
||||
|
||||
/*
|
||||
Structure is now initialized. Try to get the lock.
|
||||
Set up control struct to allow others to abort locks
|
||||
*/
|
||||
thd_proc_info(thd, "User lock");
|
||||
thd->mysys_var->current_mutex= &LOCK_user_locks;
|
||||
thd->mysys_var->current_cond= &ull->cond;
|
||||
|
||||
set_timespec(abstime,lock_timeout);
|
||||
while (ull->locked && !thd->killed)
|
||||
{
|
||||
int error= pthread_cond_timedwait(&ull->cond, &LOCK_user_locks, &abstime);
|
||||
if (error == ETIMEDOUT || error == ETIME)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ull->locked)
|
||||
{
|
||||
if (!--ull->count)
|
||||
delete ull; // Should never happen
|
||||
}
|
||||
else
|
||||
{
|
||||
ull->locked=1;
|
||||
ull->set_thread(thd);
|
||||
thd->ull=ull;
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_user_locks);
|
||||
pthread_mutex_lock(&thd->mysys_var->mutex);
|
||||
thd_proc_info(thd, 0);
|
||||
thd->mysys_var->current_mutex= 0;
|
||||
thd->mysys_var->current_cond= 0;
|
||||
pthread_mutex_unlock(&thd->mysys_var->mutex);
|
||||
pthread_mutex_lock(&LOCK_user_locks);
|
||||
if (thd->ull)
|
||||
{
|
||||
item_user_lock_release(thd->ull);
|
||||
thd->ull=0;
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_user_locks);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
Get a user level lock. If the thread has an old lock this is first released.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue