Bug #30710 query_cache.test fails on embedded - per-column privs test
Submitted: 29 Aug 2007 22:53 Modified: 24 Oct 2007 19:26
Reporter: Timothy Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Kristofer Pettersson CPU Architecture:Any
Tags: embedded

[29 Aug 2007 22:53] Timothy Smith
Description:
The main.query_cache test fails on 5.1-maint when running with the embedded server.  It is the test for bug #30269.  Something with the permissions checks in embedded seems to be different, causing a query to be cached under embedded which can not be cached with normal server.

The query is performed by a user with column-specific privileges for the table in question.

How to repeat:
See recent mysql-5.1-maint pushbuild results.

main.query_cache               [ fail ]

--- /data0/pushbuild/pb/mysql-5.1-new-maint/744/mysql-5.1-new-maint-exp/mysql-test/r/query_cache.result	2007-08-29 13:57:54.000000000 +0300
+++ /dev/shm/var-embedded-121/log/query_cache.reject	2007-08-29 15:33:17.111487500 +0300
@@ -1670,13 +1670,13 @@
 5
 show status like 'Qcache_queries_in_cache';
 Variable_name	Value
-Qcache_queries_in_cache	0
+Qcache_queries_in_cache	1
 SELECT id FROM view1 WHERE id>2;
 id
 5
 show status like 'Qcache_queries_in_cache';
 Variable_name	Value
-Qcache_queries_in_cache	1
+Qcache_queries_in_cache	2
 DROP DATABASE bug30269;
 DROP USER 'bug30269'@'localhost';
 set GLOBAL query_cache_type=default;

mysqltest: Result content mismatch

Stopping All Servers
Restoring snapshot of databases

Suggested fix:
Ensure that all variables are properly initialized.

See if some permissions checks are being skipped in embedded, which causes the query to appear cacheable.

Preferred is to make embedded behave the same as the stand-alone server.  If that's not possible, then the test should be modified, or moved to query_cache_notembedded.test.

Please re-enable main.query_cache on embedded once this bug is fixed.
[5 Oct 2007 10:09] Magnus BlÄudd
The query_cache.test is currently disabled from being run with embedded server.
[14 Oct 2007 16:52] 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/35532

ChangeSet@1.2575, 2007-10-14 18:54:31+02:00, thek@adventure.(none) +1 -0
  Bug#30710 query_cache.test fails on embedded - per-column privs test
  
  The embedded version of the server doesn't use column level grants, and 
  the compile directive NO_EMBEDDED_ACCESS_CHECKS should be checked instead of
  the redundant HAVE_QUERY_CACHE (which is always the case) to determine if 
  column level grants should be compiled or not.
[16 Oct 2007 12:41] 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/35646

ChangeSet@1.2575, 2007-10-16 14:42:42+02:00, thek@adventure.(none) +5 -0
  Bug#30710 query_cache.test fails on embedded - per-column privs test
  
  The embedded version of the server doesn't use column level grants, and 
  the compile directive NO_EMBEDDED_ACCESS_CHECKS should be checked instead of
  the redundant HAVE_QUERY_CACHE (which is always the case) to determine if 
  column level grants should be compiled or not.
[19 Oct 2007 18:53] Bugs System
Pushed into 5.1.23-beta
[24 Oct 2007 19:26] Paul DuBois
Noted in 5.1.23 changelog.

The embedded server did not properly check column-level privileges.