[MDEV-10080] Derived tables allow double LIMIT clause Created: 2016-05-18  Updated: 2016-05-20  Resolved: 2016-05-20

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.0, 10.1, 10.2
Fix Version/s: 10.2.1

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-8909 union parser cleanup Closed
Sprint: 10.2.1-2, 10.2.1-3

 Description   

This script:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM  (SELECT * FROM t1 LIMIT 1 LIMIT 2) t1;

returns

+------+
| a    |
+------+
|    1 |
|    2 |
+------+

Notice, there are two LIMIT clauses, and the first LIMIT clause is obviously ignored.

It should return a syntax error.


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