[daap] Fix problem where playlists in Remote are not in correct order

Apparantly having "LIMIT -1 OFFSET 0" makes (certain versions?) of
sqlite3 unable to do the "ORDER BY". Might be a bug in sqlite. This
is only a partial fix, which will work for queries that don't actually
use an index. Those few that do may still be broken.
This commit is contained in:
ejurgensen 2016-04-10 00:11:33 +02:00
parent 06663e4ca2
commit 3be8afac7b

View File

@ -638,7 +638,10 @@ get_query_params(struct evkeyvalq *query, int *sort_headers, struct query_params
else
qp->limit = (high - low) + 1;
qp->idx_type = I_SUB;
if (qp->limit == -1 && qp->offset == 0)
qp->idx_type = I_NONE;
else
qp->idx_type = I_SUB;
qp->sort = S_NONE;
param = evhttp_find_header(query, "sort");