diff options
author | unknown <thek@adventure.(none)> | 2007-08-17 16:55:20 +0200 |
---|---|---|
committer | unknown <thek@adventure.(none)> | 2007-08-17 16:55:20 +0200 |
commit | bd80048fdbcd828622858520ff69707056da6595 (patch) | |
tree | bd6aa41892045dd6b60e4f78c7d3215fb8d20bbb /sql/sql_cache.h | |
parent | 07955aea2dc369be7637f28331bd1072a995d572 (diff) | |
download | mariadb-git-bd80048fdbcd828622858520ff69707056da6595.tar.gz |
Bug #30269 Query cache eats memory
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
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r-- | sql/sql_cache.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h index bc00f7ea629..34fc3a5c8d5 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -368,10 +368,12 @@ protected: If query is cacheable return number tables in query (query without tables not cached) */ - static TABLE_COUNTER_TYPE is_cacheable(THD *thd, uint32 query_len, char *query, - LEX *lex, TABLE_LIST *tables_used, - uint8 *tables_type); + LEX *lex, TABLE_LIST *tables_used, + uint8 *tables_type); + TABLE_COUNTER_TYPE process_and_count_tables(THD *thd, + TABLE_LIST *tables_used, + uint8 *tables_type); static my_bool ask_handler_allowance(THD *thd, TABLE_LIST *tables_used); public: |