Commit be07cbe2 authored by Kristofer Pettersson's avatar Kristofer Pettersson

Bug#43758 Query cache can lock up threads in 'freeing items' state

This patch corrects a misstake in the test case for bug patch 43658.

There was a race in the test case when the thread id was retrieved from the processlist.
The result was that the same thread id was signalled twice and one thread id wasn't
signalled at all.

The affected platforms appears to be limited to linux.
parent de713f7e
...@@ -141,9 +141,9 @@ KILL QUERY @flush_thread_id; ...@@ -141,9 +141,9 @@ KILL QUERY @flush_thread_id;
** and finally release the mutex. The threads will continue to wait ** and finally release the mutex. The threads will continue to wait
** until a broadcast signal reaches them causing both threads to ** until a broadcast signal reaches them causing both threads to
** come alive and check the condition. ** come alive and check the condition.
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' LIMIT 1 INTO @thread_id; SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id ASC LIMIT 1 INTO @thread_id;
KILL QUERY @thread_id; KILL QUERY @thread_id;
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' LIMIT 1 INTO @thread_id; SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id DESC LIMIT 1 INTO @thread_id;
KILL QUERY @thread_id; KILL QUERY @thread_id;
** **
** Finally signal the DELETE statement on THD1 one last time. ** Finally signal the DELETE statement on THD1 one last time.
......
...@@ -206,10 +206,11 @@ LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.pro ...@@ -206,10 +206,11 @@ LET $wait_condition= SELECT SQL_NO_CACHE COUNT(*)= 1 FROM information_schema.pro
--echo ** and finally release the mutex. The threads will continue to wait --echo ** and finally release the mutex. The threads will continue to wait
--echo ** until a broadcast signal reaches them causing both threads to --echo ** until a broadcast signal reaches them causing both threads to
--echo ** come alive and check the condition. --echo ** come alive and check the condition.
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' LIMIT 1 INTO @thread_id; SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id ASC LIMIT 1 INTO @thread_id;
KILL QUERY @thread_id; KILL QUERY @thread_id;
SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' LIMIT 1 INTO @thread_id; SELECT SQL_NO_CACHE id FROM information_schema.processlist WHERE state='wait_in_query_cache_insert' ORDER BY id DESC LIMIT 1 INTO @thread_id;
KILL QUERY @thread_id; KILL QUERY @thread_id;
--echo ** --echo **
--echo ** Finally signal the DELETE statement on THD1 one last time. --echo ** Finally signal the DELETE statement on THD1 one last time.
--echo ** The stmt will complete the query cache invalidation and return --echo ** The stmt will complete the query cache invalidation and return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment