mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix crash in embedded server due to incorrect storage of results
in the query cache. (Bug #9549) libmysqld/emb_qcache.h: Fix Querycache_stream::use_next_block() to actually use the next block and mark blocks as used when it writes to them. mysql-test/r/query_cache.result: Update results. mysql-test/t/query_cache.test: Add new regression test. libmysqld/emb_qcache.cc: Fix calls to use_next_block() to indicate whether we are writing to the next block or not. sql/sql_cache.cc: Initialize the first block properly when storing a result in the embedded server.
This commit is contained in:
@ -1933,6 +1933,11 @@ my_bool Query_cache::write_result_data(Query_cache_block **result_block,
|
||||
type = Query_cache_block::RES_CONT;
|
||||
} while (block != *result_block);
|
||||
#else
|
||||
/*
|
||||
Set type of first block, emb_store_querycache_result() will handle
|
||||
the others.
|
||||
*/
|
||||
(*result_block)->type= type;
|
||||
Querycache_stream qs(*result_block, headers_len);
|
||||
emb_store_querycache_result(&qs, (THD*)data);
|
||||
#endif /*!EMBEDDED_LIBRARY*/
|
||||
|
Reference in New Issue
Block a user