Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
Description
If I run this query:
SELECT 1 UNION SELECT 2 INTO OUTFILE 'test.txt'; |
It correctly creates a file 'test.txt' with two lines:
1
|
2
|
Now if I do "rm test.txt" and execute another query (with parentheses):
(SELECT 1) UNION (SELECT 2 INTO OUTFILE 'test.txt'); |
it still puts the same two lines from both UNION parts.
This looks confusing, as parentheses a kind of assume that only the right UNION part is to be exported.
We could introduce a less confusing syntax to export UNION queries, for example:
((SELECT 1) UNION (SELECT 2)) INTO OUTFILE 'test.txt'; |
But "MDEV-10028 Syntax error on ((SELECT ...) UNION (SELECT ...))" should be fixed first.
Note, one can write something like this:
SELECT * INTO OUTFILE 'test.txt' |
FROM ((SELECT ...) UNION (SELECT ...)) AS t1; |
But it looks longer.
Sergei thinks that even if we add a less confusing syntax, we should not disallow the confusing syntax not to break existing applications.
https://lists.launchpad.net/maria-developers/msg09599.html
But at least just sending a warning suggesting a better syntax would probably be fine.
Attachments
Issue Links
- relates to
-
MDEV-10028 Syntax error on ((SELECT ...) UNION (SELECT ...))
- Closed