(text/x-markdown)
Test case:
~~~~
CREATE TABLE t (label VARCHAR(10), step INTEGER);
INSERT INTO T VALUES('a', 1);
INSERT INTO T VALUES('a', 1);
INSERT INTO T VALUES('b', 1);
WITH RECURSIVE cte(label, step) AS (
SELECT DISTINCT * FROM t
UNION ALL
SELECT label, step + 1 FROM cte WHERE step < 3
)
SELECT * FROM cte;
~~~~
The above should return 6 rows, but is returning 9 rows with
all recent versions of SQLite. That 6 rows are correct is confirmed
on sqlfiddle.com using PostgreSQL and SQL Server.
Bisect shows the problem first appeared in check-in [](45d8cc678d128f1d)
on 2014-03-21 (6.5 years ago!) and was
first released with version 3.8.5. The problem has not been reported from
the field in all that time, which tells us that it is not a high priority
to fix.
Problem reported on the Forum via [post 1d3b0519e2](forum:1d3b0519e2).
|