-C Make\sa\strivial\scomment\sfix\sin\swhere.c.
-D 2013-07-01T10:38:35.899
+C Further\sminor\scomment\scorrections\sand\senhancements\sin\swhere.c.
+D 2013-07-01T11:05:50.653
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 5e41da95d92656a5004b03d3576e8b226858a28e
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/wal.c 7dc3966ef98b74422267e7e6e46e07ff6c6eb1b4
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c 4fa43583d0a84b48f93b1e88f11adf2065be4e73
-F src/where.c 789d319334c44d13be7a232ccced9646e8e85748
+F src/where.c 3ea606b1282032b9cc00ee7b1bb9c1d3683f7ea1
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/aggnested.test 45c0201e28045ad38a530b5a144b73cd4aa2cfd6
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
F tool/wherecosttest.c f407dc4c79786982a475261866a161cd007947ae
F tool/win/sqlite.vsix 97894c2790eda7b5bce3cc79cb2a8ec2fde9b3ac
-P 60b65e5ee3828c2a814bf035b57b3e8681af9397
-R 3bd4c794e157d911cc3628c2a23029da
+P 0ffaab3b9c97f4dba0f0ca6e146c8dc2775f7b1c
+R 73899855654d4162ca36e6c20fb7ad55
U drh
-Z aca7802d1aec7347f7fd3f712b301f29
+Z 9148660e3c1a93ae29b1da887b939490
/*
-** Add all WhereLoop objects a single table of the join were the table
+** Add all WhereLoop objects for a single table of the join were the table
** is idenfied by pBuilder->pNew->iTab. That table is guaranteed to be
** a b-tree table, not a virtual table.
*/
/*
** Examine a WherePath (with the addition of the extra WhereLoop of the 5th
** parameters) to see if it outputs rows in the requested ORDER BY
-** (or GROUP BY) without requiring a separate source operation. Return:
+** (or GROUP BY) without requiring a separate sort operation. Return:
**
** 0: ORDER BY is not satisfied. Sorting required
** 1: ORDER BY is satisfied. Omit sorting
** -1: Unknown at this time
**
+** Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as
+** strict. With GROUP BY and DISTINCT the only requirement is that
+** equivalent rows appear immediately adjacent to one another. GROUP BY
+** and DISTINT do not require rows to appear in any particular order as long
+** as equivelent rows are grouped together. Thus for GROUP BY and DISTINCT
+** the pOrderBy terms can be matched in any order. With ORDER BY, the
+** pOrderBy terms must be matched in strict left-to-right order.
*/
static int wherePathSatisfiesOrderBy(
WhereInfo *pWInfo, /* The WHERE clause */
**
** ORDER BY CLAUSE PROCESSING
**
-** pOrderBy is a pointer to the ORDER BY clause of a SELECT statement,
+** pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause
+** if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement
** if there is one. If there is no ORDER BY clause or if this routine
** is called from an UPDATE or DELETE statement, then pOrderBy is NULL.
*/