The following SQL has two identical joins, one with and the other without an
ORDER BY clause.  The one without ORDER BY correctly returns two rows of
result.  The one with ORDER BY returns no rows.

<blockquote><verbatim>
CREATE TABLE A(Name text);
CREATE TABLE Items(ItemName text , Name text);
INSERT INTO Items VALUES('Item1','Parent');
INSERT INTO Items VALUES('Item2','Parent');
CREATE TABLE B(Name text);

SELECT Items.ItemName
  FROM Items
    LEFT JOIN A ON (A.Name = Items.ItemName and Items.ItemName = 'dummy')
    LEFT JOIN B ON (B.Name = Items.ItemName)
  WHERE Items.Name = 'Parent';

SELECT Items.ItemName
  FROM Items
    LEFT JOIN A ON (A.Name = Items.ItemName and Items.ItemName = 'dummy')
    LEFT JOIN B ON (B.Name = Items.ItemName)
  WHERE Items.Name = 'Parent'
ORDER BY Items.ItemName;


This error seems to have been introduced by check-in [d95d0313c447f5]
which was first delivered in SQLite version 3.8.8.