diff options
author | bar@noter.(none) <> | 2005-05-09 20:55:06 +0500 |
---|---|---|
committer | bar@noter.(none) <> | 2005-05-09 20:55:06 +0500 |
commit | c783cb3d7eac5a901d1d2a28742f77f25f9785f7 (patch) | |
tree | 62cc9154f67665fb008399917539a75e960af706 /mysql-test | |
parent | ac2218795544249f043334604bac7f402782a9d9 (diff) | |
download | mariadb-git-c783cb3d7eac5a901d1d2a28742f77f25f9785f7.tar.gz |
SUBSTR with negative argument didn't work
with multi-byte strings, length() instead
of numchars() where used in a mistake.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ctype_utf8.result | 3 | ||||
-rw-r--r-- | mysql-test/t/ctype_utf8.test | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 78c56bffbd3..ffdb7cb0f3d 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -817,6 +817,9 @@ drop table t1; select 'c' like '\_' as want0; want0 0 +SELECT SUBSTR('вася',-2); +SUBSTR('вася',-2) +ся create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); insert into t1 values (1, 'Test'); select * from t1 where soundex(a) = soundex('Test'); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 194354f8718..02024adb34e 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -667,6 +667,12 @@ drop table t1; select 'c' like '\_' as want0; # +# SUBSTR with negative offset didn't work with multi-byte strings +# +SELECT SUBSTR('вася',-2); + + +# # Bug #7730 Server crash using soundex on an utf8 table # create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); |