summaryrefslogtreecommitdiff
path: root/sql/net_serv.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-10-13 22:18:48 +0400
committerKonstantin Osipov <kostja@sun.com>2009-10-13 22:18:48 +0400
commitea6a22bfa816ebc373316eee36c18952e812e7f6 (patch)
treedbed8bfecfa79c568812273856637bd355bb78eb /sql/net_serv.cc
parent10390cec03109dd9ffd0d6785d2bc843166fcf38 (diff)
downloadmariadb-git-ea6a22bfa816ebc373316eee36c18952e812e7f6.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
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r--sql/net_serv.cc12
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)