Commit ebd96c31 authored by Tor Didriksen's avatar Tor Didriksen

Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)

Backport from 5.7 to 5.5 Field_set::val_str()
should return String("", 0, cs) rather than String(NULL, 0, cs)
parent d75f8a17
......@@ -220,3 +220,19 @@ a d
3 11120436154190595086
drop table t1, t2;
End of 5.0 tests
#
# Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
# (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
#
set @@sql_mode='';
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2) engine=innodb;
Warnings:
Note 1291 Column 'c1' has duplicated value '' in SET
INSERT INTO t1 VALUES(990101.102);
Warnings:
Warning 1265 Data truncated for column 'c1' at row 1
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
COALESCE(c1)
DROP TABLE t1;
set @@sql_mode=default;
......@@ -173,3 +173,15 @@ select t1.a, (case t1.a when 0 then 0 else t1.b end) d from t1
drop table t1, t2;
--echo End of 5.0 tests
--echo #
--echo # Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
--echo # (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
--echo #
set @@sql_mode='';
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2) engine=innodb;
INSERT INTO t1 VALUES(990101.102);
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
DROP TABLE t1;
set @@sql_mode=default;
/*
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -8257,13 +8257,13 @@ String *Field_set::val_str(String *val_buffer,
ulonglong tmp=(ulonglong) Field_enum::val_int();
uint bitnr=0;
/*
Some callers expect *val_buffer to contain the result,
so we assign to it, rather than doing 'return &empty_set_string.
*/
*val_buffer= empty_set_string;
if (tmp == 0)
{
/*
Some callers expect *val_buffer to contain the result,
so we assign to it, rather than doing 'return &empty_set_string.
*/
*val_buffer= empty_set_string;
return val_buffer;
}
......
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