[MDEV-22595] INSERT .. VALUES allows undocumented optional ORDER BY and LIMIT clauses but ignores them Created: 2020-05-16 Updated: 2024-02-07 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | 10.4.0, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Rucha Deodhar |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
I would expect it either to return an error if syntax is not supported; or return a warning if the clauses are intentionally accepted but ignored; or apply them in a meaningful way and be documented. MariaDB versions before 10.4, as well as all MySQL versions, throw a syntax error upon it. PostgreSQL (9.6) accepts it and produces a more reasonable result:
The change came to 10.4 with this commit:
I don't know if it was intentional or not. I couldn't find the syntax in the standard 2011 draft, but maybe I didn't search well enough. I don't have access to newer versions. |