Test interaction of different execution modes with query caching