1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

merge mysql-next-mr --> mysql-5.1-rpl-merge

Conflicts:
  Text conflict in sql/sql_insert.cc
This commit is contained in:
Alfranio Correia
2010-01-14 16:02:55 +00:00
286 changed files with 27080 additions and 617 deletions

View File

@ -1821,11 +1821,11 @@ public:
mysql_mutex_init(key_delayed_insert_mutex, &mutex, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_delayed_insert_cond, &cond, NULL);
mysql_cond_init(key_delayed_insert_cond_client, &cond_client, NULL);
pthread_mutex_lock(&LOCK_thread_count);
mysql_mutex_lock(&LOCK_thread_count);
delayed_insert_threads++;
delayed_lock= global_system_variables.low_priority_updates ?
TL_WRITE_LOW_PRIORITY : TL_WRITE;
pthread_mutex_unlock(&LOCK_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
DBUG_VOID_RETURN;
}
~Delayed_insert()
@ -1836,7 +1836,7 @@ public:
delete row;
if (table)
close_thread_tables(&thd);
pthread_mutex_lock(&LOCK_thread_count);
mysql_mutex_lock(&LOCK_thread_count);
mysql_mutex_destroy(&mutex);
mysql_cond_destroy(&cond);
mysql_cond_destroy(&cond_client);
@ -1845,8 +1845,8 @@ public:
thd.security_ctx->user= thd.security_ctx->host=0;
thread_count--;
delayed_insert_threads--;
pthread_mutex_unlock(&LOCK_thread_count);
pthread_cond_broadcast(&COND_thread_count); /* Tell main we are ready */
mysql_mutex_unlock(&LOCK_thread_count);
mysql_cond_broadcast(&COND_thread_count); /* Tell main we are ready */
}
/* The following is for checking when we can delete ourselves */
@ -1979,9 +1979,9 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list)
{
if (!(di= new Delayed_insert()))
goto end_create;
pthread_mutex_lock(&LOCK_thread_count);
mysql_mutex_lock(&LOCK_thread_count);
thread_count++;
pthread_mutex_unlock(&LOCK_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
di->thd.set_db(table_list->db, (uint) strlen(table_list->db));
di->thd.set_query(my_strdup(table_list->table_name,
MYF(MY_WME | ME_FATALERROR)), 0);
@ -2359,12 +2359,12 @@ pthread_handler_t handle_delayed_insert(void *arg)
pthread_detach_this_thread();
/* Add thread to THD list so that's it's visible in 'show processlist' */
pthread_mutex_lock(&LOCK_thread_count);
mysql_mutex_lock(&LOCK_thread_count);
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
thd->set_current_time();
threads.append(thd);
thd->killed=abort_loop ? THD::KILL_CONNECTION : THD::NOT_KILLED;
pthread_mutex_unlock(&LOCK_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
mysql_thread_set_psi_id(thd->thread_id);