1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#56822: Add a thread state for sessions waiting on the query cache lock

Only wait for a single debug signal at a time as the signal state
is global. Also, do not activate the query cache debug sync points
if the thread has no associated THD session.
This commit is contained in:
Davi Arnaut
2010-10-08 09:16:20 -03:00
parent 921fd52975
commit 657b157511
3 changed files with 39 additions and 13 deletions

View File

@ -123,16 +123,20 @@ SET DEBUG_SYNC="now WAIT_FOR parked1_1";
** On THD2: Insert a result into the cache. This attempt will be blocked
** because of a debug hook placed just before the mutex lock after which
** the first part of the result set is written.
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2";
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2 EXECUTE 1";
SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3;
=================================== Connection default
** Assert that the SELECT-stmt thread reaches the sync point.
SET DEBUG_SYNC="now WAIT_FOR parked2";
**
**
=================================== Connection thd3
** On THD3: Insert another result into the cache and block on the same
** debug hook.
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3";
SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;;
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3 EXECUTE 1";
SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;
=================================== Connection default
** Assert that the two SELECT-stmt threads to reach the hook.
SET DEBUG_SYNC="now WAIT_FOR parked2";
** Assert that the SELECT-stmt thread reaches the sync point.
SET DEBUG_SYNC="now WAIT_FOR parked3";
**
**