Commit 4465539a authored by unknown's avatar unknown

Fixed bug with FLUSH TABLES when using temporary tables


Docs/manual.texi:
  Fixed typos
parent 4ec76c1d
...@@ -21486,7 +21486,7 @@ aborting the write. ...@@ -21486,7 +21486,7 @@ aborting the write.
@item @code{open_files_limit} @item @code{open_files_limit}
If this is not 0, then @code{mysqld} will use this value to reserve file If this is not 0, then @code{mysqld} will use this value to reserve file
descriptors to use with @code{getrlimit()}. If this value is 0 then descriptors to use with @code{setrlimit()}. If this value is 0 then
@code{mysqld} will reserve @code{max_connections*5} or @code{mysqld} will reserve @code{max_connections*5} or
@code{max_connections + table_cache*2} (whichever is larger) number of @code{max_connections + table_cache*2} (whichever is larger) number of
files. You should try increasing this if @code{mysqld} gives you the files. You should try increasing this if @code{mysqld} gives you the
...@@ -42652,8 +42652,8 @@ MySQL 3.23 version). ...@@ -42652,8 +42652,8 @@ MySQL 3.23 version).
@item @item
Fixed buffer overflow bug when writing a certain error message. Fixed buffer overflow bug when writing a certain error message.
@item @item
Added usage of @code{getrlimit()} on Linux to get @code{-O Added usage of @code{setrlimit()} on Linux to get
--open-files-limit=#} to work on Linux. @code{-O --open-files-limit=#} to work on Linux.
@item @item
Added new @code{mysqld} variable: @code{bdb_version}. Added new @code{mysqld} variable: @code{bdb_version}.
@item @item
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
TABLE *unused_tables; /* Used by mysql_test */ TABLE *unused_tables; /* Used by mysql_test */
HASH open_cache; /* 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, static int open_unireg_entry(THD *thd,TABLE *entry,const char *db,
const char *name, const char *alias, bool locked); const char *name, const char *alias, bool locked);
static bool insert_fields(THD *thd,TABLE_LIST *tables, const char *table_name, static bool insert_fields(THD *thd,TABLE_LIST *tables, const char *table_name,
...@@ -1314,13 +1312,6 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, ...@@ -1314,13 +1312,6 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
DBUG_RETURN(1); 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 ** open all tables in list
*****************************************************************************/ *****************************************************************************/
...@@ -1348,13 +1339,13 @@ int open_tables(THD *thd,TABLE_LIST *start) ...@@ -1348,13 +1339,13 @@ int open_tables(THD *thd,TABLE_LIST *start)
pthread_mutex_lock(&LOCK_open); pthread_mutex_lock(&LOCK_open);
// if query_id is not reset, we will get an error // if query_id is not reset, we will get an error
// re-opening a temp table // re-opening a temp table
reset_query_id_on_temp_tables(thd);
thd->version=refresh_version; thd->version=refresh_version;
TABLE **prev_table= &thd->open_tables; TABLE **prev_table= &thd->open_tables;
bool found=0; bool found=0;
for (TABLE_LIST *tmp=start ; tmp ; tmp=tmp->next) 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 || if (tmp->table->version != refresh_version ||
! tmp->table->db_stat) ! tmp->table->db_stat)
......
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