[MDEV-22301] JSON_TABLE: Queries are not inserted into query cache Created: 2020-04-18  Updated: 2020-06-08  Resolved: 2020-06-08

Status: Closed
Project: MariaDB Server
Component/s: JSON, Query Cache
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-17399 Add support for JSON_TABLE Closed

 Description   

drop table if exists t;
create table t (a text);
insert into t values ('{"a":"foo"}');
set global query_cache_type= on;
set query_cache_type= on;
reset query cache;
flush status;
select * from t, json_table(t.a, '$' columns (f varchar(20) path '$.a')) as jt;
show status like 'qcache%';

bb-10.5-hf 6dfb3fab2

MariaDB [test]> show status like 'qcache%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| Qcache_free_blocks      | 1       |
| Qcache_free_memory      | 1031064 |
| Qcache_hits             | 0       |
| Qcache_inserts          | 0       |
| Qcache_lowmem_prunes    | 0       |
| Qcache_not_cached       | 1       |
| Qcache_queries_in_cache | 0       |
| Qcache_total_blocks     | 1       |
+-------------------------+---------+

Normal query from t is cached:

MariaDB [test]> select * from t;
+-------------+
| a           |
+-------------+
| {"a":"foo"} |
+-------------+
1 row in set (0.003 sec)
 
MariaDB [test]> show status like 'qcache%';
+-------------------------+---------+
| Variable_name           | Value   |
+-------------------------+---------+
| Qcache_free_blocks      | 1       |
| Qcache_free_memory      | 1029528 |
| Qcache_hits             | 0       |
| Qcache_inserts          | 1       |
| Qcache_lowmem_prunes    | 0       |
| Qcache_not_cached       | 1       |
| Qcache_queries_in_cache | 1       |
| Qcache_total_blocks     | 4       |
+-------------------------+---------+
8 rows in set (0.008 sec)


Generated at Thu Feb 08 09:13:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.