1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-26724 Endless loop in json_escape_to_string upon ... empty string

Part#3:
- make json_escape() return different errors on conversion error
  and on out-of-space condition.
- Make histogram code handle conversion errors.
This commit is contained in:
Sergei Petrunia
2021-10-10 11:51:04 +03:00
parent 8e0a342b91
commit 3936dc3353
6 changed files with 65 additions and 16 deletions

View File

@ -7927,6 +7927,22 @@ a
Ñ
drop table t1;
#
# Another testcase: use a character that cannot be represented in utf8:
#
create table t1 ( a varchar(100) character set cp1251);
insert into t1 values ( _cp1251 x'88'),( _cp1251 x'98');
analyze table t1 persistent for all;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
# Command succeeded but no histogram was collected:
select hist_type, histogram
from mysql.column_stats
where db_name=database() and table_name='t1';
hist_type histogram
NULL NULL
drop table t1;
#
# ASAN use-after-poison my_strnxfrm_simple_internal / Histogram_json_hb::range_selectivity ...
# (Just the testcase)
#