Add note + test about exception handling

This commit is contained in:
Robert Schulze 2023-01-02 10:24:01 +00:00
parent 8381d8b467
commit 9ab910102f
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
3 changed files with 15 additions and 0 deletions

View File

@ -59,6 +59,11 @@ The cache exists once per ClickHouse server process but cache results are by def
Query results are referenced in the cache by the [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) of their query. This means that caching is agnostic to upper/lowercase, for example `SELECT 1` and `select 1` are treated as the same query.
:::warning
As of now, the query result cache does not properly handle exceptions during query execution. It will write a partial (incorrect) entry of
the result up to the point where the exception occurred instead of not writing a result into the cache.
:::
### Further Configuration Options:
To configure the size of the query result cache, use setting [query_result_cache_size](server-configuration-parameters/settings.md#server_configuration_parameters_query-result-cache-size).

View File

@ -0,0 +1,9 @@
-- Tags: no-parallel
SYSTEM DROP QUERY RESULT CACHE;
-- if an exception is thrown during query execution, no entry must be created in the query result cache (unfortunately that happens currently)
SELECT throwIf(number = 10000, 'bla') from system.numbers SETTINGS enable_experimental_query_result_cache = true; -- { serverError 395 }
SELECT COUNT(*) FROM system.queryresult_cache;
SYSTEM DROP QUERY RESULT CACHE;