1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

merge 5.1->5.2

This commit is contained in:
Sergei Golubchik
2010-06-01 21:52:20 +02:00
1860 changed files with 994770 additions and 11963 deletions

View File

@@ -1525,6 +1525,7 @@ void close_temporary_tables(THD *thd)
{
if (is_user_table(table))
{
bool save_thread_specific_used= thd->thread_specific_used;
my_thread_id save_pseudo_thread_id= thd->variables.pseudo_thread_id;
/* Set pseudo_thread_id to be that of the processed table */
thd->variables.pseudo_thread_id= tmpkeyval(thd, table);
@@ -1554,6 +1555,7 @@ void close_temporary_tables(THD *thd)
thd->clear_error();
CHARSET_INFO *cs_save= thd->variables.character_set_client;
thd->variables.character_set_client= system_charset_info;
thd->thread_specific_used= TRUE;
Query_log_event qinfo(thd, s_query.ptr(),
s_query.length() - 1 /* to remove trailing ',' */,
0, FALSE, 0);
@@ -1566,6 +1568,7 @@ void close_temporary_tables(THD *thd)
"Failed to write the DROP statement for temporary tables to binary log");
}
thd->variables.pseudo_thread_id= save_pseudo_thread_id;
thd->thread_specific_used= save_thread_specific_used;
}
else
{
@@ -2189,6 +2192,7 @@ void wait_for_condition(THD *thd, pthread_mutex_t *mutex, pthread_cond_t *cond)
proc_info=thd->proc_info;
thd_proc_info(thd, "Waiting for table");
DBUG_ENTER("wait_for_condition");
DEBUG_SYNC(thd, "waiting_for_table");
if (!thd->killed)
(void) pthread_cond_wait(cond, mutex);
@@ -4626,7 +4630,20 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags)
safe_to_ignore_table= prelock_handler.safely_trapped_errors();
}
else
{
tables->table= open_table(thd, tables, &new_frm_mem, &refresh, flags);
/*
Skip further processing if there has been a fatal error while
trying to open a table. For example, this might happen due to
stack shortage, unknown definer in views, etc.
*/
if (!tables->table && thd->is_error())
{
result= -1;
goto err;
}
}
}
else
DBUG_PRINT("tcache", ("referenced table: '%s'.'%s' 0x%lx",