Recently we were puzzled by question how query_cache works with
column level privileges. The question was appeared as we
discovered function query_cache_send_result_to_client is called
before real parsing of query, so at the moment of execution the
query_cache is not able to know which columns are accessed.
Looking into source code I found out that in the case when table
has column level privileges - function
query_cache_send_result_to_client just stopped and returns to
usual execution. So initial assumtion was that query against
table with defined column privilege is just not cached, though it
is not reflected in documentation.
It was worth to test it experimentally and the reality turned out
more interesting.
under root:
PLAIN TEXT SQL:
- CREATE TABLE xp.test1 (id int, name varchar(23));
- INSERT INTO xp.test1 VALUES (5, 'testit');
- GRANT SELECT (id) ON TABLE …