|18:02||• Fixed ticket [123c9ba3]: Incorrect result when an index is used for an ordered join plus 5 other changes (artifact: fa2161e1 user: drh)|
|18:01||Correctly invalidate a column cache line when it is overwritten with NULL. Fix for ticket [123c9ba32130a6c9d432]. (check-in: 65754dc3 user: drh tags: trunk)|
|16:33||• New ticket [123c9ba3] Incorrect result when an index is used for an ordered join. (artifact: da421d67 user: drh)|
|Title:||Incorrect result when an index is used for an ordered join|
|Last Modified:||2017-12-13 18:02:03|
|Version Found In:||3.21.0|
drh added on 2017-12-13 16:33:55:
The query in the SQL below gets a different answer after the index is created. The answer without the index is correct.
CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1,2); CREATE TABLE t2(x, y); INSERT INTO t2 VALUES(1,3); SELECT y FROM t1, t2 WHERE a=x AND b<=y ORDER BY b DESC; CREATE INDEX t1ab ON t1(a,b); SELECT y FROM t1, t2 WHERE a=x AND b<=y ORDER BY b DESC;
This problem appears to have been introduced by check-in [559733b09e] on 2016-05-20, 572 days ago. The problem first appeared in version 3.14.0. The problem was discovered in the wild and reported to the SQLite developers via private email.