[MDEV-11953] support of brackets (parentheses) in UNION/EXCEPT/INTERSECT operations Created: 2017-01-31  Updated: 2022-07-12  Resolved: 2018-07-04

Status: Closed
Project: MariaDB Server
Component/s: Parser
Fix Version/s: 10.4.0

Type: Task Priority: Critical
Reporter: Oleksandr Byelkin Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-6341 INSERT ... SELECT UNION with parenthesis Closed
is duplicated by MDEV-10028 Syntax error on ((SELECT ...) UNION (... Closed
Problem/Incident
causes MDEV-22595 INSERT .. VALUES allows undocumented ... Open
Relates
relates to MDEV-10140 Add support for EXCEPT Closed
relates to MDEV-10141 Add support for INTERSECT (and common... Closed
relates to MDEV-14347 CREATE PROCEDURE returns no error whe... Closed
relates to MDEV-15870 Using aggregate and window function i... Closed
relates to MDEV-16357 LIMIT and ORDER BY clause is ignored ... Closed
relates to MDEV-20606 Union with parentheses and IN() Closed
Sprint: 10.1.32, 10.3.6-1, 10.4.0-1

 Description   

Add suport of brackets which mean priority of operation in the parser:

((SELECT a from t1) union (SELECT b from t2)) intersect (select c from t3)



 Comments   
Comment by Oleksandr Byelkin [ 2017-02-06 ]

The idea is for now do not touch SELECT_LEX in LEX, but make one function which "allocate" SELECT_LEX which will be aware about presence of pre-allocated SELECT_LEX.

Comment by Oleksandr Byelkin [ 2017-06-22 ]

TODO: Need examples of pushing derived. (sql_derived.cc pushdown)

Comment by Oleksandr Byelkin [ 2017-06-22 ]

TODO: Reursive CTE (before opening check)

(According standard: UNION and left part of EXCEPT)

Comment by Oleksandr Byelkin [ 2018-06-05 ]

Result of discussion:
1. INTO:
1.1 standard variant with SINGLE select and INTO after select list
1.2 tail INTO after all SELECT query with warning about deprecating syntax
2. lock options: as is - belong to each SELECT
3. SELECT options with after parsing check
4. ORDER BY as in standard. It is already implemented syntactically but should be added execution of several tail ORDER/LIMIT constructions.

Generated at Thu Feb 08 07:53:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.