[MDEV-26711] JSON histograms become invalid due to not properly quoted values Created: 2021-09-28  Updated: 2022-01-19  Resolved: 2021-09-29

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: N/A
Fix Version/s: 10.7.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-21130 Histograms: use JSON as on-disk format Closed
is caused by MDEV-26519 JSON Histograms: improve histogram co... Closed

 Description   

JSON histograms turn out invalid if a column value contains, for example, a double quote mark.

create or replace table t (a varchar(32));
insert into t values ('this is "quoted" text');
set histogram_type= JSON_HB;
analyze table t persistent for all;
select * from t where a = 'foo';
 
# Cleanup
drop table t;

preview-10.7-MDEV-26519-json-histograms da8bb4b4703

MariaDB [test]> select * from t where a = 'foo';
ERROR 4183 (HY000): Failed to parse histogram: Root JSON element must be a JSON object at offset 0.


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