mirror of
https://github.com/MariaDB/server.git
synced 2026-05-09 16:44:29 +02:00
MDEV-26892: JSON histograms become invalid with a specific (corrupt) value ..
Handle the case where the last value in the table cannot be represented in utf8mb4.
This commit is contained in:
parent
05877df472
commit
ac0194bd0e
3 changed files with 29 additions and 3 deletions
|
|
@ -7534,7 +7534,6 @@ drop table t1;
|
|||
#
|
||||
# MDEV-26849: JSON Histograms: point selectivity estimates are off for non-existent values
|
||||
#
|
||||
#
|
||||
create table t0(a int);
|
||||
insert into t0 (a) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1(a int);
|
||||
|
|
@ -7632,3 +7631,17 @@ analyze select * from t1 where a=200;
|
|||
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 1000.00 10.00 10.00 Using where
|
||||
drop table t0,t1;
|
||||
#
|
||||
# MDEV-26892: JSON histograms become invalid with a specific (corrupt) value in t
|
||||
#
|
||||
create table t1 (a varchar(32)) DEFAULT CHARSET=cp1257;
|
||||
set histogram_type= JSON_HB, histogram_size= 1;
|
||||
insert into t1 values ('foo'),(unhex('9C'));
|
||||
analyze table t1 persistent for all;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status Operation failed
|
||||
select * from t1;
|
||||
a
|
||||
foo
|
||||
?
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -298,7 +298,6 @@ drop table t1;
|
|||
--echo #
|
||||
--echo # MDEV-26849: JSON Histograms: point selectivity estimates are off for non-existent values
|
||||
--echo #
|
||||
--echo #
|
||||
|
||||
create table t0(a int);
|
||||
insert into t0 (a) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
|
@ -317,3 +316,14 @@ analyze select * from t1 where a=200;
|
|||
|
||||
drop table t0,t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26892: JSON histograms become invalid with a specific (corrupt) value in t
|
||||
--echo #
|
||||
create table t1 (a varchar(32)) DEFAULT CHARSET=cp1257;
|
||||
set histogram_type= JSON_HB, histogram_size= 1;
|
||||
insert into t1 values ('foo'),(unhex('9C'));
|
||||
analyze table t1 persistent for all;
|
||||
|
||||
select * from t1;
|
||||
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -326,7 +326,10 @@ public:
|
|||
{
|
||||
// This is the final value group.
|
||||
if (!bucket_is_empty())
|
||||
finalize_bucket_with_end_value(elem);
|
||||
{
|
||||
if (finalize_bucket_with_end_value(elem))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue