Bug #35749 Test 'query_cache_debug' fails with "Unknown thread id: 0"
Submitted: 1 Apr 2008 17:49 Modified: 12 Apr 2008 13:39
Reporter: Kent Boortz Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Query Cache Severity:S2 (Serious)
Version: OS:FreeBSD (6.0)
Assigned to: Kent Boortz CPU Architecture:Any
Triage: D3 (Medium)

[1 Apr 2008 17:49] Kent Boortz
Running a debug enabled "mysqld" (mysqld-debug) on
FreeBSD 6.0 x86 32bit makes the test 'query_cache_debug'
fail with

main.query_cache_debug         [ fail ]

mysqltest: At line 36: query 'kill query @thread_id' failed: 1094: Unknown thread id: 0

The result from queries just before the failure was:
< snip >
set global query_cache_size= 1024*1024*512;
Warning 1282    Query cache failed to set size 536870912; new query cache size is 0
drop table if exists t1;
create table t1 (a varchar(100));
insert into t1 values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
Activate debug hook and attempt to retrieve the statement from the cache.
set session debug='+d,wait_in_query_cache_insert';
select SQL_CACHE * from t1;;
Timeout in wait_condition.inc for select count(*)= 1 from information_schema.processlist where state= 'wait_in_query_cache_insert'
On a second connection; clear the query cache.
show status like 'Qcache_queries_in_cache';
Variable_name   Value
Qcache_queries_in_cache 0
set global query_cache_size= 0;
Signal the debug hook to release the lock.
select id from information_schema.processlist where state='wait_in_query_cache_insert' into @thread_id;
Warning 1329    No data - zero rows fetched, selected, or processed
kill query @thread_id;

How to repeat:
Run the test case using a debug enabled "mysqld"
[1 Apr 2008 22:43] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:


ChangeSet@1.2564, 2008-04-02 00:43:17+02:00, kent@mysql.com +5 -0
    Corrects build problems embedded on Windows
    Install .sym or mysqld-debug if exists
  query_cache_debug.test, query_cache_debug.result:
    Set more resonable query cache size (bug#35749)
    Added missing stacktrace.c
[12 Apr 2008 13:39] Jon Stephens
Change in testing only, no user changes to document. Closed w/o further action.
[1 May 2008 6:16] Bugs System
Pushed into 5.1.25-rc
[1 May 2008 6:19] Bugs System
Pushed into 6.0.6-alpha