diff options
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r-- | sql/sql_cache.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 777ddd39280..a1132adfa5a 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -64,6 +64,8 @@ struct Query_cache_table; struct Query_cache_query; struct Query_cache_result; class Query_cache; +struct Query_cache_tls; +struct st_lex; /** This class represents a node in the linked chain of queries @@ -137,7 +139,7 @@ struct Query_cache_query ulonglong limit_found_rows; rw_lock_t lock; Query_cache_block *res; - NET *wri; + Query_cache_tls *wri; ulong len; uint8 tbls_type; unsigned int last_pkt_nr; @@ -149,8 +151,8 @@ struct Query_cache_query inline void found_rows(ulonglong rows) { limit_found_rows= rows; } inline Query_cache_block *result() { return res; } inline void result(Query_cache_block *p) { res= p; } - inline NET *writer() { return wri; } - inline void writer(NET *p) { wri= p; } + inline Query_cache_tls *writer() { return wri; } + inline void writer(Query_cache_tls *p) { wri= p; } inline uint8 tables_type() { return tbls_type; } inline void tables_type(uint8 type) { tbls_type= type; } inline ulong length() { return len; } @@ -407,7 +409,8 @@ protected: If query is cacheable return number tables in query (query without tables not cached) */ - TABLE_COUNTER_TYPE is_cacheable(THD *thd, uint32 query_len, char *query, + TABLE_COUNTER_TYPE is_cacheable(THD *thd, size_t query_len, + const char *query, LEX *lex, TABLE_LIST *tables_used, uint8 *tables_type); TABLE_COUNTER_TYPE process_and_count_tables(THD *thd, @@ -462,10 +465,13 @@ protected: void destroy(); - friend void query_cache_init_query(NET *net); - friend void query_cache_insert(NET *net, const char *packet, ulong length); - friend void query_cache_end_of_result(THD *thd); - friend void query_cache_abort(NET *net); + void insert(Query_cache_tls *query_cache_tls, + const char *packet, + ulong length, + unsigned pkt_nr); + + void end_of_result(THD *thd); + void abort(Query_cache_tls *query_cache_tls); /* The following functions are only used when debugging @@ -493,9 +499,4 @@ protected: extern Query_cache query_cache; extern TYPELIB query_cache_type_typelib; -void query_cache_init_query(NET *net); -void query_cache_insert(NET *net, const char *packet, ulong length); -void query_cache_end_of_result(THD *thd); -void query_cache_abort(NET *net); - #endif |