summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-01-07 16:41:09 +0400
committerunknown <hf@deer.(none)>2004-01-07 16:41:09 +0400
commit902c361910cdec368c5baec1be6079978a46f1a8 (patch)
tree344ec2a77b98d518354cc4178e4801ea2ddf2def /sql/sql_cache.cc
parentfae79aeca552593a830cb95e77ecb32a012faf70 (diff)
downloadmariadb-git-902c361910cdec368c5baec1be6079978a46f1a8.tar.gz
SCRUM
WL#1246 (Query cache in embedded library) Some fixes after testing libmysqld/emb_qcache.cc: code added to check if the recordset has no rows sql/sql_cache.cc: this code should not work if the query isn't cacheable
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index aad8d0a5d2c..7c31281c926 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -653,10 +653,6 @@ void query_cache_abort(NET *net)
void query_cache_end_of_result(THD *thd)
{
DBUG_ENTER("query_cache_end_of_result");
-#ifdef EMBEDDED_LIBRARY
- query_cache_insert(&thd->net, (byte*)thd,
- emb_count_querycache_size(thd));
-#endif
#ifndef DBUG_OFF
// Check if we have called query_cache.wreck() (which disables the cache)
@@ -665,6 +661,10 @@ void query_cache_end_of_result(THD *thd)
if (thd->net.query_cache_query != 0) // Quick check on unlocked structure
{
+#ifdef EMBEDDED_LIBRARY
+ query_cache_insert(&thd->net, (byte*)thd,
+ emb_count_querycache_size(thd));
+#endif
STRUCT_LOCK(&query_cache.structure_guard_mutex);
Query_cache_block *query_block = ((Query_cache_block*)
thd->net.query_cache_query);