Bug #88450 Multiple DISTINCTs are allowed
Submitted: 12 Nov 2017 11:09 Modified: 12 Nov 2017 13:28
Reporter: Federico Razzoli (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.5/5.6/5.7/8.0 OS:Any
Assigned to: CPU Architecture:Any

[12 Nov 2017 11:09] Federico Razzoli
Description:
These queries work, which seems to me inconsistent:

SELECT DISTINCT DISTINCT DISTINCTROW DISTINCTROW SCHEMA_NAME FROM information_schema.SCHEMATA;

SELECT ALL ALL SCHEMA_NAME FROM information_schema.SCHEMATA;

Fortunately, a combination of ALL + DISTINCT[ROW] doesn't work. However, such a query is clearly the result of an application bug (which probably means, the developer has no idea what the ORM does), and it would be useful to reject it.

I think this affects all MySQL versions until now.

How to repeat:
.

Suggested fix:
Deprecate this syntax and remove it in a future version.
[12 Nov 2017 13:28] MySQL Verification Team
Thank you for the bug report.