diff options
author | unknown <thek@adventure.(none)> | 2007-08-21 14:04:31 +0200 |
---|---|---|
committer | unknown <thek@adventure.(none)> | 2007-08-21 14:04:31 +0200 |
commit | 863eb5d5098787656b740b222f1741a9363007ad (patch) | |
tree | 992fe5eea72afb3aa83c2057a1444138ce0e5af4 /sql/sql_cache.cc | |
parent | 55e514ae8d6d5fbd356ea26fa793c8819d6d8c65 (diff) | |
parent | b1d9eba30acdf82b3a8d6fa28d7110463d599207 (diff) | |
download | mariadb-git-863eb5d5098787656b740b222f1741a9363007ad.tar.gz |
Merge adventure.(none):/home/thek/Development/cpp/bug30269/my51-bug30269
into adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
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.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 4e5cf157239..98d99f4c6e2 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -3238,8 +3238,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.")); |