Bug 4154 fixed

Fixed bug 4154. Handling sorting order is not required if its a union
query.