1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Fixed bug in query cache after temporary table creation.

Docs/manual.texi:
  change log entry
mysql-test/r/query_cache.result:
  bug test suite
mysql-test/t/query_cache.test:
  bug test suite
This commit is contained in:
unknown
2002-08-07 15:29:49 +03:00
parent 6d122d5b8f
commit f9dac8752e
4 changed files with 41 additions and 3 deletions

View File

@@ -2395,7 +2395,6 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
DBUG_ENTER("Query_cache::is_cacheable");
if (lex->sql_command == SQLCOM_SELECT &&
thd->temporary_tables == 0 &&
(thd->variables.query_cache_type == 1 ||
(thd->variables.query_cache_type == 2 && (lex->select->options &
OPTION_TO_QUERY_CACHE))) &&
@@ -2416,9 +2415,11 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
has_transactions = (has_transactions ||
tables_used->table->file->has_transactions());
if (tables_used->table->db_type == DB_TYPE_MRG_ISAM)
if (tables_used->table->db_type == DB_TYPE_MRG_ISAM ||
tables_used->table->tmp_table != NO_TMP_TABLE)
{
DBUG_PRINT("qcache", ("select not cacheable: used MRG_ISAM table(s)"));
DBUG_PRINT("qcache",
("select not cacheable: used MRG_ISAM or temporary table(s)"));
DBUG_RETURN(0);
}
if (tables_used->table->db_type == DB_TYPE_MRG_MYISAM)