From: Kristofer Pettersson Date: June 17 2009 2:28pm Subject: bzr commit into mysql-5.1-bugteam branch (kristofer.pettersson:2950) Bug#43758 List-Archive: http://lists.mysql.com/commits/76479 X-Bug: 43758 Message-Id: <0KLD00M1PZY21V90@fe-emea-10.sun.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary_(ID_iQtdwbgLjB5qtflU3q4nug)" --Boundary_(ID_iQtdwbgLjB5qtflU3q4nug) MIME-version: 1.0 Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT Content-disposition: inline #At file:///home/thek/Development/cpp/mysqlbzr/mysql-5.1-bugteam/ based on revid:joro@stripped 2950 Kristofer Pettersson 2009-06-17 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. @ mysql-test/r/query_cache_debug.result 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. @ mysql-test/t/query_cache_debug.test 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. modified: mysql-test/r/query_cache_debug.result mysql-test/t/query_cache_debug.test === modified file 'mysql-test/r/query_cache_debug.result' --- a/mysql-test/r/query_cache_debug.result 2009-06-16 08:34:47 +0000 +++ b/mysql-test/r/query_cache_debug.result 2009-06-17 14:28:11 +0000 @@ -141,9 +141,9 @@ KILL QUERY @flush_thread_id; ** and finally release the mutex. The threads will continue to wait ** until a broadcast signal reaches them causing both threads to ** 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; -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; ** ** Finally signal the DELETE statement on THD1 one last time. === modified file 'mysql-test/t/query_cache_debug.test' --- a/mysql-test/t/query_cache_debug.test 2009-06-16 08:34:47 +0000 +++ b/mysql-test/t/query_cache_debug.test 2009-06-17 14:28:11 +0000 @@ -206,10 +206,11 @@ LET $wait_condition= SELECT SQL_NO_CACHE --echo ** and finally release the mutex. The threads will continue to wait --echo ** until a broadcast signal reaches them causing both threads to --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; -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; + --echo ** --echo ** Finally signal the DELETE statement on THD1 one last time. --echo ** The stmt will complete the query cache invalidation and return --Boundary_(ID_iQtdwbgLjB5qtflU3q4nug) MIME-version: 1.0 Content-type: text/bzr-bundle; CHARSET=US-ASCII; name*0="bzr/kristofer.pettersson@stripped"; name*1=7142811-3z67gk3kkrzp161z.bundle Content-transfer-encoding: 7BIT Content-disposition: inline; filename*0="bzr/kristofer.pettersson@stripped"; filename*1=7142811-3z67gk3kkrzp161z.bundle # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: kristofer.pettersson@stripped\ # 3z67gk3kkrzp161z # target_branch: file:///home/thek/Development/cpp/mysqlbzr/mysql-5.1-\ # bugteam/ # testament_sha1: 09d540295cd4aaae82ef68907b1ed361cfbaa4ba # timestamp: 2009-06-17 16:28:24 +0200 # source_branch: file:///home/thek/Development/cpp/mysqlbzr/5.1-\ # bug39843/ # base_revision_id: joro@stripped # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWUyECwsAAt5fgEAQWeP//39v /qC////wYAcfeTQADJIAk+hVGjRGqn6po00PUDIAaZGQNAAaDIaBiDjJkyYjEwAmTBMgBowjAEMB xkyZMRiYATJgmQA0YRgCGASJFMg1NNMmQBo1GT009UxoNE9TahiPUGg2pQ1R+lHlNPJhRmjU0Gj1 NAABoAABJICaAjQaCGCCAp6mIe9RNQ8pvVD1PypblouP7aMd5Io77+p9/tsitiYJttvylCwnJnTw TJLeQcUylRdetepYxL6mEY2Nk/ujDTYp0A4qdhl9lROWCJTtfTuB6jxBiuBWHKH67zFtBfDWHJCa i2uNXrGQZaoQXnuKLEP2ByC1pB1CX8Pvt/FpIqWDiquFFNMnqJ/DD09abgeEAgvFYq5KKD/kiVgV JQMgmJAML34cOCSiwoTUxWXkJL2bXAERnbppACyjOgi0uyUgdxjqFNC6Af9/oO7spsp7jZEUFUcK J1lFXlpieucSokbQ0iMVDlidUTuHbR1tQL4Oc3wZszIFnFy69SX82E5CmKbxUMhyE5OURxHYaT5b y9E2AkBY8rFG8Dpdhu6dL8pfvgsRRXcA9EFURR5AMBn3VmjCwgyqKkFpEogadq6sJkguVDQVGRPP f3qAFZFFpQgvy42kl5LaSYq2ZSzZiOT9Ex1h3xsJPmqEDOWmg3HkBYunRUotgFzjdjeK0ZTGA9E2 PXaYKBYeRTE0FJF5iPHkoHAktg2cj6W0v2tyNXS6Z21rOs1DWz1L2cigTJFtmnMoKqqyi21o1jkg cBbqMTuqeQYgvDxAjpNBwCRm9cyzDK8ChqzCoZ19XDqjPS6qBnIzOfve8JbKFx2GcDase1eCwJ6K aWcLsArcbmN62GsrkPljXQgdCR5HAtQpmubmZxtDBRTjLAcaCY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