From 48450d8a2b7a4e50d8642c1f6fb9415eac5f2e12 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Dec 2005 18:02:36 +0400 Subject: Fix for bug #15225 (ANALYZE temporary has no effect) mysql-test/r/analyze.result: test result fixed mysql-test/t/analyze.test: test case added sql/sql_table.cc: we don't need to remove temporary table from the cache, but we need to reload it's info --- sql/sql_table.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sql') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 294c59af90f..d582c36a4f4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2140,10 +2140,15 @@ send_result_message: table->table->version=0; // Force close of table else if (open_for_modify) { - pthread_mutex_lock(&LOCK_open); - remove_table_from_cache(thd, table->table->table_cache_key, - table->table->real_name, RTFC_NO_FLAG); - pthread_mutex_unlock(&LOCK_open); + if (table->table->tmp_table) + table->table->file->info(HA_STATUS_CONST); + else + { + pthread_mutex_lock(&LOCK_open); + remove_table_from_cache(thd, table->table->table_cache_key, + table->table->real_name, RTFC_NO_FLAG); + pthread_mutex_unlock(&LOCK_open); + } /* May be something modified consequently we have to invalidate cache */ query_cache_invalidate3(thd, table->table, 0); } -- cgit v1.2.1