mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
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.
This commit is contained in:
parent
6f49b9841b
commit
84727ba3c3
3 changed files with 21 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue