Bug #96 UNION truncates non db-fields
Submitted: 25 Feb 2003 8:24 Modified: 11 Dec 2003 9:15
Reporter: Georg Richter Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.x OS:Any (any)
Assigned to: CPU Architecture:Any

[25 Feb 2003 8:24] Georg Richter
Description:
for non db-fields UNION truncates strings to the length of string in first select.

How to repeat:
mysql> select "abc" union select "foobar";

returns
"abc" and "foo"
[3 Mar 2003 7:33] Sinisa Milivojevic
Yes, current behaviour is not conformant with SQL-99 standard
so this will be fixed in 5.0.
[3 Mar 2003 7:34] Sinisa Milivojevic
Yes, current behaviour is not conformant with SQL-99 standard
so this will be fixed in 5.0.
[22 Apr 2003 3:13] Michael Widenius
MySQL converts all union results to the column type of the first UNION part.

In the given test case MySQL converts the result to type CHAR(3).

We will probably lighten up this restriction for strings in 5.0 x where we will make the result type
CHAR(max_string_length-for-all-arguments).
[11 Dec 2003 9:15] Sinisa Milivojevic
fixed in 4.1.1.