SQLite

View Ticket
Login
Ticket Hash: f69b96e3076edb882ef52efde04ba8d58d27d2d0
Title: Over-aggressive optimization of ORDER BY using a virtual table with IN operator
Status: Fixed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2013-04-18 02:55:56
Version Found In: 3.7.16.2
User Comments:
drh added on 2013-04-17 23:38:35:

When a query of a virtual table uses an IN operator in the WHERE clause as its index and it has an ORDER BY clause, it is possible that the ORDER BY clause might be optimized away and the sort omitted when in fact the sort is required for the correct answer.

This problem appears to have been introduced by check-in [3d65c70343] on 2012-12-14 for version 3.7.16.