Skip to content

Commit b645547

Browse files
committed
MDEV-15230: column_json breaks cyrillic in 10.1.31
Use unsigned comparison.
1 parent cb53748 commit b645547

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

mysql-test/r/dyncol.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,5 +1883,15 @@ SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json;
18831883
json
18841884
{"test":"First line\u000ASecond line"}
18851885
#
1886+
# MDEV-15230: column_json breaks cyrillic in 10.1.31
1887+
#
1888+
set names utf8;
1889+
create table t1 (b blob);
1890+
insert into t1 values (column_create('description',column_create('title','Описание')));
1891+
select column_json(b) from t1;
1892+
column_json(b)
1893+
{"description":{"title":"Описание"}}
1894+
drop table t1;
1895+
#
18861896
# end of 10.0 tests
18871897
#

mysql-test/t/dyncol.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,15 @@ SELECT COLUMN_JSON(COLUMN_CREATE('a',1 AS DECIMAL,'b',1 AS DECIMAL));
928928
SELECT COLUMN_JSON(COLUMN_CREATE('test','"\\\t\n\Z')) AS json;
929929
SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json;
930930

931+
--echo #
932+
--echo # MDEV-15230: column_json breaks cyrillic in 10.1.31
933+
--echo #
934+
set names utf8;
935+
create table t1 (b blob);
936+
insert into t1 values (column_create('description',column_create('title','Описание')));
937+
select column_json(b) from t1;
938+
drop table t1;
939+
931940
--echo #
932941
--echo # end of 10.0 tests
933942
--echo #

mysys/ma_dyncol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3834,7 +3834,7 @@ my_bool dynstr_append_json_quoted(DYNAMIC_STRING *str,
38343834
for (i= 0; i < len; i++)
38353835
{
38363836
register char c= append[i];
3837-
if (unlikely(c <= 0x1F))
3837+
if (unlikely(((uchar)c) <= 0x1F))
38383838
{
38393839
if (lim < 5)
38403840
{

0 commit comments

Comments
 (0)