Bug #87252 SELECT ... UNION SELECT.. INTO OUTFILE randomly skips records
Submitted: 30 Jul 2017 22:29 Modified: 30 Aug 2017 23:24
Reporter: Balna Borju Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.7.19 OS:Windows (win7 x64 home premium)
Assigned to: CPU Architecture:Any
Tags: missing, outfile, records

[30 Jul 2017 22:29] Balna Borju
Description:
I generate an output textfile from a table. When I put a header line on top of it using an UNION, some records are missing from the resulting file. At any subsequent run always the same records are the missing ones. If I specify a missing record in the OUTFILE query by its primary key (WHERE..), the single line of the concerned record is correctly written in the output file. Without the UNION, the result is correct, ie. identical to the table's content. The bug is present at least since 5.5.17.

How to repeat:
SELECT
	"column_name1",..., "column_name_n"
UNION
SELECT
	*
FROM
	tablename
INTO OUTFILE
	'somepath/somefile.csv' FIELDS TERMINATED BY ';' ESCAPED BY '';
[30 Jul 2017 23:24] MySQL Verification Team
Thank you for the bug report. Just with your description we aren't able to repeat the issue, so we need you provide a complete test case ( create tables, insert data, queries, real result and expected result). Thanks in advance.
[31 Aug 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".