For specific query digests, we want to disable the caching behaviour for empty resultsets by setting cache_empty_result to "0".
{
rule_id=1
active=1
digest="0x12345678ABCDEF"
apply=1
cache_ttl=10000
cache_empty_result=0
},
When looking at the stats_mysql_query_digest table, it looks like nothing is cached. There are no records with hostgroup -1, indicating that nothing is served from the cache, even though there are non-empty results.
Looking at the code in MySQL_Session.cpp, it seems to me that it's missing a check for cache_empty_result==0. So, it's possible to enable the caching of empty results for individual rules when the global setting is disabled, but not the other way around.