summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorbar@noter.(none) <>2005-05-09 20:55:06 +0500
committerbar@noter.(none) <>2005-05-09 20:55:06 +0500
commitc783cb3d7eac5a901d1d2a28742f77f25f9785f7 (patch)
tree62cc9154f67665fb008399917539a75e960af706 /mysql-test
parentac2218795544249f043334604bac7f402782a9d9 (diff)
downloadmariadb-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.result3
-rw-r--r--mysql-test/t/ctype_utf8.test6
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);