diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-10-13 22:18:48 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-10-13 22:18:48 +0400 |
commit | 99420dd913333cf7bb109e9c5d71d2daf66e3dca (patch) | |
tree | dbed8bfecfa79c568812273856637bd355bb78eb /sql/net_serv.cc | |
parent | 9a65687bd9e76783d3e34cb35b5c8cc05421134d (diff) | |
download | mariadb-git-99420dd913333cf7bb109e9c5d71d2daf66e3dca.tar.gz |
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.
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 7a830e0961a..4945ee8d94f 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -95,8 +95,8 @@ extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received; #ifndef MYSQL_INSTANCE_MANAGER #ifdef HAVE_QUERY_CACHE #define USE_QUERY_CACHE -extern void query_cache_init_query(NET *net); -extern void query_cache_insert(NET *net, const char *packet, ulong length); +extern void query_cache_insert(const char *packet, ulong length, + unsigned pkt_nr); #endif // HAVE_QUERY_CACHE #define update_statistics(A) A #endif /* MYSQL_INSTANCE_MANGER */ @@ -132,11 +132,7 @@ my_bool my_net_init(NET *net, Vio* vio) net->compress=0; net->reading_or_writing=0; net->where_b = net->remain_in_buf=0; net->last_errno=0; -#ifdef USE_QUERY_CACHE - query_cache_init_query(net); -#else - net->query_cache_query= 0; -#endif + net->unused= 0; if (vio != 0) /* If real connection */ { @@ -586,7 +582,7 @@ net_real_write(NET *net,const uchar *packet, size_t len) DBUG_ENTER("net_real_write"); #if defined(MYSQL_SERVER) && defined(USE_QUERY_CACHE) - query_cache_insert(net, (char*) packet, len); + query_cache_insert((char*) packet, len, net->pkt_nr); #endif if (net->error == 2) |