Skip to content
Browse files

save check of cache stats flag

  • Loading branch information...
1 parent 71a7fb6 commit 36b55e390196032fe3d3e5d68eba1ce21b7a60fb @msalvadores msalvadores committed May 22, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/frontend/query-cache.c
View
4 src/frontend/query-cache.c
@@ -115,7 +115,7 @@ int fs_bind_cache_wrapper_intl(fs_query_state *qs, fs_query *q, int all,
/* only consult the cache for optimasation levels 0-2 */
if (q && q->opt_level < 3) goto skip_cache;
- if (q->qs->cache_stats) q->qs->bind_hits++;
+ if (q && q->qs && q->qs->cache_stats) q->qs->bind_hits++;
cachable = 1;
cache_hash += all + flags * 2 + offset * 256 + limit * 32768;
@@ -154,7 +154,7 @@ int fs_bind_cache_wrapper_intl(fs_query_state *qs, fs_query *q, int all,
fsp_hit_limits_add(qs->link, qs->bind_cache[cache_hash].limited);
qs->bind_cache[cache_hash].hits++;
- if (q->qs->cache_stats) q->qs->bind_cache_success++;
+ if (q && q->qs && q->qs->cache_stats) q->qs->bind_cache_success++;
g_static_mutex_unlock(&qs->cache_mutex);
return 0;
}

0 comments on commit 36b55e3

Please sign in to comment.
Something went wrong with that request. Please try again.