SQLite

View Ticket
Login
Ticket Hash: 38cb5df375078d3f9711482d2a1615d09f6b3f33
Title: LIMIT ignored on compound query with subqueries
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2010-10-06 19:14:07
14.70 years ago
Created: 2010-10-06 17:06:47
14.70 years ago
Version Found In: 3.7.2
Description:
In the following code, multiple rows of output are generated in spite of the LIMIT 1 clause:
CREATE TABLE t(a);
INSERT INTO t VALUES(1);
INSERT INTO t VALUES(2);

SELECT * FROM (SELECT * FROM t ORDER BY a) UNION ALL SELECT * FROM (SELECT a FROM t) LIMIT 1;

This defect has been in the code going back to version 3.1.3 (2005-02-19) and probably before that.