1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-16869 String functions don't respect character set of JSON_VALUE.

Item_func_json_value::val_str() produced string of wrong charset.
This commit is contained in:
Alexey Botchkov
2018-08-05 18:33:17 +04:00
parent affdd79c69
commit fc324a5f87
3 changed files with 24 additions and 1 deletions

View File

@ -429,3 +429,14 @@ DROP TABLE t1;
select json_array(1,uuid(),compress(5.140264e+307));
--echo #
--echo # MDEV-16869 String functions don't respect character set of JSON_VALUE.
--echo #
create table t1(json_col TEXT) DEFAULT CHARSET=latin1;
insert into t1 values (_latin1 X'7B226B657931223A2253EC227D');
select JSON_VALUE(json_col, '$.key1')= _latin1 X'53EC' from t1;
select REPLACE(JSON_VALUE(json_col, '$.key1'), 'null', '') = _latin1 X'53EC' from t1;
drop table t1;