Bug #31594 Query Cache fail to register tables because of trivial coding misstake.
Submitted: 15 Oct 2007 8:05 Modified: 5 Dec 2007 17:08
Reporter: Kristofer Pettersson Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Query Cache Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: Kristofer Pettersson CPU Architecture:Any

[15 Oct 2007 8:05] Kristofer Pettersson
Description:
In function register_all_tables there is a check for success on the call to register_tables_from_list. This function has failed if it returns 0 (representing the number of the next table entry position). 

How to repeat:
Try to cache any query with basic tables!

Suggested fix:
Trivial fix: 
-if (n)
+if (n==0)
  {
    DBUG_PRINT("qcache", ("failed at table %d", (int) n));
[15 Oct 2007 9:46] 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:

  http://lists.mysql.com/commits/35550

ChangeSet@1.2538, 2007-10-15 11:48:38+02:00, thek@adventure.(none) +1 -0
  Bug #31594 Query Cache fail to register tables because of trivial coding misstake.
  
  In function register_all_tables there is a check for success on the call to
  register_tables_from_list. This function has failed if it returns 0 (representing the
  number of the next table entry position).
[29 Oct 2007 17:35] Kristofer Pettersson
Creating a test case where this coding error actually makes a difference turns out to be surprisingly difficult. Although the code is wrong per design, it doesn't mean we have a bug here. Setting status to unverified.