[MDEV-17170] MINUS allowed as synonym for EXCEPT Set Operation for Oracle compatibility Created: 2018-09-11  Updated: 2023-06-06  Resolved: 2023-06-06

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Oli Sennhauser Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: Compatibility


 Description   

SQL> SELECT first_name, last_name FROM user
-> MINUS
-> SELECT first_name, last_name FROM customer
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT first_name, last_name FROM customer' at line 3

SQL> SELECT first_name, last_name FROM user
-> EXCEPT
-> SELECT first_name, last_name FROM customer
-> ;
OK

Official Oracle documentation does not even mention the EXCEPT clause. So it is quite probable that many of those statements exist in real world...

https://en.wikipedia.org/wiki/Set_operations_(SQL)#EXCEPT_operator
https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries004.htm



 Comments   
Comment by Oli Sennhauser [ 2023-05-11 ]

Looks like MINUS is supported in sql_mode='oracle'. But this should be mentioned IMHO at least:
https://mariadb.com/kb/en/except/
https://mariadb.com/kb/en/minus/
So changing this issue to a docu bug?

Comment by Ian Gilfillan [ 2023-06-06 ]

Clarified in the docs that this is in Oracle mode only.

Generated at Thu Feb 08 08:34:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.