summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
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.cc
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.cc')
-rw-r--r--sql/sql_cache.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 91dd8ad7325..c69303c5273 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -961,7 +961,7 @@ inline void Query_cache_query::unlock_reading()
void Query_cache_query::init_n_lock()
{
DBUG_ENTER("Query_cache_query::init_n_lock");
- res=0; wri = 0; len = 0;
+ res=0; wri = 0; len = 0; ready= 0;
mysql_rwlock_init(key_rwlock_query_cache_query_lock, &lock);
lock_writing();
DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx",
@@ -1226,6 +1226,7 @@ void Query_cache::end_of_result(THD *thd)
query_cache.split_block(last_result_block,len);
header->found_rows(limit_found_rows);
+ header->set_results_ready(); // signal for plugin
header->result()->type= Query_cache_block::RESULT;
/* Drop the writer. */