diff options
author | unknown <thek@adventure.(none)> | 2007-08-21 14:54:09 +0200 |
---|---|---|
committer | unknown <thek@adventure.(none)> | 2007-08-21 14:54:09 +0200 |
commit | 7dd4e789586bef5141e1a1d4da4b7efc271708aa (patch) | |
tree | d32434c8034057081770a1fac2c64617c0b8d0b3 /sql | |
parent | 5f40dafcd335fff4b4392cc6192a6eb074d491bd (diff) | |
parent | 863eb5d5098787656b740b222f1741a9363007ad (diff) | |
download | mariadb-git-7dd4e789586bef5141e1a1d4da4b7efc271708aa.tar.gz |
Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
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
Diffstat (limited to 'sql')
-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.")); |