diff options
-rw-r--r-- | mysql-test/r/ctype_utf32_uca.result | 22 | ||||
-rw-r--r-- | mysql-test/t/ctype_utf32_uca.test | 26 | ||||
-rw-r--r-- | sql/sql_string.cc | 2 |
3 files changed, 49 insertions, 1 deletions
diff --git a/mysql-test/r/ctype_utf32_uca.result b/mysql-test/r/ctype_utf32_uca.result index da23fa30ab4..46ca6e7baee 100644 --- a/mysql-test/r/ctype_utf32_uca.result +++ b/mysql-test/r/ctype_utf32_uca.result @@ -7919,5 +7919,27 @@ a b DROP TABLE t1; SET NAMES utf8; # +# MDEV-25402 Assertion `!str || str != Ptr' failed in String::copy +# +SET @c:="SET SESSION collation_connection=utf32_spanish_ci"; +PREPARE s FROM @c; +EXECUTE s; +CREATE PROCEDURE p (IN i INT) EXECUTE s; +SET SESSION character_set_connection=latin1; +SET @c:="SET @b=get_format(DATE,'EUR')"; +PREPARE s FROM @c; +EXECUTE s; +CALL p (@a); +DEALLOCATE PREPARE s; +DROP PROCEDURE p; +SET NAMES utf8; +SET @c:="SET @b=get_format(DATE,'EUR')"; +PREPARE s FROM @c; +EXECUTE s; +SET collation_connection=utf32_spanish_ci; +EXECUTE s; +DEALLOCATE PREPARE s; +SET NAMES utf8; +# # End of 10.2 tests # diff --git a/mysql-test/t/ctype_utf32_uca.test b/mysql-test/t/ctype_utf32_uca.test index 334d8fd1d48..2969480b0ef 100644 --- a/mysql-test/t/ctype_utf32_uca.test +++ b/mysql-test/t/ctype_utf32_uca.test @@ -266,5 +266,31 @@ SET NAMES utf8; --echo # +--echo # MDEV-25402 Assertion `!str || str != Ptr' failed in String::copy +--echo # + +SET @c:="SET SESSION collation_connection=utf32_spanish_ci"; +PREPARE s FROM @c; +EXECUTE s; +CREATE PROCEDURE p (IN i INT) EXECUTE s; +SET SESSION character_set_connection=latin1; +SET @c:="SET @b=get_format(DATE,'EUR')"; +PREPARE s FROM @c; +EXECUTE s; +CALL p (@a); +DEALLOCATE PREPARE s; +DROP PROCEDURE p; + +SET NAMES utf8; +SET @c:="SET @b=get_format(DATE,'EUR')"; +PREPARE s FROM @c; +EXECUTE s; +SET collation_connection=utf32_spanish_ci; +EXECUTE s; +DEALLOCATE PREPARE s; +SET NAMES utf8; + + +--echo # --echo # End of 10.2 tests --echo # diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 4e0c7aea84b..ff6b2163630 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -379,7 +379,7 @@ bool String::copy(const char *str, uint32 arg_length, { uint32 offset; - DBUG_ASSERT(!str || str != Ptr); + DBUG_ASSERT(!str || str != Ptr || !alloced); if (!needs_conversion(arg_length, from_cs, to_cs, &offset)) { |