<verbatim>
$ ./sqlite3
SQLite version 3.7.16 2013-01-08 12:48:10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE t1(a INTEGER PRIMARY KEY);
sqlite> CREATE TABLE t2(b INTEGER PRIMARY KEY, c INTEGER);
sqlite> CREATE TABLE t3(d INTEGER);
sqlite>
sqlite> INSERT INTO t1 VALUES(1);
sqlite> INSERT INTO t1 VALUES(2);
sqlite> INSERT INTO t1 VALUES(3);
sqlite>
sqlite> INSERT INTO t2 VALUES(3, 1);
sqlite> INSERT INTO t2 VALUES(4, 2);
sqlite> INSERT INTO t2 VALUES(5, 3);
sqlite>
sqlite> INSERT INTO t3 VALUES(4);
sqlite> INSERT INTO t3 VALUES(3);
sqlite> INSERT INTO t3 VALUES(5);
sqlite>
sqlite> SELECT t1.a FROM t1, t2, t3 WHERE t1.a=t2.c AND t2.b=t3.d ORDER BY t1.a;
2
1
3
</verbatim>

Problem introduced by [956e4d7f89].

First reported on the mailing list: