aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c4
-rw-r--r--src/where.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/select.c b/src/select.c
index 9275c47d5..6effc49d5 100644
--- a/src/select.c
+++ b/src/select.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.448 2008/07/08 17:43:57 danielk1977 Exp $
+** $Id: select.c,v 1.449 2008/07/08 18:05:26 drh Exp $
*/
#include "sqliteInt.h"
@@ -4241,7 +4241,7 @@ int sqlite3Select(
if( flag ){
pDel = pMinMax = sqlite3ExprListDup(db, p->pEList->a[0].pExpr->pList);
if( pMinMax && !db->mallocFailed ){
- pMinMax->a[0].sortOrder = ((flag==WHERE_ORDERBY_MIN)?0:1);
+ pMinMax->a[0].sortOrder = flag!=WHERE_ORDERBY_MIN;
pMinMax->a[0].pExpr->op = TK_COLUMN;
}
}
diff --git a/src/where.c b/src/where.c
index 009dd4848..97edf5be7 100644
--- a/src/where.c
+++ b/src/where.c
@@ -16,7 +16,7 @@
** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer".
**
-** $Id: where.c,v 1.311 2008/06/26 18:04:03 danielk1977 Exp $
+** $Id: where.c,v 1.312 2008/07/08 18:05:26 drh Exp $
*/
#include "sqliteInt.h"
@@ -2157,7 +2157,8 @@ WhereInfo *sqlite3WhereBegin(
ppIdxInfo);
flags = WHERE_VIRTUALTABLE;
pIndex = *ppIdxInfo;
- if( pIndex && pIndex->orderByConsumed ){
+ assert( pIndex!=0 );
+ if( pIndex->orderByConsumed ){
flags = WHERE_VIRTUALTABLE | WHERE_ORDERBY;
}
pIdx = 0;
@@ -2546,8 +2547,9 @@ WhereInfo *sqlite3WhereBegin(
if( (wflags&WHERE_ORDERBY_MIN)!=0
&& (pLevel->flags&WHERE_ORDERBY)
&& (pIdx->nColumn>nEq)
- && (pOrderBy->a[0].pExpr->iColumn==pIdx->aiColumn[nEq])
){
+ assert( pOrderBy->nExpr==1 );
+ assert( pOrderBy->a[0].pExpr->iColumn==pIdx->aiColumn[nEq] );
isMinQuery = 1;
}