[Commits] Rev 3152: Protect statistic variables of subquery cache. in file:///home/bell/maria/bzr/work-maria-5.3-subquerycachedisk/

sanja at askmonty.org sanja at askmonty.org
Fri Aug 12 11:23:50 EEST 2011


At file:///home/bell/maria/bzr/work-maria-5.3-subquerycachedisk/

------------------------------------------------------------
revno: 3152
revision-id: sanja at askmonty.org-20110812082350-kdhvaffgpxkq00oi
parent: igor at askmonty.org-20110812053441-rrax06kfhjlmkq45
committer: sanja at askmonty.org
branch nick: work-maria-5.3-subquerycachedisk
timestamp: Fri 2011-08-12 11:23:50 +0300
message:
  Protect statistic variables of subquery cache.
-------------- next part --------------
=== modified file 'sql/sql_expression_cache.cc'
--- a/sql/sql_expression_cache.cc	2011-07-28 14:10:29 +0000
+++ b/sql/sql_expression_cache.cc	2011-08-12 08:23:50 +0000
@@ -157,6 +157,10 @@ error:
 
 Expression_cache_tmptable::~Expression_cache_tmptable()
 {
+  /* Add accumulated statistics */
+  statistic_add(subquery_cache_miss, miss, &LOCK_status);
+  statistic_add(subquery_cache_hit, hit, &LOCK_status);
+
   if (cache_table)
     free_tmp_table(table_thd, cache_table);
 }
@@ -188,14 +192,13 @@ Expression_cache::result Expression_cach
                         (uint)cache_table->status, (uint)ref.has_record));
     if ((res= join_read_key2(table_thd, NULL, cache_table, &ref)) == 1)
       DBUG_RETURN(ERROR);
+
     if (res)
     {
-      subquery_cache_miss++;
       miss++;
       DBUG_RETURN(MISS);
     }
 
-    subquery_cache_hit++;
     hit++;
     *value= cached_result;
     DBUG_RETURN(Expression_cache::HIT);



More information about the commits mailing list