Bug #1889 Result of UNION query depend on order of SELECTs
Submitted: 19 Nov 2003 9:04 Modified: 19 Nov 2003 15:38
Reporter: Jens Lundell Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.x OS:Any (All)
Assigned to: CPU Architecture:Any

[19 Nov 2003 9:04] Jens Lundell
Description:
Probably related to Bug #96 "UNION truncates non db-fields"

How to repeat:
mysql> create table a (c varchar(5));
Query OK, 0 rows affected (0.00 sec)

mysql> insert into a values ('12345');
Query OK, 1 row affected (0.00 sec)

mysql> create table b as select '1234567890' c from a;
Query OK, 1 row affected (0.00 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> select c from a union select c from b;
+-------+
| c     |
+-------+
| 12345 |
+-------+
1 row in set (0.00 sec)

mysql> select c from b union select c from a;
+------------+
| c          |
+------------+
| 1234567890 |
| 12345      |
+------------+
[19 Nov 2003 15:38] Dean Ellis
Yes, this is the same basic issue as with issue #96.

Thank you.