aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-12-04 21:54:58 +0000
committerdrh <drh@noemail.net>2014-12-04 21:54:58 +0000
commitdea7d70d1b9516956a7550d0ffde1b4560fc77ca (patch)
tree82304077c7c580d144586ed27b33e179db87fa1e /src/select.c
parent1d324880370ae70e7c9af187f59c3f3c351b0ef4 (diff)
downloadsqlite-dea7d70d1b9516956a7550d0ffde1b4560fc77ca.tar.gz
sqlite-dea7d70d1b9516956a7550d0ffde1b4560fc77ca.zip
Make sure that a DISTINCT query with an ORDER BY works correctly even if
it uses a descending index. Fix for ticket [c5ea805691bfc4204b1cb9e]. FossilOrigin-Name: 0d3aef97ebddf422b8bdcbc5878970c6129e3f54
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index 3b422f110..070ac0041 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4829,7 +4829,7 @@ int sqlite3Select(
**
** is transformed to:
**
- ** SELECT xyz FROM ... GROUP BY xyz
+ ** SELECT xyz FROM ... GROUP BY xyz ORDER BY xyz
**
** The second form is preferred as a single index (or temp-table) may be
** used for both the ORDER BY and DISTINCT processing. As originally
@@ -4842,7 +4842,6 @@ int sqlite3Select(
p->selFlags &= ~SF_Distinct;
p->pGroupBy = sqlite3ExprListDup(db, p->pEList, 0);
pGroupBy = p->pGroupBy;
- sSort.pOrderBy = 0;
/* Notice that even thought SF_Distinct has been cleared from p->selFlags,
** the sDistinct.isTnct is still set. Hence, isTnct represents the
** original setting of the SF_Distinct flag, not the current setting */