summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/ctype_utf8.result8
-rw-r--r--mysql-test/t/ctype_utf8.test8
-rw-r--r--sql/item_strfunc.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 9a6dadba1f5..b8435cfa1b5 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -5134,5 +5134,13 @@ a 1024
Warnings:
Warning 1260 Row 2 was cut by GROUP_CONCAT()
#
+# MDEV-7814 Assertion `args[0]->fixed' fails in Item_func_conv_charset::Item_func_conv_charset
+#
+CREATE TABLE t1(a CHAR(1) CHARACTER SET latin1, b INT NOT NULL);
+CREATE TABLE t2(a CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci, b INT NOT NULL);
+SELECT (SELECT t2.a FROM t2 WHERE t2.a=t1.a) AS aa, b, COUNT(b) FROM t1 GROUP BY aa;
+aa b COUNT(b)
+DROP TABLE t1,t2;
+#
# End of 5.5 tests
#
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 0d104cae9c9..949d3d83f33 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -1597,5 +1597,13 @@ UNION ALL
SELECT 'a' AS id, REPEAT('bla bla', 100) AS body) t1;
--echo #
+--echo # MDEV-7814 Assertion `args[0]->fixed' fails in Item_func_conv_charset::Item_func_conv_charset
+--echo #
+CREATE TABLE t1(a CHAR(1) CHARACTER SET latin1, b INT NOT NULL);
+CREATE TABLE t2(a CHAR(1) CHARACTER SET utf8 COLLATE utf8_general_ci, b INT NOT NULL);
+SELECT (SELECT t2.a FROM t2 WHERE t2.a=t1.a) AS aa, b, COUNT(b) FROM t1 GROUP BY aa;
+DROP TABLE t1,t2;
+
+--echo #
--echo # End of 5.5 tests
--echo #
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index fcc1991774c..7606c281548 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -827,7 +827,6 @@ public:
Item_func_conv_charset(Item *a, CHARSET_INFO *cs, bool cache_if_const)
:Item_str_func(a)
{
- DBUG_ASSERT(args[0]->fixed);
conv_charset= cs;
if (cache_if_const && args[0]->const_item() && !args[0]->is_expensive())
{