summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-08-07 15:29:49 +0300
committerunknown <bell@sanja.is.com.ua>2002-08-07 15:29:49 +0300
commitf9dac8752ed0299dd408cbaa74aa8c0736e1fd38 (patch)
treef4362d42cdf3aa21656f7c1abc59516c9f8336f7 /sql/sql_cache.cc
parent6d122d5b8fbc79fcec1d57e764e9eedb591eed01 (diff)
downloadmariadb-git-f9dac8752ed0299dd408cbaa74aa8c0736e1fd38.tar.gz
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
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 7b5e1bf4e59..6cfcff8a7ff 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -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)