summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2007-08-21 13:44:01 +0200
committerunknown <thek@adventure.(none)>2007-08-21 13:44:01 +0200
commitb1d9eba30acdf82b3a8d6fa28d7110463d599207 (patch)
tree2faf3e3941e4f173cbf719746cb5494b7c2f5c87 /sql/sql_cache.cc
parentc24600306c0a1ea67160bd33b7e1e3f9bbc5685a (diff)
parent3a5a0ea3928d24a8cd0a45691de6d917672d63c6 (diff)
downloadmariadb-git-b1d9eba30acdf82b3a8d6fa28d7110463d599207.tar.gz
Merge adventure.(none):/home/thek/Development/cpp/bug30269/my50-bug30269
into adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269 mysql-test/r/query_cache.result: Auto merged mysql-test/t/query_cache.test: Auto merged sql/sql_cache.cc: Auto merged
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 09e628610ef..1ad57811707 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -3237,8 +3237,19 @@ Query_cache::process_and_count_tables(THD *thd, TABLE_LIST *tables_used,
The grant.want_privileges flag was set to 1 in the
check_grant() function earlier if the TABLE_LIST object
had any associated column privileges.
+
+ We need to check that the TABLE_LIST object isn't part
+ of a VIEW definition because we want to be able to cache
+ views.
+
+ TODO: Although it is possible to cache views, the privilege
+ check on view tables always fall back on column privileges
+ even if there are more generic table privileges. Thus it isn't
+ currently possible to retrieve cached view-tables unless the
+ client has the super user privileges.
*/
- if (tables_used->grant.want_privilege)
+ if (tables_used->grant.want_privilege &&
+ tables_used->belong_to_view == NULL)
{
DBUG_PRINT("qcache", ("Don't cache statement as it refers to "
"tables with column privileges."));