summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/ctype_ldml.result8
-rw-r--r--mysql-test/t/ctype_ldml.test9
-rw-r--r--strings/ctype-uca.c1
3 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index 5dc9ea35cc3..711921eb526 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -40,6 +40,14 @@ abcd abcd
efgh efgh
ijkl ijkl
DROP TABLE t1;
+#
+# Bug#43827 Server closes connections and restarts
+#
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
+INSERT INTO t1 SELECT REPEAT('a',11);
+Warnings:
+Warning 1265 Data truncated for column 'c1' at row 1
+DROP TABLE t1;
show collation like 'ucs2_vn_ci';
Collation Charset Id Default Compiled Sortlen
ucs2_vn_ci ucs2 242 8
diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test
index 73a23a751e8..db9461bfbf7 100644
--- a/mysql-test/t/ctype_ldml.test
+++ b/mysql-test/t/ctype_ldml.test
@@ -37,6 +37,15 @@ UPDATE t1 SET col2=col1;
SELECT * FROM t1 WHERE col1=col2 ORDER BY col1;
DROP TABLE t1;
+--echo #
+--echo # Bug#43827 Server closes connections and restarts
+--echo #
+# Crash happened with a user-defined utf8 collation,
+# on attempt to insert a string longer than the column can store.
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
+INSERT INTO t1 SELECT REPEAT('a',11);
+DROP TABLE t1;
+
#
# Vietnamese experimental collation
#
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 1ed758bc105..2ea48ddab2f 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -7992,6 +7992,7 @@ static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(size_t))
static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(size_t))
{
cs->pad_char= ' ';
+ cs->ctype= my_charset_utf8_unicode_ci.ctype;
return create_tailoring(cs, alloc);
}