mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02:00
Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit
The problem is that the query cache was storing partial results if the statement failed when sending the results to the client. This could cause clients to hang when trying to read the results from the cache as they would, for example, wait indefinitely for a eof packet that wasn't saved. The solution is to always discard the caching of a query that failed to send its results to the associated client. mysql-test/r/query_cache_notembedded.result: Add test case result for Bug#40264 mysql-test/t/query_cache_notembedded.test: Add test case for Bug#40264 sql/sql_cache.cc: Abort if a unreported error was raised.
This commit is contained in:
parent
bdec5458ae
commit
ecfdc3560c
3 changed files with 53 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue