diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-02-07 18:14:45 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-02-07 18:14:45 +0100 |
commit | b6455479e588fe1309157e8cc77cca10b90942b6 (patch) | |
tree | 0b9ccd9ec0915053c7d20a3d7b40d8227fcc34cb | |
parent | cb5374801e594282b41883bf38892d4788668df1 (diff) | |
download | mariadb-git-b6455479e588fe1309157e8cc77cca10b90942b6.tar.gz |
MDEV-15230: column_json breaks cyrillic in 10.1.31
Use unsigned comparison.
-rw-r--r-- | mysql-test/r/dyncol.result | 10 | ||||
-rw-r--r-- | mysql-test/t/dyncol.test | 9 | ||||
-rw-r--r-- | mysys/ma_dyncol.c | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 81446da9e14..fe4ee3f7de2 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1883,5 +1883,15 @@ SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json; json {"test":"First line\u000ASecond line"} # +# MDEV-15230: column_json breaks cyrillic in 10.1.31 +# +set names utf8; +create table t1 (b blob); +insert into t1 values (column_create('description',column_create('title','Описание'))); +select column_json(b) from t1; +column_json(b) +{"description":{"title":"Описание"}} +drop table t1; +# # end of 10.0 tests # diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 2c93f75cb5a..7807d1a9f9e 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -929,5 +929,14 @@ SELECT COLUMN_JSON(COLUMN_CREATE('test','"\\\t\n\Z')) AS json; SELECT COLUMN_JSON(COLUMN_CREATE('test','First line\nSecond line')) AS json; --echo # +--echo # MDEV-15230: column_json breaks cyrillic in 10.1.31 +--echo # +set names utf8; +create table t1 (b blob); +insert into t1 values (column_create('description',column_create('title','Описание'))); +select column_json(b) from t1; +drop table t1; + +--echo # --echo # end of 10.0 tests --echo # diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c index 0c54bd7a581..909f9dcac41 100644 --- a/mysys/ma_dyncol.c +++ b/mysys/ma_dyncol.c @@ -3834,7 +3834,7 @@ my_bool dynstr_append_json_quoted(DYNAMIC_STRING *str, for (i= 0; i < len; i++) { register char c= append[i]; - if (unlikely(c <= 0x1F)) + if (unlikely(((uchar)c) <= 0x1F)) { if (lim < 5) { |