• unknown's avatar
    Bug #30269 Query cache eats memory · bd80048f
    unknown authored
    Although the query cache doesn't support retrieval of statements containing
    column level access control, it was still possible to cache such statements
    thus wasting memory.
    
    This patch extends the access control check on the target tables to avoid
    caching a statement with column level restrictions. 
    
    
    mysql-test/r/query_cache.result:
      Added test
    mysql-test/t/query_cache.test:
      Added test
    sql/sql_cache.cc:
      The function check_table_access leaves the artifact
      grant.want_privileges= 1, if a statement refers to tables with column level
      privileges. To avoid the statement from being stored into the query cache,
      it is enough to check this flag and set 'safe_to_cache_query' to zero.
    sql/sql_cache.h:
      - Removed 'static' attribute or class methods
      - Added THD parameter to process_and_count_tables
    bd80048f
sql_cache.cc 130 KB