The following SQL outputs rows in the incorrect order for SQLite
versions 3.8.7 and 3.8.8:

<blockquote><verbatim>
CREATE TABLE t1(x);
INSERT INTO t1(x) VALUES(1),(5),(3),(4),(2);
SELECT
   x, 01, 02, 03, 04, 05, 06, 07, 08, 09,
  10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
  20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
  30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
  40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
  50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60
FROM t1
ORDER BY x
LIMIT -1;


In order to hit this bug, there must be an ORDER BY clause and a LIMIT
clause and the number of columns in the query plus the number of sort
keys needs to sum to exactly 62.  Adding or removing a single column
from the result set yields the correct answer.

This bug first appeared in check-in [b1c0f0bc1bd8a] which is when the
multi-threaded sorter was introduced.