summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2013-05-23 17:05:31 +0300
committerunknown <sanja@montyprogram.com>2013-05-23 17:05:31 +0300
commitb9ce8572d91aaaf1c6abcb6a1fa375f1d76bdf94 (patch)
tree2c972a70abcc68843ec53d7c3c6ab43749563c3c /sql/sql_cache.cc
parent7ba2ff93ac647c5d3517c6eb79f9f63848c9fed2 (diff)
downloadmariadb-git-b9ce8572d91aaaf1c6abcb6a1fa375f1d76bdf94.tar.gz
MDEV-4520: Assertion `0' fails in Query_cache::end_of_result on concurrent drop event and event execution
If there is no net.vio then query cache cant't get data via net_real_write() so it is better just do not try to cache such query.
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 1e5c99822ff..10cdadd5d95 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -4000,7 +4000,8 @@ Query_cache::is_cacheable(THD *thd, LEX *lex,
if (thd->lex->safe_to_cache_query &&
(thd->variables.query_cache_type == 1 ||
(thd->variables.query_cache_type == 2 && (lex->select_lex.options &
- OPTION_TO_QUERY_CACHE))))
+ OPTION_TO_QUERY_CACHE))) &&
+ thd->net.vio)
{
DBUG_PRINT("qcache", ("options: %lx %lx type: %u",
(long) OPTION_TO_QUERY_CACHE,
@@ -4022,11 +4023,12 @@ Query_cache::is_cacheable(THD *thd, LEX *lex,
}
DBUG_PRINT("qcache",
- ("not interesting query: %d or not cacheable, options %lx %lx type: %u",
+ ("not interesting query: %d or not cacheable, options %lx %lx type: %u net->vio present: %u",
(int) lex->sql_command,
(long) OPTION_TO_QUERY_CACHE,
(long) lex->select_lex.options,
- (int) thd->variables.query_cache_type));
+ (int) thd->variables.query_cache_type,
+ (uint) test(thd->net.vio)));
DBUG_RETURN(0);
}