Bug #9511 LOCKING table doesn't prevent reading not locked tables in SQL_CACHE queries
Submitted: 31 Mar 2005 2:29 Modified: 31 Mar 2005 2:47
Reporter: Gleb Paharenko Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10a OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[31 Mar 2005 2:29] Gleb Paharenko
Description:
Locking the table usually prevent us to read other (not locked tables). That was mentioned
by Bob O'Neill at:
  
  http://lists.mysql.com/mysql/181927

How to repeat:
mysql> lock tables ta read;
Query OK, 0 rows affected (0.00 sec)

mysql> select SQL_CACHE count(*) from tb;
+----------+
| count(*) |
+----------+
|     4096 |
+----------+
1 row in set (0.00 sec)

But that should give Table 'tb' was not locked with LOCK TABLES

I assume that the query `select SQL_CACHE count(*) from tb` already in cache.
[31 Mar 2005 2:47] Jorge del Conde
Duplicate of 9510