DISTINCT malfunctions for VIEW with virtual table
|User & Date:||mrigger 2019-11-07 21:58:13|
- foundin changed to: "3.30.0"
In the following test case, unexpectedly, four rows are fetched, also containing two rows with duplicate v0.c0=1 values: <pre> CREATE TABLE t0(c0); CREATE VIRTUAL TABLE vt0 USING fts5(c0); INSERT INTO t0(c0) VALUES (1), (0); INSERT INTO vt0(c0) VALUES (0), (0); CREATE VIEW v0 AS SELECT DISTINCT t0.c0 FROM vt0, t0 ORDER BY vt0.rowid; SELECT * FROM v0; -- unexpected: 4 rows are fetched </pre> The DISTINCT seems to work correctly when used together with a COUNT: <pre> SELECT COUNT(*) FROM v0 WHERE v0.c0; -- 1 </pre>
- login: "mrigger"
- mimetype: "text/x-fossil-wiki"
- severity changed to: "Critical"
- status changed to: "Open"
- title changed to: "DISTINCT malfunctions for VIEW with virtual table"
- type changed to: "Code_Defect"