Skip to content

Commit 2f5d887

Browse files
author
Tor Didriksen
committed
Merge branch 'mysql-5.5' into mysql-5.6
2 parents 9ee6578 + ebd96c3 commit 2f5d887

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

mysql-test/r/case.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,19 @@ CREATE TABLE t1(a YEAR);
224224
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
225225
1
226226
DROP TABLE t1;
227+
#
228+
# Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
229+
# (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
230+
#
231+
set @@sql_mode='';
232+
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2) engine=innodb;
233+
Warnings:
234+
Note 1291 Column 'c1' has duplicated value '' in SET
235+
INSERT INTO t1 VALUES(990101.102);
236+
Warnings:
237+
Warning 1265 Data truncated for column 'c1' at row 1
238+
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
239+
COALESCE(c1)
240+
241+
DROP TABLE t1;
242+
set @@sql_mode=default;

mysql-test/t/case.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,15 @@ drop table t1, t2;
182182
CREATE TABLE t1(a YEAR);
183183
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
184184
DROP TABLE t1;
185+
186+
--echo #
187+
--echo # Bug#19875294 ASSERTION `SRC' FAILED IN MY_STRNXFRM_UNICODE
188+
--echo # (SIG 6 -STRINGS/CTYPE-UTF8.C:5151)
189+
--echo #
190+
191+
set @@sql_mode='';
192+
CREATE TABLE t1(c1 SET('','')CHARACTER SET ucs2) engine=innodb;
193+
INSERT INTO t1 VALUES(990101.102);
194+
SELECT COALESCE(c1)FROM t1 ORDER BY 1;
195+
DROP TABLE t1;
196+
set @@sql_mode=default;

sql/field.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -8691,13 +8691,13 @@ String *Field_set::val_str(String *val_buffer,
86918691
ulonglong tmp=(ulonglong) Field_enum::val_int();
86928692
uint bitnr=0;
86938693

8694+
/*
8695+
Some callers expect *val_buffer to contain the result,
8696+
so we assign to it, rather than doing 'return &empty_set_string.
8697+
*/
8698+
*val_buffer= empty_set_string;
86948699
if (tmp == 0)
86958700
{
8696-
/*
8697-
Some callers expect *val_buffer to contain the result,
8698-
so we assign to it, rather than doing 'return &empty_set_string.
8699-
*/
8700-
*val_buffer= empty_set_string;
87018701
return val_buffer;
87028702
}
87038703

0 commit comments

Comments
 (0)