summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authormonty@tik.mysql.fi <>2001-03-23 21:16:57 +0200
committermonty@tik.mysql.fi <>2001-03-23 21:16:57 +0200
commitbdb822ef494e23afb9dd08ad098b17b1dbe4eff9 (patch)
tree0224b5560ed980478d0b78f3495e501589067ca8 /sql/sql_base.cc
parent5c497ccf2fbc99c73b424a7e2a0efdd6ce33c85c (diff)
downloadmariadb-git-bdb822ef494e23afb9dd08ad098b17b1dbe4eff9.tar.gz
Fixed bug with FLUSH TABLES when using temporary tables
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 801ef63dcf3..85148de0cfa 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -32,8 +32,6 @@
TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* Used by mysql_test */
-static void reset_query_id_on_temp_tables(THD* thd);
-
static int open_unireg_entry(THD *thd,TABLE *entry,const char *db,
const char *name, const char *alias, bool locked);
static bool insert_fields(THD *thd,TABLE_LIST *tables, const char *table_name,
@@ -1314,13 +1312,6 @@ err:
DBUG_RETURN(1);
}
-
-static void reset_query_id_on_temp_tables(THD* thd)
-{
- for(TABLE* tmp = thd->temporary_tables; tmp; tmp = tmp->next)
- tmp->query_id = 0;
-}
-
/*****************************************************************************
** open all tables in list
*****************************************************************************/
@@ -1348,13 +1339,13 @@ int open_tables(THD *thd,TABLE_LIST *start)
pthread_mutex_lock(&LOCK_open);
// if query_id is not reset, we will get an error
// re-opening a temp table
- reset_query_id_on_temp_tables(thd);
thd->version=refresh_version;
TABLE **prev_table= &thd->open_tables;
bool found=0;
for (TABLE_LIST *tmp=start ; tmp ; tmp=tmp->next)
{
- if (tmp->table)
+ /* Close normal (not temporary) changed tables */
+ if (tmp->table && ! tmp->table->tmp_table)
{
if (tmp->table->version != refresh_version ||
! tmp->table->db_stat)