1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/dlenev/src/mysql-5.0-bg13525
This commit is contained in:
dlenev@mysql.com
2006-02-27 20:00:03 +03:00
98 changed files with 12330 additions and 729 deletions

View File

@ -368,6 +368,15 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
DESCRIPTION
Marks all tables in the list which were used by current substatement
(they are marked by its query_id) as free for reuse.
NOTE
The reason we reset query_id is that it's not enough to just test
if table->query_id != thd->query_id to know if a table is in use.
For example
SELECT f1_that_uses_t1() FROM t1;
In f1_that_uses_t1() we will see one instance of t1 where query_id is
set to query_id of original query.
*/
static void mark_used_tables_as_free_for_reuse(THD *thd, TABLE *table)
@ -678,11 +687,11 @@ void close_temporary_tables(THD *thd)
*/
TABLE_LIST *find_table_in_list(TABLE_LIST *table,
uint offset,
st_table_list *TABLE_LIST::*link,
const char *db_name,
const char *table_name)
{
for (; table; table= *(TABLE_LIST **) ((char*) table + offset))
for (; table; table= table->*link )
{
if ((table->table == 0 || table->table->s->tmp_table == NO_TMP_TABLE) &&
strcmp(table->db, db_name) == 0 &&