Commit f75dbdd1 authored by Alexander Barkov's avatar Alexander Barkov

Bug#13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED. | MY_STRNXFRM_UNICODE/MAKE_SORTKEY

Problem:

Field_set::val_str in case of an empty SET value
returned a String with str_length==0 and Ptr==0,
which is not expected by some pieces of the code.

Fix:
      
Returning an empty string with str_length==0 and Ptr=="",
like Field_enum does.
parent fb96d808
......@@ -4107,5 +4107,16 @@ DROP TABLE t1;
SET sql_mode=default;
SET NAMES latin1;
#
# Bug #13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED
#
CREATE TABLE t1 (c1 SET('','') CHARACTER SET ucs2);
Warnings:
Note 1291 Column 'c1' has duplicated value '' in SET
INSERT INTO t1 VALUES ('');
SELECT COALESCE(c1) FROM t1 ORDER BY 1;
COALESCE(c1)
DROP TABLE t1;
#
# End of 5.5 tests
#
......@@ -759,6 +759,15 @@ SET collation_connection=ucs2_general_ci;
--source include/ctype_numconv.inc
SET NAMES latin1;
--echo #
--echo # Bug #13832953 MY_STRNXFRM_UNICODE: ASSERTION `SRC' FAILED
--echo #
CREATE TABLE t1 (c1 SET('','') CHARACTER SET ucs2);
INSERT INTO t1 VALUES ('');
SELECT COALESCE(c1) FROM t1 ORDER BY 1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
......@@ -8257,8 +8257,7 @@ String *Field_set::val_str(String *val_buffer,
ulonglong tmp=(ulonglong) Field_enum::val_int();
uint bitnr=0;
val_buffer->length(0);
val_buffer->set_charset(field_charset);
val_buffer->set("", 0, field_charset);
while (tmp && bitnr < (uint) typelib->count)
{
if (tmp & 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment