--- sql_cache.old.cc	2013-05-25 20:16:17.429118667 -0300
+++ sql_cache.cc	2013-05-25 20:03:25.415719221 -0300
@@ -1114,6 +1114,7 @@
 
   header->result(result);
   header->last_pkt_nr= pkt_nr;
+  header->query_hits_counter= 0;
   BLOCK_UNLOCK_WR(query_block);
   DBUG_EXECUTE("check_querycache",check_integrity(0););
 
@@ -1162,6 +1163,8 @@
   Query_cache_block *query_block;
   Query_cache_tls *query_cache_tls= &thd->query_cache_tls;
   ulonglong limit_found_rows= thd->limit_found_rows;
+  my_hrtime_t unow= my_hrtime();
+
   DBUG_ENTER("Query_cache::end_of_result");
 
   /* See the comment on double-check locking usage above. */
@@ -1223,6 +1226,9 @@
 
     header->found_rows(limit_found_rows);
     header->result()->type= Query_cache_block::RESULT;
+    header->select_rows_read  =thd->examined_row_count;
+    header->select_expend_time=(unow.val - (thd->start_time * HRTIME_RESOLUTION + thd->start_time_sec_part));
+    header->select_lock_time  =(thd->utime_after_lock - thd->start_utime);
 
     /* Drop the writer. */
     header->writer(0);
@@ -1364,6 +1370,7 @@
   const char *query;
   size_t query_length;
   uint8 tables_type;
+
   DBUG_ENTER("Query_cache::store_query");
   /*
     Testing 'query_cache_size' without a lock here is safe: the thing
@@ -1549,9 +1556,18 @@
         inserts++;
         queries_in_cache++;
         thd->query_cache_tls.first_query_block= query_block;
+        header->query_hits_counter=0;
+        header->select_expend_time=0;
+	header->select_lock_time  =0;
+        header->select_rows_read  =0;
+        my_hrtime_t unow= my_hrtime();
+        header->cache_insert_time =unow.val;
+
+
         header->writer(&thd->query_cache_tls);
         header->tables_type(tables_type);
 
+
         unlock();
 
         // init_n_lock make query block locked
@@ -1919,6 +1935,7 @@
   BLOCK_LOCK_RD(query_block);
 
   query = query_block->query();
+
   result_block= query->result();
 #ifndef EMBEDDED_LIBRARY
   first_result_block= result_block;
@@ -2041,6 +2058,7 @@
       DBUG_PRINT("qcache", ("handler allow caching %s,%s",
                             table_list.db, table_list.alias));
   }
+  query->query_hits_add();
   move_to_query_list_end(query_block);
   hits++;
   unlock();
