Commit ee3c05ee authored by unknown's avatar unknown

Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  weblab.(none):/home/marcsql/TREE/mysql-5.1-30712


sql/log.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
parents d2f32b10 d480d0ec
...@@ -656,8 +656,14 @@ int Log_to_csv_event_handler:: ...@@ -656,8 +656,14 @@ int Log_to_csv_event_handler::
table= open_performance_schema_table(thd, & table_list, table= open_performance_schema_table(thd, & table_list,
& open_tables_backup); & open_tables_backup);
result= (table ? 0 : 1); if (table)
{
result= 0;
close_performance_schema_table(thd, & open_tables_backup); close_performance_schema_table(thd, & open_tables_backup);
}
else
result= 1;
DBUG_RETURN(result); DBUG_RETURN(result);
} }
......
...@@ -7747,6 +7747,9 @@ open_performance_schema_table(THD *thd, TABLE_LIST *one_table, ...@@ -7747,6 +7747,9 @@ open_performance_schema_table(THD *thd, TABLE_LIST *one_table,
*/ */
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
} }
else
thd->restore_backup_open_tables_state(backup);
thd->utime_after_lock= save_utime_after_lock; thd->utime_after_lock= save_utime_after_lock;
DBUG_RETURN(table); DBUG_RETURN(table);
} }
...@@ -7762,8 +7765,12 @@ void close_performance_schema_table(THD *thd, Open_tables_state *backup) ...@@ -7762,8 +7765,12 @@ void close_performance_schema_table(THD *thd, Open_tables_state *backup)
{ {
bool found_old_table; bool found_old_table;
if (thd->lock) /*
{ If open_performance_schema_table() fails,
this function should not be called.
*/
DBUG_ASSERT(thd->lock != NULL);
/* /*
Note: Note:
We do not create explicitly a separate transaction for the We do not create explicitly a separate transaction for the
...@@ -7777,9 +7784,6 @@ void close_performance_schema_table(THD *thd, Open_tables_state *backup) ...@@ -7777,9 +7784,6 @@ void close_performance_schema_table(THD *thd, Open_tables_state *backup)
*/ */
mysql_unlock_tables(thd, thd->lock); mysql_unlock_tables(thd, thd->lock);
thd->lock= 0; thd->lock= 0;
}
safe_mutex_assert_not_owner(&LOCK_open);
pthread_mutex_lock(&LOCK_open); pthread_mutex_lock(&LOCK_open);
......
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