summaryrefslogtreecommitdiff
path: root/sql/sql_cache.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2016-09-14 18:15:03 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2016-09-27 14:11:37 +0200
commite226276950497c0ec92b3bf71bc6c46ac4a779d4 (patch)
tree27716608558176212b5c788d8eb6817804119751 /sql/sql_cache.h
parent3f5aedccca25da72e21d7859b55edeb172d45ce0 (diff)
downloadmariadb-git-e226276950497c0ec92b3bf71bc6c46ac4a779d4.tar.gz
MDEV-10777: Server crashed due to query_cache_info plugin
Possible fix. Make the pluging more safe.
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r--sql/sql_cache.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 00ba9bf59d8..657caf4a5bc 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -156,8 +156,9 @@ struct Query_cache_query
Query_cache_block *res;
Query_cache_tls *wri;
ulong len;
- uint8 tbls_type;
unsigned int last_pkt_nr;
+ uint8 tbls_type;
+ uint8 ready;
Query_cache_query() {} /* Remove gcc warning */
inline void init_n_lock();
@@ -177,6 +178,12 @@ struct Query_cache_query
{
return (((uchar*)this) + ALIGN_SIZE(sizeof(Query_cache_query)));
}
+ /**
+ following used to check if result ready in plugin without
+ locking rw_lock of the query.
+ */
+ inline void set_results_ready() { ready= 1; }
+ inline bool is_results_ready() { return ready; }
void lock_writing();
void lock_reading();
bool try_lock_writing();