summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_cache.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 4a521d83192..b55fa148e24 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -710,7 +710,12 @@ void query_cache_end_of_result(THD *thd)
if (thd->net.query_cache_query == 0)
DBUG_VOID_RETURN;
- if (thd->killed)
+ /*
+ Check if the NET layer raised a unreported error -- my_error() and
+ as a consequence query_cache_abort() haven't been called. Abort the
+ cached result as it might be only partially complete.
+ */
+ if (thd->killed || thd->net.report_error)
{
query_cache_abort(&thd->net);
DBUG_VOID_RETURN;