mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Introduce thd->query_cache_tls (thread
local storage for query cache). We need more than one pointer in a thread to represent the query cache and net->query_cache_query can not be used any more (due to ABI compatibility issues and to different life time of NET and THD). This is a backport of the following patch from 6.0: ---------------------------------------------------------- revno: 2476.1157.2 committer: kostja@bodhi.(none) timestamp: Sat 2007-06-16 13:29:24 +0400 include/mysql.h.pp: Update the ABI (NET::query_cache_query is now unused). include/mysql_com.h: NET::query_cache_query is now unused. sql/mysql_priv.h: Update signatures of ex-functios now member functions. sql/sql_cache.cc: Introduce THD::query_cache_tls. sql/sql_cache.h: Introduce THD::query_cache_tls. sql/sql_class.cc: Introduce THD::query_cache_tls. sql/sql_class.h: Introduce THD::query_cache_tls. sql/sql_parse.cc: Use THD::query_cache_tls. sql/sql_select.cc: Use THD::query_cache_tls.
This commit is contained in:
@ -315,6 +315,27 @@ typedef enum enum_diag_condition_item_name
|
||||
*/
|
||||
extern const LEX_STRING Diag_condition_item_names[];
|
||||
|
||||
/**
|
||||
Query_cache_tls -- query cache thread local data.
|
||||
*/
|
||||
|
||||
class Query_cache_block;
|
||||
|
||||
struct Query_cache_tls
|
||||
{
|
||||
/*
|
||||
'first_query_block' should be accessed only via query cache
|
||||
functions and methods to maintain proper locking.
|
||||
*/
|
||||
Query_cache_block *first_query_block;
|
||||
void set_first_query_block(Query_cache_block *first_query_block_arg)
|
||||
{
|
||||
first_query_block= first_query_block_arg;
|
||||
}
|
||||
|
||||
Query_cache_tls() :first_query_block(NULL) {}
|
||||
};
|
||||
|
||||
#include "sql_lex.h" /* Must be here */
|
||||
|
||||
class Delayed_insert;
|
||||
@ -1239,6 +1260,9 @@ public:
|
||||
fields then.
|
||||
*/
|
||||
struct st_mysql_stmt *current_stmt;
|
||||
#endif
|
||||
#ifdef HAVE_QUERY_CACHE
|
||||
Query_cache_tls query_cache_tls;
|
||||
#endif
|
||||
NET net; // client connection descriptor
|
||||
Protocol *protocol; // Current protocol
|
||||
|
Reference in New Issue
Block a user